From 59d3d9a3461a505368988423d792e9a4f517286a Mon Sep 17 00:00:00 2001 From: ZiWei Chen <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 5 Sep 2024 15:22:10 +0800 Subject: [PATCH] [mgmt] billing release (#30990) https://github.com/Azure/sdk-release-request/issues/5457 --- common/config/rush/pnpm-lock.yaml | 6 +- sdk/billing/arm-billing/CHANGELOG.md | 1388 +- sdk/billing/arm-billing/LICENSE | 2 +- sdk/billing/arm-billing/README.md | 2 +- sdk/billing/arm-billing/_meta.json | 10 +- sdk/billing/arm-billing/assets.json | 2 +- sdk/billing/arm-billing/package.json | 27 +- .../arm-billing/review/arm-billing.api.md | 5912 ++++++-- .../samples-dev/addressValidateSample.ts | 40 +- .../samples-dev/agreementsGetSample.ts | 19 +- .../agreementsListByBillingAccountSample.ts | 27 +- .../associatedTenantsCreateOrUpdateSample.ts | 48 + .../associatedTenantsDeleteSample.ts | 40 + .../samples-dev/associatedTenantsGetSample.ts | 40 + ...ciatedTenantsListByBillingAccountSample.ts | 41 + ...ilableBalancesGetByBillingAccountSample.ts | 37 + ...ilableBalancesGetByBillingProfileSample.ts | 40 + .../samples-dev/availableBalancesGetSample.ts | 33 - .../billingAccountsAddPaymentTermsSample.ts | 46 + ...billingAccountsCancelPaymentTermsSample.ts | 40 + .../billingAccountsConfirmTransitionSample.ts | 37 + .../samples-dev/billingAccountsGetSample.ts | 101 +- ...onsByCreateSubscriptionPermissionSample.ts | 21 +- .../samples-dev/billingAccountsListSample.ts | 44 +- .../billingAccountsUpdateSample.ts | 74 +- ...llingAccountsValidatePaymentTermsSample.ts | 72 + .../samples-dev/billingPeriodsGetSample.ts | 29 - .../samples-dev/billingPeriodsListSample.ts | 31 - ...ssionsCheckAccessByBillingAccountSample.ts | 48 + ...ssionsCheckAccessByBillingProfileSample.ts | 50 + ...gPermissionsCheckAccessByCustomerSample.ts | 52 + ...ermissionsCheckAccessByDepartmentSample.ts | 50 + ...onsCheckAccessByEnrollmentAccountSample.ts | 50 + ...ssionsCheckAccessByInvoiceSectionSample.ts | 52 + ...ngPermissionsListByBillingAccountSample.ts | 21 +- ...ngPermissionsListByBillingProfileSample.ts | 23 +- ...onsListByCustomerAtBillingAccountSample.ts | 43 + .../billingPermissionsListByCustomerSample.ts | 25 +- ...illingPermissionsListByDepartmentSample.ts | 42 + ...ermissionsListByEnrollmentAccountSample.ts | 42 + ...gPermissionsListByInvoiceSectionSample.ts} | 31 +- .../billingProfilesCreateOrUpdateSample.ts | 74 +- .../billingProfilesDeleteSample.ts | 40 + .../samples-dev/billingProfilesGetSample.ts | 52 +- ...llingProfilesListByBillingAccountSample.ts | 49 +- ...ProfilesValidateDeleteEligibilitySample.ts | 60 + .../samples-dev/billingPropertyGetSample.ts | 55 +- .../billingPropertyUpdateSample.ts | 55 +- .../billingRequestsCreateOrUpdateSample.ts | 48 + .../samples-dev/billingRequestsGetSample.ts | 35 + ...llingRequestsListByBillingAccountSample.ts | 41 + ...llingRequestsListByBillingProfileSample.ts | 43 + .../billingRequestsListByCustomerSample.ts | 45 + ...llingRequestsListByInvoiceSectionSample.ts | 45 + .../billingRequestsListByUserSample.ts | 59 + ...AssignmentsCreateByBillingAccountSample.ts | 50 + ...AssignmentsCreateByBillingProfileSample.ts | 52 + ...ngRoleAssignmentsCreateByCustomerSample.ts | 54 + ...AssignmentsCreateByInvoiceSectionSample.ts | 54 + ...ntsCreateOrUpdateByBillingAccountSample.ts | 53 + ...gnmentsCreateOrUpdateByDepartmentSample.ts | 55 + ...CreateOrUpdateByEnrollmentAccountSample.ts | 55 + ...AssignmentsDeleteByBillingAccountSample.ts | 28 +- ...AssignmentsDeleteByBillingProfileSample.ts | 30 +- ...ngRoleAssignmentsDeleteByCustomerSample.ts | 45 + ...RoleAssignmentsDeleteByDepartmentSample.ts | 41 + ...ignmentsDeleteByEnrollmentAccountSample.ts | 41 + ...AssignmentsDeleteByInvoiceSectionSample.ts | 32 +- ...oleAssignmentsGetByBillingAccountSample.ts | 28 +- ...oleAssignmentsGetByBillingProfileSample.ts | 26 +- ...llingRoleAssignmentsGetByCustomerSample.ts | 45 + ...ingRoleAssignmentsGetByDepartmentSample.ts | 41 + ...AssignmentsGetByEnrollmentAccountSample.ts | 41 + ...oleAssignmentsGetByInvoiceSectionSample.ts | 28 +- ...leAssignmentsListByBillingAccountSample.ts | 25 +- ...leAssignmentsListByBillingProfileSample.ts | 27 +- ...lingRoleAssignmentsListByCustomerSample.ts | 45 + ...ngRoleAssignmentsListByDepartmentSample.ts | 43 + ...ssignmentsListByEnrollmentAccountSample.ts | 42 + ...leAssignmentsListByInvoiceSectionSample.ts | 25 +- ...ssignmentsResolveByBillingAccountSample.ts | 39 + ...ssignmentsResolveByBillingProfileSample.ts | 41 + ...gRoleAssignmentsResolveByCustomerSample.ts | 43 + ...ssignmentsResolveByInvoiceSectionSample.ts | 43 + ...RoleDefinitionGetByBillingAccountSample.ts | 41 + ...oleDefinitionGetByBillingProfileSample.ts} | 34 +- ...illingRoleDefinitionGetByCustomerSample.ts | 44 + ...lingRoleDefinitionGetByDepartmentSample.ts | 41 + ...eDefinitionGetByEnrollmentAccountSample.ts | 42 + ...oleDefinitionGetByInvoiceSectionSample.ts} | 38 +- ...leDefinitionListByBillingAccountSample.ts} | 27 +- ...leDefinitionListByBillingProfileSample.ts} | 29 +- ...llingRoleDefinitionListByCustomerSample.ts | 45 + ...ingRoleDefinitionListByDepartmentSample.ts | 42 + ...DefinitionListByEnrollmentAccountSample.ts | 42 + ...leDefinitionListByInvoiceSectionSample.ts} | 27 +- ...oleDefinitionsGetByBillingAccountSample.ts | 33 - ...ubscriptionsAliasesCreateOrUpdateSample.ts | 52 + .../billingSubscriptionsAliasesGetSample.ts | 40 + ...ptionsAliasesListByBillingAccountSample.ts | 41 + .../billingSubscriptionsCancelSample.ts | 48 + .../billingSubscriptionsDeleteSample.ts | 40 + ...gSubscriptionsGetByBillingProfileSample.ts | 41 + .../billingSubscriptionsGetSample.ts | 29 +- ...SubscriptionsListByBillingAccountSample.ts | 35 +- ...SubscriptionsListByBillingProfileSample.ts | 45 +- ...onsListByCustomerAtBillingAccountSample.ts | 43 + ...illingSubscriptionsListByCustomerSample.ts | 23 +- ...scriptionsListByEnrollmentAccountSample.ts | 42 + ...SubscriptionsListByInvoiceSectionSample.ts | 23 +- .../billingSubscriptionsMergeSample.ts | 48 + .../billingSubscriptionsMoveSample.ts | 35 +- .../billingSubscriptionsSplitSample.ts | 51 + .../billingSubscriptionsUpdateSample.ts | 37 +- ...scriptionsValidateMoveEligibilitySample.ts | 73 + .../billingSubscriptionsValidateMoveSample.ts | 63 - .../customersGetByBillingAccountSample.ts | 40 + .../samples-dev/customersGetSample.ts | 47 +- .../customersListByBillingAccountSample.ts | 48 +- .../customersListByBillingProfileSample.ts | 21 +- .../samples-dev/departmentsGetSample.ts | 39 + .../departmentsListByBillingAccountSample.ts | 40 + ...enrollmentAccountsGetByDepartmentSample.ts | 41 + .../enrollmentAccountsGetSample.ts | 28 +- ...lmentAccountsListByBillingAccountSample.ts | 40 + ...nrollmentAccountsListByDepartmentSample.ts | 42 + .../samples-dev/instructionsGetSample.ts | 35 - .../samples-dev/instructionsPutSample.ts | 41 - .../invoiceSectionsCreateOrUpdateSample.ts | 31 +- .../invoiceSectionsDeleteSample.ts | 42 + .../samples-dev/invoiceSectionsGetSample.ts | 25 +- ...voiceSectionsListByBillingProfileSample.ts | 31 +- ...SectionsValidateDeleteEligibilitySample.ts | 64 + .../samples-dev/invoicesAmendSample.ts | 40 + ...ownloadBillingSubscriptionInvoiceSample.ts | 33 - .../invoicesDownloadByBillingAccountSample.ts | 48 + ...icesDownloadByBillingSubscriptionSample.ts | 49 + ...DownloadDocumentsByBillingAccountSample.ts | 47 + ...oadDocumentsByBillingSubscriptionSample.ts | 47 + .../invoicesDownloadInvoiceSample.ts | 35 - ...oadMultipleBillingProfileInvoicesSample.ts | 37 - ...ltipleBillingSubscriptionInvoicesSample.ts | 35 - ...esDownloadSummaryByBillingAccountSample.ts | 40 + .../invoicesGetByBillingAccountSample.ts | 40 + .../invoicesGetByBillingSubscriptionSample.ts | 38 + ...icesGetBySubscriptionAndInvoiceIdSample.ts | 31 - .../samples-dev/invoicesGetSample.ts | 73 +- .../invoicesListByBillingAccountSample.ts | 61 +- .../invoicesListByBillingProfileSample.ts | 59 +- ...invoicesListByBillingSubscriptionSample.ts | 39 +- ...sListSample.ts => operationsListSample.ts} | 23 +- .../partnerTransfersCancelSample.ts | 44 + .../samples-dev/partnerTransfersGetSample.ts | 44 + .../partnerTransfersInitiateSample.ts | 51 + .../samples-dev/partnerTransfersListSample.ts | 45 + .../paymentMethodsDeleteByUserSample.ts | 35 + ...paymentMethodsGetByBillingAccountSample.ts | 40 + ...paymentMethodsGetByBillingProfileSample.ts | 42 + .../paymentMethodsGetByUserSample.ts | 35 + ...aymentMethodsListByBillingAccountSample.ts | 41 + ...aymentMethodsListByBillingProfileSample.ts | 43 + .../paymentMethodsListByUserSample.ts} | 27 +- ...iesCreateOrUpdateByBillingAccountSample.ts | 52 + ...iesCreateOrUpdateByBillingProfileSample.ts | 53 + ...rUpdateByCustomerAtBillingAccountSample.ts | 43 + ...policiesCreateOrUpdateByCustomerSample.ts} | 29 +- .../policiesGetByBillingAccountSample.ts | 35 + .../policiesGetByBillingProfileSample.ts | 23 +- ...ciesGetByCustomerAtBillingAccountSample.ts | 40 + .../policiesGetByCustomerSample.ts | 27 +- .../policiesGetBySubscriptionSample.ts | 37 + .../samples-dev/policiesUpdateSample.ts | 39 - .../samples-dev/productsGetSample.ts | 21 +- .../productsListByBillingAccountSample.ts | 19 +- .../productsListByBillingProfileSample.ts | 21 +- .../productsListByCustomerSample.ts | 23 +- .../productsListByInvoiceSectionSample.ts | 23 +- .../samples-dev/productsMoveSample.ts | 33 +- .../samples-dev/productsUpdateSample.ts | 27 +- .../productsValidateMoveEligibilitySample.ts} | 56 +- .../recipientTransfersAcceptSample.ts | 47 + .../recipientTransfersDeclineSample.ts} | 24 +- .../recipientTransfersGetSample.ts | 35 + .../recipientTransfersListSample.ts | 37 + .../recipientTransfersValidateSample.ts | 47 + ...ervationOrdersGetByBillingAccountSample.ts | 60 + ...rvationOrdersListByBillingAccountSample.ts | 41 + ...reservationsGetByReservationOrderSample.ts | 108 + .../reservationsListByBillingAccountSample.ts | 31 +- .../reservationsListByBillingProfileSample.ts | 29 +- ...eservationsListByReservationOrderSample.ts | 43 + ...eservationsUpdateByBillingAccountSample.ts | 44 + ...ingsPlanOrdersGetByBillingAccountSample.ts | 60 + ...gsPlanOrdersListByBillingAccountSample.ts} | 27 +- .../savingsPlansGetByBillingAccountSample.ts | 64 + .../savingsPlansListByBillingAccountSample.ts | 53 + ...avingsPlansListBySavingsPlanOrderSample.ts | 43 + ...avingsPlansUpdateByBillingAccountSample.ts | 74 + ...ansValidateUpdateByBillingAccountSample.ts | 56 + ...onsGetTransactionSummaryByInvoiceSample.ts | 40 + .../transactionsListByBillingProfileSample.ts | 59 + .../transactionsListByCustomerSample.ts | 58 + .../transactionsListByInvoiceSample.ts | 21 +- .../transactionsListByInvoiceSectionSample.ts | 61 + ...ionsTransactionsDownloadByInvoiceSample.ts | 41 + .../samples-dev/transfersCancelSample.ts | 44 + .../samples-dev/transfersGetSample.ts | 44 + .../samples-dev/transfersInitiateSample.ts | 51 + .../samples-dev/transfersListSample.ts | 45 + .../samples/v4/javascript/README.md | 204 - .../javascript/availableBalancesGetSample.js | 30 - .../v4/javascript/billingAccountsGetSample.js | 48 - .../javascript/billingAccountsUpdateSample.js | 42 - .../v4/javascript/billingPeriodsGetSample.js | 29 - .../v4/javascript/billingPeriodsListSample.js | 31 - .../billingProfilesCreateOrUpdateSample.js | 49 - .../v4/javascript/billingProfilesGetSample.js | 50 - ...llingProfilesListByBillingAccountSample.js | 54 - .../v4/javascript/billingPropertyGetSample.js | 28 - .../javascript/billingPropertyUpdateSample.js | 29 - ...AssignmentsDeleteByBillingAccountSample.js | 33 - ...AssignmentsDeleteByBillingProfileSample.js | 35 - ...AssignmentsDeleteByInvoiceSectionSample.js | 37 - ...SubscriptionsListByBillingProfileSample.js | 36 - .../billingSubscriptionsMoveSample.js | 33 - .../billingSubscriptionsUpdateSample.js | 30 - .../billingSubscriptionsValidateMoveSample.js | 54 - .../v4/javascript/customersGetSample.js | 50 - .../customersListByBillingAccountSample.js | 32 - .../v4/javascript/instructionsGetSample.js | 35 - .../instructionsListByBillingProfileSample.js | 36 - .../v4/javascript/instructionsPutSample.js | 41 - ...ownloadBillingSubscriptionInvoiceSample.js | 33 - .../invoicesDownloadInvoiceSample.js | 35 - ...ltipleBillingSubscriptionInvoicesSample.js | 35 - .../v4/javascript/invoicesGetSample.js | 84 - .../invoicesListByBillingAccountSample.js | 64 - .../invoicesListByBillingProfileSample.js | 68 - .../samples/v4/typescript/README.md | 217 - .../src/availableBalancesGetSample.ts | 33 - .../src/billingAccountsGetSample.ts | 51 - .../src/billingAccountsUpdateSample.ts | 48 - .../typescript/src/billingPeriodsGetSample.ts | 29 - .../src/billingPeriodsListSample.ts | 31 - .../billingProfilesCreateOrUpdateSample.ts | 49 - .../src/billingProfilesGetSample.ts | 60 - ...llingProfilesListByBillingAccountSample.ts | 62 - .../src/billingPropertyGetSample.ts | 28 - .../src/billingPropertyUpdateSample.ts | 29 - ...AssignmentsDeleteByBillingAccountSample.ts | 33 - ...AssignmentsDeleteByBillingProfileSample.ts | 35 - ...AssignmentsDeleteByInvoiceSectionSample.ts | 37 - ...oleDefinitionsGetByBillingAccountSample.ts | 33 - ...SubscriptionsListByBillingAccountSample.ts | 34 - ...SubscriptionsListByBillingProfileSample.ts | 36 - .../src/billingSubscriptionsMoveSample.ts | 39 - .../src/billingSubscriptionsUpdateSample.ts | 36 - .../billingSubscriptionsValidateMoveSample.ts | 63 - .../v4/typescript/src/customersGetSample.ts | 57 - .../customersListByBillingAccountSample.ts | 34 - .../typescript/src/instructionsGetSample.ts | 35 - .../typescript/src/instructionsPutSample.ts | 41 - ...ownloadBillingSubscriptionInvoiceSample.ts | 33 - .../src/invoicesDownloadInvoiceSample.ts | 35 - ...oadMultipleBillingProfileInvoicesSample.ts | 37 - ...ltipleBillingSubscriptionInvoicesSample.ts | 35 - .../typescript/src/invoicesGetByIdSample.ts | 29 - ...icesGetBySubscriptionAndInvoiceIdSample.ts | 31 - .../v4/typescript/src/invoicesGetSample.ts | 84 - .../src/invoicesListByBillingAccountSample.ts | 64 - .../src/invoicesListByBillingProfileSample.ts | 68 - .../v4/typescript/src/policiesUpdateSample.ts | 39 - .../samples/v5/javascript/README.md | 424 + .../javascript/addressValidateSample.js | 34 +- .../javascript/agreementsGetSample.js | 17 +- .../agreementsListByBillingAccountSample.js | 19 +- .../associatedTenantsCreateOrUpdateSample.js | 46 + .../associatedTenantsDeleteSample.js | 38 + .../javascript/associatedTenantsGetSample.js | 35 + ...ciatedTenantsListByBillingAccountSample.js | 37 + ...ilableBalancesGetByBillingAccountSample.js | 34 + ...ilableBalancesGetByBillingProfileSample.js | 38 + .../billingAccountsAddPaymentTermsSample.js | 44 + ...billingAccountsCancelPaymentTermsSample.js | 38 + .../billingAccountsConfirmTransitionSample.js | 34 + .../v5/javascript/billingAccountsGetSample.js | 112 + ...onsByCreateSubscriptionPermissionSample.js | 19 +- .../javascript/billingAccountsListSample.js | 40 +- .../javascript/billingAccountsUpdateSample.js | 65 + ...llingAccountsValidatePaymentTermsSample.js | 64 + ...ssionsCheckAccessByBillingAccountSample.js | 43 + ...ssionsCheckAccessByBillingProfileSample.js | 45 + ...gPermissionsCheckAccessByCustomerSample.js | 47 + ...ermissionsCheckAccessByDepartmentSample.js | 45 + ...onsCheckAccessByEnrollmentAccountSample.js | 45 + ...ssionsCheckAccessByInvoiceSectionSample.js | 47 + ...ngPermissionsListByBillingAccountSample.js | 17 +- ...ngPermissionsListByBillingProfileSample.js | 21 +- ...onsListByCustomerAtBillingAccountSample.js | 41 + .../billingPermissionsListByCustomerSample.js | 23 +- ...illingPermissionsListByDepartmentSample.js | 40 + ...ermissionsListByEnrollmentAccountSample.js | 40 + ...gPermissionsListByInvoiceSectionSample.js} | 29 +- .../billingProfilesCreateOrUpdateSample.js | 77 + .../javascript/billingProfilesDeleteSample.js | 38 + .../v5/javascript/billingProfilesGetSample.js | 35 + ...llingProfilesListByBillingAccountSample.js | 37 + ...ProfilesValidateDeleteEligibilitySample.js | 58 + .../v5/javascript/billingPropertyGetSample.js | 66 + .../javascript/billingPropertyUpdateSample.js | 66 + .../billingRequestsCreateOrUpdateSample.js | 46 + .../javascript/billingRequestsGetSample.js} | 22 +- ...llingRequestsListByBillingAccountSample.js | 37 + ...llingRequestsListByBillingProfileSample.js | 41 + .../billingRequestsListByCustomerSample.js | 43 + ...llingRequestsListByInvoiceSectionSample.js | 43 + .../billingRequestsListByUserSample.js | 54 + ...AssignmentsCreateByBillingAccountSample.js | 44 + ...AssignmentsCreateByBillingProfileSample.js | 46 + ...ngRoleAssignmentsCreateByCustomerSample.js | 48 + ...AssignmentsCreateByInvoiceSectionSample.js | 48 + ...ntsCreateOrUpdateByBillingAccountSample.js | 47 + ...gnmentsCreateOrUpdateByDepartmentSample.js | 49 + ...CreateOrUpdateByEnrollmentAccountSample.js | 49 + ...AssignmentsDeleteByBillingAccountSample.js | 39 + ...AssignmentsDeleteByBillingProfileSample.js | 41 + ...ngRoleAssignmentsDeleteByCustomerSample.js | 43 + ...RoleAssignmentsDeleteByDepartmentSample.js | 39 + ...ignmentsDeleteByEnrollmentAccountSample.js | 39 + ...AssignmentsDeleteByInvoiceSectionSample.js | 43 + ...oleAssignmentsGetByBillingAccountSample.js | 26 +- ...oleAssignmentsGetByBillingProfileSample.js | 24 +- ...llingRoleAssignmentsGetByCustomerSample.js | 43 + ...ingRoleAssignmentsGetByDepartmentSample.js | 39 + ...AssignmentsGetByEnrollmentAccountSample.js | 39 + ...oleAssignmentsGetByInvoiceSectionSample.js | 26 +- ...leAssignmentsListByBillingAccountSample.js | 21 +- ...leAssignmentsListByBillingProfileSample.js | 25 +- ...lingRoleAssignmentsListByCustomerSample.js | 43 + ...ngRoleAssignmentsListByDepartmentSample.js | 41 + ...ssignmentsListByEnrollmentAccountSample.js | 40 + ...leAssignmentsListByInvoiceSectionSample.js | 23 +- ...ssignmentsResolveByBillingAccountSample.js | 35 + ...ssignmentsResolveByBillingProfileSample.js | 38 + ...gRoleAssignmentsResolveByCustomerSample.js | 40 + ...ssignmentsResolveByInvoiceSectionSample.js | 40 + ...oleDefinitionGetByBillingAccountSample.js} | 27 +- ...oleDefinitionGetByBillingProfileSample.js} | 25 +- ...illingRoleDefinitionGetByCustomerSample.js | 42 + ...lingRoleDefinitionGetByDepartmentSample.js | 39 + ...eDefinitionGetByEnrollmentAccountSample.js | 39 + ...oleDefinitionGetByInvoiceSectionSample.js} | 27 +- ...leDefinitionListByBillingAccountSample.js} | 25 +- ...leDefinitionListByBillingProfileSample.js} | 27 +- ...llingRoleDefinitionListByCustomerSample.js | 43 + ...ingRoleDefinitionListByDepartmentSample.js | 40 + ...DefinitionListByEnrollmentAccountSample.js | 40 + ...leDefinitionListByInvoiceSectionSample.js} | 25 +- ...ubscriptionsAliasesCreateOrUpdateSample.js | 46 + .../billingSubscriptionsAliasesGetSample.js | 35 + ...ptionsAliasesListByBillingAccountSample.js | 39 + .../billingSubscriptionsCancelSample.js | 43 + .../billingSubscriptionsDeleteSample.js | 38 + ...gSubscriptionsGetByBillingProfileSample.js | 39 + .../billingSubscriptionsGetSample.js | 24 +- ...SubscriptionsListByBillingAccountSample.js | 30 +- ...SubscriptionsListByBillingProfileSample.js | 63 + ...onsListByCustomerAtBillingAccountSample.js | 41 + ...illingSubscriptionsListByCustomerSample.js | 21 +- ...scriptionsListByEnrollmentAccountSample.js | 40 + ...SubscriptionsListByInvoiceSectionSample.js | 21 +- .../billingSubscriptionsMergeSample.js | 43 + .../billingSubscriptionsMoveSample.js | 43 + .../billingSubscriptionsSplitSample.js | 46 + .../billingSubscriptionsUpdateSample.js | 42 + ...scriptionsValidateMoveEligibilitySample.js | 68 + .../customersGetByBillingAccountSample.js | 35 + .../v5/javascript/customersGetSample.js | 36 + .../customersListByBillingAccountSample.js | 58 + .../customersListByBillingProfileSample.js | 19 +- .../v5/javascript/departmentsGetSample.js | 34 + .../departmentsListByBillingAccountSample.js | 36 + ...enrollmentAccountsGetByDepartmentSample.js | 39 + .../javascript/enrollmentAccountsGetSample.js | 34 + ...lmentAccountsListByBillingAccountSample.js | 36 + ...nrollmentAccountsListByDepartmentSample.js | 40 + .../invoiceSectionsCreateOrUpdateSample.js | 29 +- .../javascript/invoiceSectionsDeleteSample.js | 40 + .../javascript/invoiceSectionsGetSample.js | 23 +- ...voiceSectionsListByBillingProfileSample.js | 24 +- ...SectionsValidateDeleteEligibilitySample.js | 62 + .../v5/javascript/invoicesAmendSample.js | 35 + .../invoicesDownloadByBillingAccountSample.js | 43 + ...icesDownloadByBillingSubscriptionSample.js | 42 + ...DownloadDocumentsByBillingAccountSample.js | 41 + ...adDocumentsByBillingSubscriptionSample.js} | 28 +- ...esDownloadSummaryByBillingAccountSample.js | 37 + .../invoicesGetByBillingAccountSample.js | 35 + .../invoicesGetByBillingSubscriptionSample.js | 35 + .../javascript/invoicesGetSample.js} | 18 +- .../invoicesListByBillingAccountSample.js | 43 + .../invoicesListByBillingProfileSample.js | 48 + ...invoicesListByBillingSubscriptionSample.js | 31 +- .../javascript/operationsListSample.js} | 20 +- .../{v4 => v5}/javascript/package.json | 0 .../partnerTransfersCancelSample.js | 42 + .../javascript/partnerTransfersGetSample.js | 42 + .../partnerTransfersInitiateSample.js | 46 + .../javascript/partnerTransfersListSample.js | 43 + .../paymentMethodsDeleteByUserSample.js} | 22 +- ...paymentMethodsGetByBillingAccountSample.js | 38 + ...paymentMethodsGetByBillingProfileSample.js | 40 + .../paymentMethodsGetByUserSample.js | 33 + ...aymentMethodsListByBillingAccountSample.js | 37 + ...aymentMethodsListByBillingProfileSample.js | 41 + .../paymentMethodsListByUserSample.js | 35 + ...iesCreateOrUpdateByBillingAccountSample.js | 46 + ...esCreateOrUpdateByBillingProfileSample.js} | 34 +- ...rUpdateByCustomerAtBillingAccountSample.js | 40 + ...policiesCreateOrUpdateByCustomerSample.js} | 29 +- .../policiesGetByBillingAccountSample.js | 33 + .../policiesGetByBillingProfileSample.js | 19 +- ...ciesGetByCustomerAtBillingAccountSample.js | 38 + .../javascript/policiesGetByCustomerSample.js | 28 +- .../policiesGetBySubscriptionSample.js | 34 + .../javascript/productsGetSample.js | 19 +- .../productsListByBillingAccountSample.js | 15 +- .../productsListByBillingProfileSample.js | 19 +- .../productsListByCustomerSample.js | 19 +- .../productsListByInvoiceSectionSample.js | 21 +- .../javascript/productsMoveSample.js | 27 +- .../javascript/productsUpdateSample.js | 21 +- .../productsValidateMoveEligibilitySample.js} | 50 +- .../recipientTransfersAcceptSample.js | 39 + .../recipientTransfersDeclineSample.js | 33 + .../javascript/recipientTransfersGetSample.js | 33 + .../recipientTransfersListSample.js | 35 + .../recipientTransfersValidateSample.js | 39 + ...ervationOrdersGetByBillingAccountSample.js | 58 + ...rvationOrdersListByBillingAccountSample.js | 37 + ...reservationsGetByReservationOrderSample.js | 106 + .../reservationsListByBillingAccountSample.js | 23 +- .../reservationsListByBillingProfileSample.js | 23 +- ...eservationsListByReservationOrderSample.js | 41 + ...eservationsUpdateByBillingAccountSample.js | 42 + .../samples/{v4 => v5}/javascript/sample.env | 0 ...ingsPlanOrdersGetByBillingAccountSample.js | 58 + ...ngsPlanOrdersListByBillingAccountSample.js | 37 + .../savingsPlansGetByBillingAccountSample.js | 62 + .../savingsPlansListByBillingAccountSample.js | 45 + ...avingsPlansListBySavingsPlanOrderSample.js | 41 + ...avingsPlansUpdateByBillingAccountSample.js | 67 + ...ansValidateUpdateByBillingAccountSample.js | 51 + ...onsGetTransactionSummaryByInvoiceSample.js | 38 + .../transactionsListByBillingProfileSample.js | 54 + .../transactionsListByCustomerSample.js | 53 + .../transactionsListByInvoiceSample.js | 17 +- .../transactionsListByInvoiceSectionSample.js | 56 + ...ionsTransactionsDownloadByInvoiceSample.js | 38 + .../v5/javascript/transfersCancelSample.js | 42 + .../v5/javascript/transfersGetSample.js | 42 + .../v5/javascript/transfersInitiateSample.js | 46 + .../v5/javascript/transfersListSample.js | 43 + .../samples/v5/typescript/README.md | 437 + .../{v4 => v5}/typescript/package.json | 0 .../samples/{v4 => v5}/typescript/sample.env | 0 .../typescript/src/addressValidateSample.ts | 40 +- .../typescript/src/agreementsGetSample.ts | 19 +- .../agreementsListByBillingAccountSample.ts | 27 +- .../associatedTenantsCreateOrUpdateSample.ts | 48 + .../src/associatedTenantsDeleteSample.ts | 40 + .../src/associatedTenantsGetSample.ts | 40 + ...ciatedTenantsListByBillingAccountSample.ts | 41 + ...ilableBalancesGetByBillingAccountSample.ts | 37 + ...ilableBalancesGetByBillingProfileSample.ts | 40 + .../billingAccountsAddPaymentTermsSample.ts | 46 + ...billingAccountsCancelPaymentTermsSample.ts | 40 + .../billingAccountsConfirmTransitionSample.ts | 37 + .../src/billingAccountsGetSample.ts | 114 + ...onsByCreateSubscriptionPermissionSample.ts | 21 +- .../src/billingAccountsListSample.ts | 44 +- .../src/billingAccountsUpdateSample.ts | 76 + ...llingAccountsValidatePaymentTermsSample.ts | 72 + ...ssionsCheckAccessByBillingAccountSample.ts | 48 + ...ssionsCheckAccessByBillingProfileSample.ts | 50 + ...gPermissionsCheckAccessByCustomerSample.ts | 52 + ...ermissionsCheckAccessByDepartmentSample.ts | 50 + ...onsCheckAccessByEnrollmentAccountSample.ts | 50 + ...ssionsCheckAccessByInvoiceSectionSample.ts | 52 + ...ngPermissionsListByBillingAccountSample.ts | 21 +- ...ngPermissionsListByBillingProfileSample.ts | 23 +- ...onsListByCustomerAtBillingAccountSample.ts | 43 + .../billingPermissionsListByCustomerSample.ts | 25 +- ...illingPermissionsListByDepartmentSample.ts | 42 + ...ermissionsListByEnrollmentAccountSample.ts | 42 + ...gPermissionsListByInvoiceSectionSample.ts} | 31 +- .../billingProfilesCreateOrUpdateSample.ts | 79 + .../src/billingProfilesDeleteSample.ts | 40 + .../src/billingProfilesGetSample.ts | 40 + ...llingProfilesListByBillingAccountSample.ts | 41 + ...ProfilesValidateDeleteEligibilitySample.ts | 60 + .../src/billingPropertyGetSample.ts | 71 + .../src/billingPropertyUpdateSample.ts | 70 + .../billingRequestsCreateOrUpdateSample.ts | 48 + .../src/billingRequestsGetSample.ts | 35 + ...llingRequestsListByBillingAccountSample.ts | 41 + ...llingRequestsListByBillingProfileSample.ts | 43 + .../billingRequestsListByCustomerSample.ts | 45 + ...llingRequestsListByInvoiceSectionSample.ts | 45 + .../src/billingRequestsListByUserSample.ts | 59 + ...AssignmentsCreateByBillingAccountSample.ts | 50 + ...AssignmentsCreateByBillingProfileSample.ts | 52 + ...ngRoleAssignmentsCreateByCustomerSample.ts | 54 + ...AssignmentsCreateByInvoiceSectionSample.ts | 54 + ...ntsCreateOrUpdateByBillingAccountSample.ts | 53 + ...gnmentsCreateOrUpdateByDepartmentSample.ts | 55 + ...CreateOrUpdateByEnrollmentAccountSample.ts | 55 + ...AssignmentsDeleteByBillingAccountSample.ts | 41 + ...AssignmentsDeleteByBillingProfileSample.ts | 43 + ...ngRoleAssignmentsDeleteByCustomerSample.ts | 45 + ...RoleAssignmentsDeleteByDepartmentSample.ts | 41 + ...ignmentsDeleteByEnrollmentAccountSample.ts | 41 + ...AssignmentsDeleteByInvoiceSectionSample.ts | 45 + ...oleAssignmentsGetByBillingAccountSample.ts | 28 +- ...oleAssignmentsGetByBillingProfileSample.ts | 26 +- ...llingRoleAssignmentsGetByCustomerSample.ts | 45 + ...ingRoleAssignmentsGetByDepartmentSample.ts | 41 + ...AssignmentsGetByEnrollmentAccountSample.ts | 41 + ...oleAssignmentsGetByInvoiceSectionSample.ts | 28 +- ...leAssignmentsListByBillingAccountSample.ts | 25 +- ...leAssignmentsListByBillingProfileSample.ts | 27 +- ...lingRoleAssignmentsListByCustomerSample.ts | 45 + ...ngRoleAssignmentsListByDepartmentSample.ts | 43 + ...ssignmentsListByEnrollmentAccountSample.ts | 42 + ...leAssignmentsListByInvoiceSectionSample.ts | 25 +- ...ssignmentsResolveByBillingAccountSample.ts | 39 + ...ssignmentsResolveByBillingProfileSample.ts | 41 + ...gRoleAssignmentsResolveByCustomerSample.ts | 43 + ...ssignmentsResolveByInvoiceSectionSample.ts | 43 + ...RoleDefinitionGetByBillingAccountSample.ts | 41 + ...oleDefinitionGetByBillingProfileSample.ts} | 34 +- ...illingRoleDefinitionGetByCustomerSample.ts | 44 + ...lingRoleDefinitionGetByDepartmentSample.ts | 41 + ...eDefinitionGetByEnrollmentAccountSample.ts | 42 + ...oleDefinitionGetByInvoiceSectionSample.ts} | 38 +- ...leDefinitionListByBillingAccountSample.ts} | 27 +- ...leDefinitionListByBillingProfileSample.ts} | 29 +- ...llingRoleDefinitionListByCustomerSample.ts | 45 + ...ingRoleDefinitionListByDepartmentSample.ts | 42 + ...DefinitionListByEnrollmentAccountSample.ts | 42 + ...leDefinitionListByInvoiceSectionSample.ts} | 27 +- ...ubscriptionsAliasesCreateOrUpdateSample.ts | 52 + .../billingSubscriptionsAliasesGetSample.ts | 40 + ...ptionsAliasesListByBillingAccountSample.ts | 41 + .../src/billingSubscriptionsCancelSample.ts | 48 + .../src/billingSubscriptionsDeleteSample.ts | 40 + ...gSubscriptionsGetByBillingProfileSample.ts | 41 + .../src/billingSubscriptionsGetSample.ts | 29 +- ...SubscriptionsListByBillingAccountSample.ts | 51 + ...SubscriptionsListByBillingProfileSample.ts | 65 + ...onsListByCustomerAtBillingAccountSample.ts | 43 + ...illingSubscriptionsListByCustomerSample.ts | 23 +- ...scriptionsListByEnrollmentAccountSample.ts | 42 + ...SubscriptionsListByInvoiceSectionSample.ts | 23 +- .../src/billingSubscriptionsMergeSample.ts | 48 + .../src/billingSubscriptionsMoveSample.ts | 48 + .../src/billingSubscriptionsSplitSample.ts | 51 + .../src/billingSubscriptionsUpdateSample.ts | 47 + ...scriptionsValidateMoveEligibilitySample.ts | 73 + .../src/customersGetByBillingAccountSample.ts | 40 + .../v5/typescript/src/customersGetSample.ts | 42 + .../customersListByBillingAccountSample.ts | 68 + .../customersListByBillingProfileSample.ts | 21 +- .../v5/typescript/src/departmentsGetSample.ts | 39 + .../departmentsListByBillingAccountSample.ts | 40 + ...enrollmentAccountsGetByDepartmentSample.ts | 41 + .../src/enrollmentAccountsGetSample.ts | 39 + ...lmentAccountsListByBillingAccountSample.ts | 40 + ...nrollmentAccountsListByDepartmentSample.ts | 42 + .../invoiceSectionsCreateOrUpdateSample.ts | 31 +- .../src/invoiceSectionsDeleteSample.ts | 42 + .../src/invoiceSectionsGetSample.ts | 25 +- ...voiceSectionsListByBillingProfileSample.ts | 31 +- ...SectionsValidateDeleteEligibilitySample.ts | 64 + .../v5/typescript/src/invoicesAmendSample.ts | 40 + .../invoicesDownloadByBillingAccountSample.ts | 48 + ...icesDownloadByBillingSubscriptionSample.ts | 49 + ...DownloadDocumentsByBillingAccountSample.ts | 47 + ...oadDocumentsByBillingSubscriptionSample.ts | 47 + ...esDownloadSummaryByBillingAccountSample.ts | 40 + .../src/invoicesGetByBillingAccountSample.ts | 40 + .../invoicesGetByBillingSubscriptionSample.ts | 38 + .../v5/typescript/src/invoicesGetSample.ts} | 20 +- .../src/invoicesListByBillingAccountSample.ts | 51 + .../src/invoicesListByBillingProfileSample.ts | 53 + ...invoicesListByBillingSubscriptionSample.ts | 49 + .../typescript/src/operationsListSample.ts} | 23 +- .../src/partnerTransfersCancelSample.ts | 44 + .../src/partnerTransfersGetSample.ts | 44 + .../src/partnerTransfersInitiateSample.ts | 51 + .../src/partnerTransfersListSample.ts | 45 + .../src/paymentMethodsDeleteByUserSample.ts | 35 + ...paymentMethodsGetByBillingAccountSample.ts | 40 + ...paymentMethodsGetByBillingProfileSample.ts | 42 + .../src/paymentMethodsGetByUserSample.ts | 35 + ...aymentMethodsListByBillingAccountSample.ts | 41 + ...aymentMethodsListByBillingProfileSample.ts | 43 + .../src/paymentMethodsListByUserSample.ts | 37 + ...iesCreateOrUpdateByBillingAccountSample.ts | 52 + ...iesCreateOrUpdateByBillingProfileSample.ts | 53 + ...rUpdateByCustomerAtBillingAccountSample.ts | 43 + ...policiesCreateOrUpdateByCustomerSample.ts} | 29 +- .../src/policiesGetByBillingAccountSample.ts | 35 + .../src/policiesGetByBillingProfileSample.ts | 23 +- ...ciesGetByCustomerAtBillingAccountSample.ts | 40 + .../src/policiesGetByCustomerSample.ts | 27 +- .../src/policiesGetBySubscriptionSample.ts | 37 + .../typescript/src/productsGetSample.ts | 21 +- .../src/productsListByBillingAccountSample.ts | 19 +- .../src/productsListByBillingProfileSample.ts | 21 +- .../src/productsListByCustomerSample.ts | 23 +- .../src/productsListByInvoiceSectionSample.ts | 23 +- .../typescript/src/productsMoveSample.ts | 33 +- .../typescript/src/productsUpdateSample.ts | 27 +- .../productsValidateMoveEligibilitySample.ts} | 56 +- .../src/recipientTransfersAcceptSample.ts | 47 + .../src/recipientTransfersDeclineSample.ts | 35 + .../src/recipientTransfersGetSample.ts | 35 + .../src/recipientTransfersListSample.ts | 37 + .../src/recipientTransfersValidateSample.ts | 47 + ...ervationOrdersGetByBillingAccountSample.ts | 60 + ...rvationOrdersListByBillingAccountSample.ts | 41 + ...reservationsGetByReservationOrderSample.ts | 108 + .../reservationsListByBillingAccountSample.ts | 31 +- .../reservationsListByBillingProfileSample.ts | 29 +- ...eservationsListByReservationOrderSample.ts | 43 + ...eservationsUpdateByBillingAccountSample.ts | 44 + ...ingsPlanOrdersGetByBillingAccountSample.ts | 60 + ...gsPlanOrdersListByBillingAccountSample.ts} | 27 +- .../savingsPlansGetByBillingAccountSample.ts | 64 + .../savingsPlansListByBillingAccountSample.ts | 53 + ...avingsPlansListBySavingsPlanOrderSample.ts | 43 + ...avingsPlansUpdateByBillingAccountSample.ts | 74 + ...ansValidateUpdateByBillingAccountSample.ts | 56 + ...onsGetTransactionSummaryByInvoiceSample.ts | 40 + .../transactionsListByBillingProfileSample.ts | 59 + .../src/transactionsListByCustomerSample.ts | 58 + .../src/transactionsListByInvoiceSample.ts | 21 +- .../transactionsListByInvoiceSectionSample.ts | 61 + ...ionsTransactionsDownloadByInvoiceSample.ts | 41 + .../typescript/src/transfersCancelSample.ts | 44 + .../v5/typescript/src/transfersGetSample.ts | 44 + .../typescript/src/transfersInitiateSample.ts | 51 + .../v5/typescript/src/transfersListSample.ts | 45 + .../{v4 => v5}/typescript/tsconfig.json | 2 +- .../src/billingManagementClient.ts | 232 +- sdk/billing/arm-billing/src/lroImpl.ts | 54 +- sdk/billing/arm-billing/src/models/index.ts | 11160 +++++++++++--- sdk/billing/arm-billing/src/models/mappers.ts | 12424 ++++++++++++---- .../arm-billing/src/models/parameters.ts | 929 +- .../arm-billing/src/operations/address.ts | 22 +- .../arm-billing/src/operations/agreements.ts | 101 +- .../src/operations/associatedTenants.ts | 485 + .../src/operations/availableBalances.ts | 68 +- .../src/operations/billingAccounts.ts | 726 +- .../src/operations/billingPeriods.ts | 209 - .../src/operations/billingPermissions.ts | 1311 +- .../src/operations/billingProfiles.ts | 351 +- .../operations/billingPropertyOperations.ts | 51 +- .../src/operations/billingRequests.ts | 1029 ++ .../src/operations/billingRoleAssignments.ts | 2892 +++- .../billingRoleDefinitionOperations.ts | 1338 ++ .../src/operations/billingRoleDefinitions.ts | 682 - .../src/operations/billingSubscriptions.ts | 1796 ++- .../operations/billingSubscriptionsAliases.ts | 367 + .../arm-billing/src/operations/customers.ts | 218 +- .../arm-billing/src/operations/departments.ts | 227 + .../src/operations/enrollmentAccounts.ts | 388 +- .../arm-billing/src/operations/index.ts | 37 +- .../src/operations/instructions.ts | 299 - .../src/operations/invoiceSections.ts | 355 +- .../arm-billing/src/operations/invoices.ts | 1308 +- .../arm-billing/src/operations/operations.ts | 37 +- .../src/operations/partnerTransfers.ts | 388 + .../src/operations/paymentMethods.ts | 613 + .../arm-billing/src/operations/policies.ts | 683 +- .../arm-billing/src/operations/products.ts | 833 +- .../src/operations/recipientTransfers.ts | 291 + .../src/operations/reservationOrders.ts | 222 + .../src/operations/reservations.ts | 477 +- .../src/operations/savingsPlanOrders.ts | 222 + .../src/operations/savingsPlans.ts | 586 + .../src/operations/transactions.ts | 944 +- .../arm-billing/src/operations/transfers.ts | 388 + .../src/operationsInterfaces/address.ts | 8 +- .../src/operationsInterfaces/agreements.ts | 6 +- .../operationsInterfaces/associatedTenants.ts | 105 + .../operationsInterfaces/availableBalances.ts | 29 +- .../operationsInterfaces/billingAccounts.ts | 149 +- .../operationsInterfaces/billingPeriods.ts | 40 - .../billingPermissions.ts | 171 +- .../operationsInterfaces/billingProfiles.ts | 75 +- .../billingPropertyOperations.ts | 16 +- .../operationsInterfaces/billingRequests.ts | 118 + .../billingRoleAssignments.ts | 634 +- .../billingRoleDefinitionOperations.ts | 198 + .../billingRoleDefinitions.ts | 104 - .../billingSubscriptions.ts | 318 +- .../billingSubscriptionsAliases.ts | 78 + .../src/operationsInterfaces/customers.ts | 24 +- .../src/operationsInterfaces/departments.ts | 42 + .../enrollmentAccounts.ts | 57 +- .../src/operationsInterfaces/index.ts | 37 +- .../src/operationsInterfaces/instructions.ts | 63 - .../operationsInterfaces/invoiceSections.ts | 71 +- .../src/operationsInterfaces/invoices.ts | 294 +- .../src/operationsInterfaces/operations.ts | 4 +- .../operationsInterfaces/partnerTransfers.ts | 90 + .../operationsInterfaces/paymentMethods.ts | 102 + .../src/operationsInterfaces/policies.ts | 198 +- .../src/operationsInterfaces/products.ts | 132 +- .../recipientTransfers.ts | 75 + .../operationsInterfaces/reservationOrders.ts | 40 + .../src/operationsInterfaces/reservations.ts | 74 +- .../operationsInterfaces/savingsPlanOrders.ts | 40 + .../src/operationsInterfaces/savingsPlans.ts | 111 + .../src/operationsInterfaces/transactions.ts | 124 +- .../src/operationsInterfaces/transfers.ts | 90 + sdk/billing/arm-billing/src/pagingHelper.ts | 10 +- .../test/billing_operations_test.spec.ts | 70 + sdk/billing/arm-billing/test/sampleTest.ts | 43 - 731 files changed, 67567 insertions(+), 15992 deletions(-) create mode 100644 sdk/billing/arm-billing/samples-dev/associatedTenantsCreateOrUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/associatedTenantsDeleteSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/associatedTenantsGetSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/associatedTenantsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/availableBalancesGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/availableBalancesGetByBillingProfileSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/availableBalancesGetSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingAccountsAddPaymentTermsSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingAccountsCancelPaymentTermsSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingAccountsConfirmTransitionSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingAccountsValidatePaymentTermsSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/billingPeriodsGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/billingPeriodsListSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByEnrollmentAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByInvoiceSectionSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingPermissionsListByCustomerAtBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingPermissionsListByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingPermissionsListByEnrollmentAccountSample.ts rename sdk/billing/arm-billing/{samples/v4/typescript/src/billingPermissionsListByInvoiceSectionsSample.ts => samples-dev/billingPermissionsListByInvoiceSectionSample.ts} (53%) create mode 100644 sdk/billing/arm-billing/samples-dev/billingProfilesDeleteSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingProfilesValidateDeleteEligibilitySample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRequestsCreateOrUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRequestsGetSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRequestsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRequestsListByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRequestsListByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRequestsListByInvoiceSectionSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRequestsListByUserSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByInvoiceSectionSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByEnrollmentAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByEnrollmentAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByInvoiceSectionSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByBillingAccountSample.ts rename sdk/billing/arm-billing/{samples/v4/typescript/src/billingRoleDefinitionsGetByBillingProfileSample.ts => samples-dev/billingRoleDefinitionGetByBillingProfileSample.ts} (56%) create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByEnrollmentAccountSample.ts rename sdk/billing/arm-billing/samples-dev/{billingRoleDefinitionsGetByInvoiceSectionSample.ts => billingRoleDefinitionGetByInvoiceSectionSample.ts} (52%) rename sdk/billing/arm-billing/samples-dev/{billingRoleDefinitionsListByBillingAccountSample.ts => billingRoleDefinitionListByBillingAccountSample.ts} (53%) rename sdk/billing/arm-billing/{samples/v4/typescript/src/billingRoleDefinitionsListByBillingProfileSample.ts => samples-dev/billingRoleDefinitionListByBillingProfileSample.ts} (52%) create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByEnrollmentAccountSample.ts rename sdk/billing/arm-billing/{samples/v4/typescript/src/billingRoleDefinitionsListByInvoiceSectionSample.ts => samples-dev/billingRoleDefinitionListByInvoiceSectionSample.ts} (61%) delete mode 100644 sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesCreateOrUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesGetSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsCancelSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsDeleteSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsGetByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByCustomerAtBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByEnrollmentAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsMergeSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsSplitSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsValidateMoveEligibilitySample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/billingSubscriptionsValidateMoveSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/customersGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/departmentsGetSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/departmentsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/enrollmentAccountsGetByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/enrollmentAccountsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/enrollmentAccountsListByDepartmentSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/instructionsGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/instructionsPutSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoiceSectionsDeleteSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoiceSectionsValidateDeleteEligibilitySample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoicesAmendSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/invoicesDownloadBillingSubscriptionInvoiceSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoicesDownloadByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoicesDownloadByBillingSubscriptionSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoicesDownloadDocumentsByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoicesDownloadDocumentsByBillingSubscriptionSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/invoicesDownloadInvoiceSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/invoicesDownloadMultipleBillingProfileInvoicesSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoicesDownloadSummaryByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoicesGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/invoicesGetByBillingSubscriptionSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/invoicesGetBySubscriptionAndInvoiceIdSample.ts rename sdk/billing/arm-billing/samples-dev/{enrollmentAccountsListSample.ts => operationsListSample.ts} (57%) create mode 100644 sdk/billing/arm-billing/samples-dev/partnerTransfersCancelSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/partnerTransfersGetSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/partnerTransfersInitiateSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/partnerTransfersListSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/paymentMethodsDeleteByUserSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/paymentMethodsGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/paymentMethodsGetByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/paymentMethodsGetByUserSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/paymentMethodsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/paymentMethodsListByBillingProfileSample.ts rename sdk/billing/arm-billing/{samples/v4/typescript/src/invoicesListByBillingSubscriptionSample.ts => samples-dev/paymentMethodsListByUserSample.ts} (50%) create mode 100644 sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts rename sdk/billing/arm-billing/samples-dev/{policiesUpdateCustomerSample.ts => policiesCreateOrUpdateByCustomerSample.ts} (56%) create mode 100644 sdk/billing/arm-billing/samples-dev/policiesGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/policiesGetByCustomerAtBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/policiesGetBySubscriptionSample.ts delete mode 100644 sdk/billing/arm-billing/samples-dev/policiesUpdateSample.ts rename sdk/billing/arm-billing/{samples/v4/typescript/src/productsValidateMoveSample.ts => samples-dev/productsValidateMoveEligibilitySample.ts} (54%) create mode 100644 sdk/billing/arm-billing/samples-dev/recipientTransfersAcceptSample.ts rename sdk/billing/arm-billing/{samples/v4/typescript/src/enrollmentAccountsGetSample.ts => samples-dev/recipientTransfersDeclineSample.ts} (51%) create mode 100644 sdk/billing/arm-billing/samples-dev/recipientTransfersGetSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/recipientTransfersListSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/recipientTransfersValidateSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/reservationOrdersGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/reservationOrdersListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/reservationsGetByReservationOrderSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/reservationsListByReservationOrderSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/reservationsUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/savingsPlanOrdersGetByBillingAccountSample.ts rename sdk/billing/arm-billing/samples-dev/{instructionsListByBillingProfileSample.ts => savingsPlanOrdersListByBillingAccountSample.ts} (50%) create mode 100644 sdk/billing/arm-billing/samples-dev/savingsPlansGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/savingsPlansListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/savingsPlansListBySavingsPlanOrderSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/savingsPlansUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/savingsPlansValidateUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/transactionsGetTransactionSummaryByInvoiceSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/transactionsListByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/transactionsListByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/transactionsListByInvoiceSectionSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/transactionsTransactionsDownloadByInvoiceSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/transfersCancelSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/transfersGetSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/transfersInitiateSample.ts create mode 100644 sdk/billing/arm-billing/samples-dev/transfersListSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/README.md delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/availableBalancesGetSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingAccountsGetSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingAccountsUpdateSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsGetSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsListSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingProfilesCreateOrUpdateSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingProfilesGetSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingProfilesListByBillingAccountSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingPropertyGetSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingPropertyUpdateSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByBillingProfileSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsMoveSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsUpdateSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsValidateMoveSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/customersGetSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/customersListByBillingAccountSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/instructionsGetSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/instructionsListByBillingProfileSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/instructionsPutSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadBillingSubscriptionInvoiceSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadInvoiceSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/invoicesGetSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingAccountSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingProfileSample.js delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/README.md delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/availableBalancesGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsUpdateSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsListSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesCreateOrUpdateSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesListByBillingAccountSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyUpdateSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByBillingAccountSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingAccountSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingProfileSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsMoveSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsUpdateSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsValidateMoveSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/customersGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/customersListByBillingAccountSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/instructionsGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/instructionsPutSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadBillingSubscriptionInvoiceSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadInvoiceSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingProfileInvoicesSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetByIdSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetBySubscriptionAndInvoiceIdSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingAccountSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingProfileSample.ts delete mode 100644 sdk/billing/arm-billing/samples/v4/typescript/src/policiesUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/README.md rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/addressValidateSample.js (66%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/agreementsGetSample.js (67%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/agreementsListByBillingAccountSample.js (66%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsCreateOrUpdateSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsDeleteSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingAccountsAddPaymentTermsSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingAccountsCancelPaymentTermsSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingAccountsConfirmTransitionSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingAccountsGetSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js (69%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingAccountsListSample.js (59%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingAccountsUpdateSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingAccountsValidatePaymentTermsSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByCustomerSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByDepartmentSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByEnrollmentAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByInvoiceSectionSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingPermissionsListByBillingAccountSample.js (67%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingPermissionsListByBillingProfileSample.js (64%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByCustomerAtBillingAccountSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingPermissionsListByCustomerSample.js (61%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByDepartmentSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByEnrollmentAccountSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/billingPermissionsListByInvoiceSectionsSample.js => v5/javascript/billingPermissionsListByInvoiceSectionSample.js} (54%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingProfilesCreateOrUpdateSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingProfilesDeleteSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingProfilesGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingProfilesListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingProfilesValidateDeleteEligibilitySample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPropertyGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingPropertyUpdateSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRequestsCreateOrUpdateSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/enrollmentAccountsGetSample.js => v5/javascript/billingRequestsGetSample.js} (52%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByCustomerSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByInvoiceSectionSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByUserSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByCustomerSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByInvoiceSectionSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByCustomerSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByDepartmentSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByEnrollmentAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingRoleAssignmentsGetByBillingAccountSample.js (53%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingRoleAssignmentsGetByBillingProfileSample.js (63%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByCustomerSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByDepartmentSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByEnrollmentAccountSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingRoleAssignmentsGetByInvoiceSectionSample.js (61%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingRoleAssignmentsListByBillingAccountSample.js (63%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingRoleAssignmentsListByBillingProfileSample.js (58%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByCustomerSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByDepartmentSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByEnrollmentAccountSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingRoleAssignmentsListByInvoiceSectionSample.js (66%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByCustomerSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByInvoiceSectionSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/billingRoleDefinitionsGetByBillingAccountSample.js => v5/javascript/billingRoleDefinitionGetByBillingAccountSample.js} (51%) rename sdk/billing/arm-billing/samples/{v4/javascript/billingRoleDefinitionsGetByBillingProfileSample.js => v5/javascript/billingRoleDefinitionGetByBillingProfileSample.js} (60%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByCustomerSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByDepartmentSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByEnrollmentAccountSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/billingRoleDefinitionsGetByInvoiceSectionSample.js => v5/javascript/billingRoleDefinitionGetByInvoiceSectionSample.js} (58%) rename sdk/billing/arm-billing/samples/{v4/javascript/billingRoleDefinitionsListByBillingAccountSample.js => v5/javascript/billingRoleDefinitionListByBillingAccountSample.js} (54%) rename sdk/billing/arm-billing/samples/{v4/javascript/billingRoleDefinitionsListByBillingProfileSample.js => v5/javascript/billingRoleDefinitionListByBillingProfileSample.js} (53%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByCustomerSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByDepartmentSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByEnrollmentAccountSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/billingRoleDefinitionsListByInvoiceSectionSample.js => v5/javascript/billingRoleDefinitionListByInvoiceSectionSample.js} (62%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesCreateOrUpdateSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsCancelSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsDeleteSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsGetByBillingProfileSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingSubscriptionsGetSample.js (57%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingSubscriptionsListByBillingAccountSample.js (55%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByCustomerAtBillingAccountSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingSubscriptionsListByCustomerSample.js (68%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByEnrollmentAccountSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/billingSubscriptionsListByInvoiceSectionSample.js (70%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMergeSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMoveSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsSplitSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsUpdateSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsValidateMoveEligibilitySample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/customersGetByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/customersGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/customersListByBillingAccountSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/customersListByBillingProfileSample.js (73%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/departmentsGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/departmentsListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetByDepartmentSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByDepartmentSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/invoiceSectionsCreateOrUpdateSample.js (62%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsDeleteSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/invoiceSectionsGetSample.js (66%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/invoiceSectionsListByBillingProfileSample.js (69%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsValidateDeleteEligibilitySample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoicesAmendSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingSubscriptionSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadDocumentsByBillingAccountSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/invoicesDownloadMultipleBillingProfileInvoicesSample.js => v5/javascript/invoicesDownloadDocumentsByBillingSubscriptionSample.js} (52%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadSummaryByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingSubscriptionSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/invoicesGetByIdSample.js => v5/javascript/invoicesGetSample.js} (72%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingProfileSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/invoicesListByBillingSubscriptionSample.js (50%) rename sdk/billing/arm-billing/samples/{v4/javascript/enrollmentAccountsListSample.js => v5/javascript/operationsListSample.js} (59%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/package.json (100%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersCancelSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersInitiateSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersListSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/invoicesGetBySubscriptionAndInvoiceIdSample.js => v5/javascript/paymentMethodsDeleteByUserSample.js} (50%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByUserSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByUserSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByBillingAccountSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/policiesUpdateSample.js => v5/javascript/policiesCreateOrUpdateByBillingProfileSample.js} (54%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByCustomerAtBillingAccountSample.js rename sdk/billing/arm-billing/samples/{v4/javascript/policiesUpdateCustomerSample.js => v5/javascript/policiesCreateOrUpdateByCustomerSample.js} (55%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/policiesGetByBillingAccountSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/policiesGetByBillingProfileSample.js (68%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/policiesGetByCustomerAtBillingAccountSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/policiesGetByCustomerSample.js (57%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/policiesGetBySubscriptionSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/productsGetSample.js (69%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/productsListByBillingAccountSample.js (78%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/productsListByBillingProfileSample.js (74%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/productsListByCustomerSample.js (72%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/productsListByInvoiceSectionSample.js (71%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/productsMoveSample.js (63%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/productsUpdateSample.js (68%) rename sdk/billing/arm-billing/samples/{v4/javascript/productsValidateMoveSample.js => v5/javascript/productsValidateMoveEligibilitySample.js} (55%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersAcceptSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersDeclineSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersListSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersValidateSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersGetByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/reservationsGetByReservationOrderSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/reservationsListByBillingAccountSample.js (54%) rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/reservationsListByBillingProfileSample.js (68%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/reservationsListByReservationOrderSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/reservationsUpdateByBillingAccountSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/sample.env (100%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersGetByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/savingsPlansGetByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListBySavingsPlanOrderSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/savingsPlansUpdateByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/savingsPlansValidateUpdateByBillingAccountSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/transactionsGetTransactionSummaryByInvoiceSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/transactionsListByBillingProfileSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/transactionsListByCustomerSample.js rename sdk/billing/arm-billing/samples/{v4 => v5}/javascript/transactionsListByInvoiceSample.js (72%) create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/transactionsListByInvoiceSectionSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/transactionsTransactionsDownloadByInvoiceSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/transfersCancelSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/transfersGetSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/transfersInitiateSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/javascript/transfersListSample.js create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/README.md rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/package.json (100%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/sample.env (100%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/addressValidateSample.ts (64%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/agreementsGetSample.ts (66%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/agreementsListByBillingAccountSample.ts (56%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsCreateOrUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsDeleteSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsAddPaymentTermsSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsCancelPaymentTermsSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsConfirmTransitionSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsGetSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts (68%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingAccountsListSample.ts (58%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsValidatePaymentTermsSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByEnrollmentAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByInvoiceSectionSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingPermissionsListByBillingAccountSample.ts (64%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingPermissionsListByBillingProfileSample.ts (62%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByCustomerAtBillingAccountSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingPermissionsListByCustomerSample.ts (59%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByEnrollmentAccountSample.ts rename sdk/billing/arm-billing/{samples-dev/billingPermissionsListByInvoiceSectionsSample.ts => samples/v5/typescript/src/billingPermissionsListByInvoiceSectionSample.ts} (53%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesCreateOrUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesDeleteSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesValidateDeleteEligibilitySample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsCreateOrUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByInvoiceSectionSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByUserSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByInvoiceSectionSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingRoleAssignmentsGetByBillingAccountSample.ts (52%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingRoleAssignmentsGetByBillingProfileSample.ts (62%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByEnrollmentAccountSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingRoleAssignmentsGetByInvoiceSectionSample.ts (60%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingRoleAssignmentsListByBillingAccountSample.ts (61%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingRoleAssignmentsListByBillingProfileSample.ts (57%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByEnrollmentAccountSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingRoleAssignmentsListByInvoiceSectionSample.ts (65%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByInvoiceSectionSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByBillingAccountSample.ts rename sdk/billing/arm-billing/{samples-dev/billingRoleDefinitionsGetByBillingProfileSample.ts => samples/v5/typescript/src/billingRoleDefinitionGetByBillingProfileSample.ts} (56%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByEnrollmentAccountSample.ts rename sdk/billing/arm-billing/samples/{v4/typescript/src/billingRoleDefinitionsGetByInvoiceSectionSample.ts => v5/typescript/src/billingRoleDefinitionGetByInvoiceSectionSample.ts} (52%) rename sdk/billing/arm-billing/samples/{v4/typescript/src/billingRoleDefinitionsListByBillingAccountSample.ts => v5/typescript/src/billingRoleDefinitionListByBillingAccountSample.ts} (53%) rename sdk/billing/arm-billing/{samples-dev/billingRoleDefinitionsListByBillingProfileSample.ts => samples/v5/typescript/src/billingRoleDefinitionListByBillingProfileSample.ts} (52%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByCustomerSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByEnrollmentAccountSample.ts rename sdk/billing/arm-billing/{samples-dev/billingRoleDefinitionsListByInvoiceSectionSample.ts => samples/v5/typescript/src/billingRoleDefinitionListByInvoiceSectionSample.ts} (61%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesCreateOrUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsCancelSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsDeleteSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsGetByBillingProfileSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingSubscriptionsGetSample.ts (51%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByCustomerAtBillingAccountSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingSubscriptionsListByCustomerSample.ts (67%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByEnrollmentAccountSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/billingSubscriptionsListByInvoiceSectionSample.ts (69%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMergeSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMoveSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsSplitSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsUpdateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsValidateMoveEligibilitySample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/customersGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/customersGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/customersListByBillingAccountSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/customersListByBillingProfileSample.ts (71%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/departmentsGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/departmentsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetByDepartmentSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByDepartmentSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/invoiceSectionsCreateOrUpdateSample.ts (61%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsDeleteSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/invoiceSectionsGetSample.ts (65%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/invoiceSectionsListByBillingProfileSample.ts (60%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsValidateDeleteEligibilitySample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesAmendSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingSubscriptionSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingSubscriptionSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadSummaryByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingSubscriptionSample.ts rename sdk/billing/arm-billing/{samples-dev/invoicesGetByIdSample.ts => samples/v5/typescript/src/invoicesGetSample.ts} (71%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingSubscriptionSample.ts rename sdk/billing/arm-billing/samples/{v4/typescript/src/enrollmentAccountsListSample.ts => v5/typescript/src/operationsListSample.ts} (57%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersCancelSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersInitiateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersListSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsDeleteByUserSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByUserSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByUserSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts rename sdk/billing/arm-billing/samples/{v4/typescript/src/policiesUpdateCustomerSample.ts => v5/typescript/src/policiesCreateOrUpdateByCustomerSample.ts} (56%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByBillingAccountSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/policiesGetByBillingProfileSample.ts (66%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByCustomerAtBillingAccountSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/policiesGetByCustomerSample.ts (61%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetBySubscriptionSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/productsGetSample.ts (67%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/productsListByBillingAccountSample.ts (75%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/productsListByBillingProfileSample.ts (73%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/productsListByCustomerSample.ts (70%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/productsListByInvoiceSectionSample.ts (70%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/productsMoveSample.ts (60%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/productsUpdateSample.ts (61%) rename sdk/billing/arm-billing/{samples-dev/productsValidateMoveSample.ts => samples/v5/typescript/src/productsValidateMoveEligibilitySample.ts} (54%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersAcceptSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersDeclineSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersListSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersValidateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/reservationsGetByReservationOrderSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/reservationsListByBillingAccountSample.ts (54%) rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/reservationsListByBillingProfileSample.ts (68%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByReservationOrderSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/reservationsUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlanOrdersGetByBillingAccountSample.ts rename sdk/billing/arm-billing/samples/{v4/typescript/src/instructionsListByBillingProfileSample.ts => v5/typescript/src/savingsPlanOrdersListByBillingAccountSample.ts} (50%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansGetByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListBySavingsPlanOrderSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansValidateUpdateByBillingAccountSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/transactionsGetTransactionSummaryByInvoiceSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByBillingProfileSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByCustomerSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/src/transactionsListByInvoiceSample.ts (70%) create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByInvoiceSectionSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/transactionsTransactionsDownloadByInvoiceSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/transfersCancelSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/transfersGetSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/transfersInitiateSample.ts create mode 100644 sdk/billing/arm-billing/samples/v5/typescript/src/transfersListSample.ts rename sdk/billing/arm-billing/samples/{v4 => v5}/typescript/tsconfig.json (92%) create mode 100644 sdk/billing/arm-billing/src/operations/associatedTenants.ts delete mode 100644 sdk/billing/arm-billing/src/operations/billingPeriods.ts create mode 100644 sdk/billing/arm-billing/src/operations/billingRequests.ts create mode 100644 sdk/billing/arm-billing/src/operations/billingRoleDefinitionOperations.ts delete mode 100644 sdk/billing/arm-billing/src/operations/billingRoleDefinitions.ts create mode 100644 sdk/billing/arm-billing/src/operations/billingSubscriptionsAliases.ts create mode 100644 sdk/billing/arm-billing/src/operations/departments.ts delete mode 100644 sdk/billing/arm-billing/src/operations/instructions.ts create mode 100644 sdk/billing/arm-billing/src/operations/partnerTransfers.ts create mode 100644 sdk/billing/arm-billing/src/operations/paymentMethods.ts create mode 100644 sdk/billing/arm-billing/src/operations/recipientTransfers.ts create mode 100644 sdk/billing/arm-billing/src/operations/reservationOrders.ts create mode 100644 sdk/billing/arm-billing/src/operations/savingsPlanOrders.ts create mode 100644 sdk/billing/arm-billing/src/operations/savingsPlans.ts create mode 100644 sdk/billing/arm-billing/src/operations/transfers.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/associatedTenants.ts delete mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/billingPeriods.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/billingRequests.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/billingRoleDefinitionOperations.ts delete mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/billingRoleDefinitions.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/billingSubscriptionsAliases.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/departments.ts delete mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/instructions.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/partnerTransfers.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/paymentMethods.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/recipientTransfers.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/reservationOrders.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/savingsPlanOrders.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/savingsPlans.ts create mode 100644 sdk/billing/arm-billing/src/operationsInterfaces/transfers.ts create mode 100644 sdk/billing/arm-billing/test/billing_operations_test.spec.ts delete mode 100644 sdk/billing/arm-billing/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7ca533faa138..c2b13ef56821 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -11730,7 +11730,7 @@ packages: dev: false file:projects/ai-translation-document.tgz: - resolution: {integrity: sha512-e6cs/GSLJTOH4U1Hy1w/Zdy849U5IgcA6eAdu/e8S5FA/CxgBuO3PNZtJG5c9YrLreqQlNRMB4FelcCPRSE3dg==, tarball: file:projects/ai-translation-document.tgz} + resolution: {integrity: sha512-Rm/i4rUb5Xopy5LlWxpAL/IEd4VB0ZvJ2Ax2jgKPWycEypmCmGIyzf/LcQ87M9BTU0V8sPOHB7qw8w/p9bYTnQ==, tarball: file:projects/ai-translation-document.tgz} name: '@rush-temp/ai-translation-document' version: 0.0.0 dependencies: @@ -12793,7 +12793,7 @@ packages: dev: false file:projects/arm-billing.tgz: - resolution: {integrity: sha512-FARPUh7FdBujg4dHXxguxHOlHOiRabQvrjuPUVXw5eabf7QhTy2FhjqOgYrnQRsIDpZh2a4pSiEfPiEbw0SQzA==, tarball: file:projects/arm-billing.tgz} + resolution: {integrity: sha512-FXyG1I9p+Y3rCU9yl503SMPYgEWGc+oPBAPeLF5d5kK4FBin4fJqk0D7LK4ZIYusE4OTricpA3cmmO/fNWdbQQ==, tarball: file:projects/arm-billing.tgz} name: '@rush-temp/arm-billing' version: 0.0.0 dependencies: @@ -12808,11 +12808,13 @@ packages: '@types/node': 18.19.48 chai: 4.3.10 cross-env: 7.0.3 + dotenv: 16.4.5 mkdirp: 3.0.1 mocha: 10.7.3 rimraf: 5.0.10 ts-node: 10.9.2(@types/node@18.19.48)(typescript@5.5.4) tslib: 2.7.0 + tsx: 4.19.0 typescript: 5.5.4 uglify-js: 3.19.3 transitivePeerDependencies: diff --git a/sdk/billing/arm-billing/CHANGELOG.md b/sdk/billing/arm-billing/CHANGELOG.md index 85e658417871..bbc00e3c70b4 100644 --- a/sdk/billing/arm-billing/CHANGELOG.md +++ b/sdk/billing/arm-billing/CHANGELOG.md @@ -1,18 +1,1388 @@ # Release History - -## 4.1.1 (Unreleased) - + +## 5.0.0 (2024-09-04) + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Added operation group AssociatedTenants + - Added operation group BillingRequests + - Added operation group BillingRoleDefinitionOperations + - Added operation group BillingSubscriptionsAliases + - Added operation group Departments + - Added operation group PartnerTransfers + - Added operation group PaymentMethods + - Added operation group RecipientTransfers + - Added operation group ReservationOrders + - Added operation group SavingsPlanOrders + - Added operation group SavingsPlans + - Added operation group Transfers + - Added operation AvailableBalances.getByBillingAccount + - Added operation AvailableBalances.getByBillingProfile + - Added operation BillingAccounts.beginAddPaymentTerms + - Added operation BillingAccounts.beginAddPaymentTermsAndWait + - Added operation BillingAccounts.beginCancelPaymentTerms + - Added operation BillingAccounts.beginCancelPaymentTermsAndWait + - Added operation BillingAccounts.confirmTransition + - Added operation BillingAccounts.validatePaymentTerms + - Added operation BillingPermissions.checkAccessByBillingAccount + - Added operation BillingPermissions.checkAccessByBillingProfile + - Added operation BillingPermissions.checkAccessByCustomer + - Added operation BillingPermissions.checkAccessByDepartment + - Added operation BillingPermissions.checkAccessByEnrollmentAccount + - Added operation BillingPermissions.checkAccessByInvoiceSection + - Added operation BillingPermissions.listByCustomerAtBillingAccount + - Added operation BillingPermissions.listByDepartment + - Added operation BillingPermissions.listByEnrollmentAccount + - Added operation BillingPermissions.listByInvoiceSection + - Added operation BillingProfiles.beginDelete + - Added operation BillingProfiles.beginDeleteAndWait + - Added operation BillingProfiles.validateDeleteEligibility + - Added operation BillingRoleAssignments.beginCreateByBillingAccount + - Added operation BillingRoleAssignments.beginCreateByBillingAccountAndWait + - Added operation BillingRoleAssignments.beginCreateByBillingProfile + - Added operation BillingRoleAssignments.beginCreateByBillingProfileAndWait + - Added operation BillingRoleAssignments.beginCreateByCustomer + - Added operation BillingRoleAssignments.beginCreateByCustomerAndWait + - Added operation BillingRoleAssignments.beginCreateByInvoiceSection + - Added operation BillingRoleAssignments.beginCreateByInvoiceSectionAndWait + - Added operation BillingRoleAssignments.beginCreateOrUpdateByBillingAccount + - Added operation BillingRoleAssignments.beginCreateOrUpdateByBillingAccountAndWait + - Added operation BillingRoleAssignments.beginCreateOrUpdateByDepartment + - Added operation BillingRoleAssignments.beginCreateOrUpdateByDepartmentAndWait + - Added operation BillingRoleAssignments.beginCreateOrUpdateByEnrollmentAccount + - Added operation BillingRoleAssignments.beginCreateOrUpdateByEnrollmentAccountAndWait + - Added operation BillingRoleAssignments.beginResolveByBillingAccount + - Added operation BillingRoleAssignments.beginResolveByBillingAccountAndWait + - Added operation BillingRoleAssignments.beginResolveByBillingProfile + - Added operation BillingRoleAssignments.beginResolveByBillingProfileAndWait + - Added operation BillingRoleAssignments.beginResolveByCustomer + - Added operation BillingRoleAssignments.beginResolveByCustomerAndWait + - Added operation BillingRoleAssignments.beginResolveByInvoiceSection + - Added operation BillingRoleAssignments.beginResolveByInvoiceSectionAndWait + - Added operation BillingRoleAssignments.deleteByCustomer + - Added operation BillingRoleAssignments.deleteByDepartment + - Added operation BillingRoleAssignments.deleteByEnrollmentAccount + - Added operation BillingRoleAssignments.getByCustomer + - Added operation BillingRoleAssignments.getByDepartment + - Added operation BillingRoleAssignments.getByEnrollmentAccount + - Added operation BillingRoleAssignments.listByCustomer + - Added operation BillingRoleAssignments.listByDepartment + - Added operation BillingRoleAssignments.listByEnrollmentAccount + - Added operation BillingSubscriptions.beginCancel + - Added operation BillingSubscriptions.beginCancelAndWait + - Added operation BillingSubscriptions.beginDelete + - Added operation BillingSubscriptions.beginDeleteAndWait + - Added operation BillingSubscriptions.beginMerge + - Added operation BillingSubscriptions.beginMergeAndWait + - Added operation BillingSubscriptions.beginSplit + - Added operation BillingSubscriptions.beginSplitAndWait + - Added operation BillingSubscriptions.beginUpdate + - Added operation BillingSubscriptions.beginUpdateAndWait + - Added operation BillingSubscriptions.getByBillingProfile + - Added operation BillingSubscriptions.listByCustomerAtBillingAccount + - Added operation BillingSubscriptions.listByEnrollmentAccount + - Added operation BillingSubscriptions.validateMoveEligibility + - Added operation Customers.getByBillingAccount + - Added operation EnrollmentAccounts.getByDepartment + - Added operation EnrollmentAccounts.listByBillingAccount + - Added operation EnrollmentAccounts.listByDepartment + - Added operation Invoices.beginAmend + - Added operation Invoices.beginAmendAndWait + - Added operation Invoices.beginDownloadByBillingAccount + - Added operation Invoices.beginDownloadByBillingAccountAndWait + - Added operation Invoices.beginDownloadByBillingSubscription + - Added operation Invoices.beginDownloadByBillingSubscriptionAndWait + - Added operation Invoices.beginDownloadDocumentsByBillingAccount + - Added operation Invoices.beginDownloadDocumentsByBillingAccountAndWait + - Added operation Invoices.beginDownloadDocumentsByBillingSubscription + - Added operation Invoices.beginDownloadDocumentsByBillingSubscriptionAndWait + - Added operation Invoices.beginDownloadSummaryByBillingAccount + - Added operation Invoices.beginDownloadSummaryByBillingAccountAndWait + - Added operation Invoices.getByBillingAccount + - Added operation Invoices.getByBillingSubscription + - Added operation InvoiceSections.beginDelete + - Added operation InvoiceSections.beginDeleteAndWait + - Added operation InvoiceSections.validateDeleteEligibility + - Added operation Policies.beginCreateOrUpdateByBillingAccount + - Added operation Policies.beginCreateOrUpdateByBillingAccountAndWait + - Added operation Policies.beginCreateOrUpdateByBillingProfile + - Added operation Policies.beginCreateOrUpdateByBillingProfileAndWait + - Added operation Policies.beginCreateOrUpdateByCustomer + - Added operation Policies.beginCreateOrUpdateByCustomerAndWait + - Added operation Policies.beginCreateOrUpdateByCustomerAtBillingAccount + - Added operation Policies.beginCreateOrUpdateByCustomerAtBillingAccountAndWait + - Added operation Policies.getByBillingAccount + - Added operation Policies.getByCustomerAtBillingAccount + - Added operation Policies.getBySubscription + - Added operation Products.beginMove + - Added operation Products.beginMoveAndWait + - Added operation Products.validateMoveEligibility + - Added operation Reservations.beginUpdateByBillingAccount + - Added operation Reservations.beginUpdateByBillingAccountAndWait + - Added operation Reservations.getByReservationOrder + - Added operation Reservations.listByReservationOrder + - Added operation Transactions.beginTransactionsDownloadByInvoice + - Added operation Transactions.beginTransactionsDownloadByInvoiceAndWait + - Added operation Transactions.getTransactionSummaryByInvoice + - Added operation Transactions.listByBillingProfile + - Added operation Transactions.listByCustomer + - Added operation Transactions.listByInvoiceSection + - Added Interface AcceptTransferRequest + - Added Interface AddressValidationResponse + - Added Interface AgreementProperties + - Added Interface AppliedScopeProperties + - Added Interface AssociatedTenant + - Added Interface AssociatedTenantListResult + - Added Interface AssociatedTenantProperties + - Added Interface AssociatedTenantsCreateOrUpdateHeaders + - Added Interface AssociatedTenantsCreateOrUpdateOptionalParams + - Added Interface AssociatedTenantsDeleteHeaders + - Added Interface AssociatedTenantsDeleteOptionalParams + - Added Interface AssociatedTenantsGetOptionalParams + - Added Interface AssociatedTenantsListByBillingAccountNextOptionalParams + - Added Interface AssociatedTenantsListByBillingAccountOptionalParams + - Added Interface AvailableBalanceProperties + - Added Interface AvailableBalancePropertiesAmount + - Added Interface AvailableBalancePropertiesTotalPaymentsOnAccount + - Added Interface AvailableBalancesGetByBillingAccountOptionalParams + - Added Interface AvailableBalancesGetByBillingProfileOptionalParams + - Added Interface Beneficiary + - Added Interface BillingAccountPatch + - Added Interface BillingAccountPolicy + - Added Interface BillingAccountPolicyProperties + - Added Interface BillingAccountPolicyPropertiesEnterpriseAgreementPolicies + - Added Interface BillingAccountProperties + - Added Interface BillingAccountPropertiesEnrollmentDetails + - Added Interface BillingAccountPropertiesRegistrationNumber + - Added Interface BillingAccountPropertiesSoldTo + - Added Interface BillingAccountsAddPaymentTermsHeaders + - Added Interface BillingAccountsAddPaymentTermsOptionalParams + - Added Interface BillingAccountsCancelPaymentTermsHeaders + - Added Interface BillingAccountsCancelPaymentTermsOptionalParams + - Added Interface BillingAccountsConfirmTransitionOptionalParams + - Added Interface BillingAccountsUpdateHeaders + - Added Interface BillingAccountsValidatePaymentTermsOptionalParams + - Added Interface BillingPermission + - Added Interface BillingPermissionListResult + - Added Interface BillingPermissionsCheckAccessByBillingAccountOptionalParams + - Added Interface BillingPermissionsCheckAccessByBillingProfileOptionalParams + - Added Interface BillingPermissionsCheckAccessByCustomerOptionalParams + - Added Interface BillingPermissionsCheckAccessByDepartmentOptionalParams + - Added Interface BillingPermissionsCheckAccessByEnrollmentAccountOptionalParams + - Added Interface BillingPermissionsCheckAccessByInvoiceSectionOptionalParams + - Added Interface BillingPermissionsListByCustomerAtBillingAccountNextOptionalParams + - Added Interface BillingPermissionsListByCustomerAtBillingAccountOptionalParams + - Added Interface BillingPermissionsListByDepartmentNextOptionalParams + - Added Interface BillingPermissionsListByDepartmentOptionalParams + - Added Interface BillingPermissionsListByEnrollmentAccountNextOptionalParams + - Added Interface BillingPermissionsListByEnrollmentAccountOptionalParams + - Added Interface BillingPermissionsListByInvoiceSectionNextOptionalParams + - Added Interface BillingPermissionsListByInvoiceSectionOptionalParams + - Added Interface BillingPlanInformation + - Added Interface BillingProfileInfo + - Added Interface BillingProfilePolicy + - Added Interface BillingProfilePolicyProperties + - Added Interface BillingProfilePolicyPropertiesEnterpriseAgreementPolicies + - Added Interface BillingProfileProperties + - Added Interface BillingProfilePropertiesBillTo + - Added Interface BillingProfilePropertiesCurrentPaymentTerm + - Added Interface BillingProfilePropertiesIndirectRelationshipInfo + - Added Interface BillingProfilePropertiesShipTo + - Added Interface BillingProfilePropertiesSoldTo + - Added Interface BillingProfilesDeleteHeaders + - Added Interface BillingProfilesDeleteOptionalParams + - Added Interface BillingProfilesValidateDeleteEligibilityOptionalParams + - Added Interface BillingPropertyProperties + - Added Interface BillingPropertyPropertiesEnrollmentDetails + - Added Interface BillingPropertyPropertiesSubscriptionServiceUsageAddress + - Added Interface BillingRequest + - Added Interface BillingRequestListResult + - Added Interface BillingRequestProperties + - Added Interface BillingRequestPropertiesCreatedBy + - Added Interface BillingRequestPropertiesLastUpdatedBy + - Added Interface BillingRequestPropertiesReviewedBy + - Added Interface BillingRequestsCreateOrUpdateHeaders + - Added Interface BillingRequestsCreateOrUpdateOptionalParams + - Added Interface BillingRequestsGetOptionalParams + - Added Interface BillingRequestsListByBillingAccountNextOptionalParams + - Added Interface BillingRequestsListByBillingAccountOptionalParams + - Added Interface BillingRequestsListByBillingProfileNextOptionalParams + - Added Interface BillingRequestsListByBillingProfileOptionalParams + - Added Interface BillingRequestsListByCustomerNextOptionalParams + - Added Interface BillingRequestsListByCustomerOptionalParams + - Added Interface BillingRequestsListByInvoiceSectionNextOptionalParams + - Added Interface BillingRequestsListByInvoiceSectionOptionalParams + - Added Interface BillingRequestsListByUserNextOptionalParams + - Added Interface BillingRequestsListByUserOptionalParams + - Added Interface BillingRoleAssignmentProperties + - Added Interface BillingRoleAssignmentsCreateByBillingAccountHeaders + - Added Interface BillingRoleAssignmentsCreateByBillingAccountOptionalParams + - Added Interface BillingRoleAssignmentsCreateByBillingProfileHeaders + - Added Interface BillingRoleAssignmentsCreateByBillingProfileOptionalParams + - Added Interface BillingRoleAssignmentsCreateByCustomerHeaders + - Added Interface BillingRoleAssignmentsCreateByCustomerOptionalParams + - Added Interface BillingRoleAssignmentsCreateByInvoiceSectionHeaders + - Added Interface BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams + - Added Interface BillingRoleAssignmentsCreateOrUpdateByBillingAccountHeaders + - Added Interface BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams + - Added Interface BillingRoleAssignmentsCreateOrUpdateByDepartmentHeaders + - Added Interface BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams + - Added Interface BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountHeaders + - Added Interface BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams + - Added Interface BillingRoleAssignmentsDeleteByCustomerOptionalParams + - Added Interface BillingRoleAssignmentsDeleteByDepartmentOptionalParams + - Added Interface BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams + - Added Interface BillingRoleAssignmentsGetByCustomerOptionalParams + - Added Interface BillingRoleAssignmentsGetByDepartmentOptionalParams + - Added Interface BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams + - Added Interface BillingRoleAssignmentsListByCustomerNextOptionalParams + - Added Interface BillingRoleAssignmentsListByCustomerOptionalParams + - Added Interface BillingRoleAssignmentsListByDepartmentNextOptionalParams + - Added Interface BillingRoleAssignmentsListByDepartmentOptionalParams + - Added Interface BillingRoleAssignmentsListByEnrollmentAccountNextOptionalParams + - Added Interface BillingRoleAssignmentsListByEnrollmentAccountOptionalParams + - Added Interface BillingRoleAssignmentsResolveByBillingAccountHeaders + - Added Interface BillingRoleAssignmentsResolveByBillingAccountOptionalParams + - Added Interface BillingRoleAssignmentsResolveByBillingProfileHeaders + - Added Interface BillingRoleAssignmentsResolveByBillingProfileOptionalParams + - Added Interface BillingRoleAssignmentsResolveByCustomerHeaders + - Added Interface BillingRoleAssignmentsResolveByCustomerOptionalParams + - Added Interface BillingRoleAssignmentsResolveByInvoiceSectionHeaders + - Added Interface BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams + - Added Interface BillingRoleDefinitionGetByBillingAccountOptionalParams + - Added Interface BillingRoleDefinitionGetByBillingProfileOptionalParams + - Added Interface BillingRoleDefinitionGetByCustomerOptionalParams + - Added Interface BillingRoleDefinitionGetByDepartmentOptionalParams + - Added Interface BillingRoleDefinitionGetByEnrollmentAccountOptionalParams + - Added Interface BillingRoleDefinitionGetByInvoiceSectionOptionalParams + - Added Interface BillingRoleDefinitionListByBillingAccountNextOptionalParams + - Added Interface BillingRoleDefinitionListByBillingAccountOptionalParams + - Added Interface BillingRoleDefinitionListByBillingProfileNextOptionalParams + - Added Interface BillingRoleDefinitionListByBillingProfileOptionalParams + - Added Interface BillingRoleDefinitionListByCustomerNextOptionalParams + - Added Interface BillingRoleDefinitionListByCustomerOptionalParams + - Added Interface BillingRoleDefinitionListByDepartmentNextOptionalParams + - Added Interface BillingRoleDefinitionListByDepartmentOptionalParams + - Added Interface BillingRoleDefinitionListByEnrollmentAccountNextOptionalParams + - Added Interface BillingRoleDefinitionListByEnrollmentAccountOptionalParams + - Added Interface BillingRoleDefinitionListByInvoiceSectionNextOptionalParams + - Added Interface BillingRoleDefinitionListByInvoiceSectionOptionalParams + - Added Interface BillingRoleDefinitionProperties + - Added Interface BillingSubscriptionAlias + - Added Interface BillingSubscriptionAliasListResult + - Added Interface BillingSubscriptionAliasProperties + - Added Interface BillingSubscriptionListResult + - Added Interface BillingSubscriptionMergeRequest + - Added Interface BillingSubscriptionPatch + - Added Interface BillingSubscriptionProperties + - Added Interface BillingSubscriptionsAliasesCreateOrUpdateHeaders + - Added Interface BillingSubscriptionsAliasesCreateOrUpdateOptionalParams + - Added Interface BillingSubscriptionsAliasesGetOptionalParams + - Added Interface BillingSubscriptionsAliasesListByBillingAccountNextOptionalParams + - Added Interface BillingSubscriptionsAliasesListByBillingAccountOptionalParams + - Added Interface BillingSubscriptionsCancelHeaders + - Added Interface BillingSubscriptionsCancelOptionalParams + - Added Interface BillingSubscriptionsDeleteHeaders + - Added Interface BillingSubscriptionsDeleteOptionalParams + - Added Interface BillingSubscriptionsGetByBillingProfileOptionalParams + - Added Interface BillingSubscriptionsListByCustomerAtBillingAccountNextOptionalParams + - Added Interface BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams + - Added Interface BillingSubscriptionsListByEnrollmentAccountNextOptionalParams + - Added Interface BillingSubscriptionsListByEnrollmentAccountOptionalParams + - Added Interface BillingSubscriptionsMergeHeaders + - Added Interface BillingSubscriptionsMergeOptionalParams + - Added Interface BillingSubscriptionSplitRequest + - Added Interface BillingSubscriptionsSplitHeaders + - Added Interface BillingSubscriptionsSplitOptionalParams + - Added Interface BillingSubscriptionStatusDetails + - Added Interface BillingSubscriptionsUpdateHeaders + - Added Interface BillingSubscriptionsValidateMoveEligibilityOptionalParams + - Added Interface CancelSubscriptionRequest + - Added Interface CheckAccessRequest + - Added Interface CheckAccessResponse + - Added Interface Commitment + - Added Interface CustomerPolicyProperties + - Added Interface CustomerProperties + - Added Interface CustomersGetByBillingAccountOptionalParams + - Added Interface DeleteBillingProfileEligibilityDetail + - Added Interface DeleteBillingProfileEligibilityResult + - Added Interface DeleteInvoiceSectionEligibilityDetail + - Added Interface DeleteInvoiceSectionEligibilityResult + - Added Interface DepartmentListResult + - Added Interface DepartmentProperties + - Added Interface DepartmentsGetOptionalParams + - Added Interface DepartmentsListByBillingAccountNextOptionalParams + - Added Interface DepartmentsListByBillingAccountOptionalParams + - Added Interface DetailedTransferStatus + - Added Interface DocumentDownloadRequest + - Added Interface DocumentDownloadResult + - Added Interface EnrollmentAccountProperties + - Added Interface EnrollmentAccountsGetByDepartmentOptionalParams + - Added Interface EnrollmentAccountsListByBillingAccountNextOptionalParams + - Added Interface EnrollmentAccountsListByBillingAccountOptionalParams + - Added Interface EnrollmentAccountsListByDepartmentNextOptionalParams + - Added Interface EnrollmentAccountsListByDepartmentOptionalParams + - Added Interface EnrollmentDetails + - Added Interface EnrollmentDetailsIndirectRelationshipInfo + - Added Interface EnterpriseAgreementPolicies + - Added Interface ErrorAdditionalInfo + - Added Interface ErrorDetail + - Added Interface ExtendedStatusDefinitionProperties + - Added Interface ExtendedStatusInfo + - Added Interface ExternalReference + - Added Interface FailedPayment + - Added Interface InitiateTransferRequest + - Added Interface InvoiceDocument + - Added Interface InvoiceProperties + - Added Interface InvoicePropertiesAmountDue + - Added Interface InvoicePropertiesAzurePrepaymentApplied + - Added Interface InvoicePropertiesBilledAmount + - Added Interface InvoicePropertiesCreditAmount + - Added Interface InvoicePropertiesFreeAzureCreditApplied + - Added Interface InvoicePropertiesRebillDetails + - Added Interface InvoicePropertiesRefundDetails + - Added Interface InvoicePropertiesSubTotal + - Added Interface InvoicePropertiesTaxAmount + - Added Interface InvoicePropertiesTotalAmount + - Added Interface InvoicesAmendHeaders + - Added Interface InvoicesAmendOptionalParams + - Added Interface InvoicesDownloadByBillingAccountHeaders + - Added Interface InvoicesDownloadByBillingAccountOptionalParams + - Added Interface InvoicesDownloadByBillingSubscriptionHeaders + - Added Interface InvoicesDownloadByBillingSubscriptionOptionalParams + - Added Interface InvoicesDownloadDocumentsByBillingAccountHeaders + - Added Interface InvoicesDownloadDocumentsByBillingAccountOptionalParams + - Added Interface InvoicesDownloadDocumentsByBillingSubscriptionHeaders + - Added Interface InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams + - Added Interface InvoicesDownloadSummaryByBillingAccountHeaders + - Added Interface InvoicesDownloadSummaryByBillingAccountOptionalParams + - Added Interface InvoiceSectionProperties + - Added Interface InvoiceSectionsDeleteHeaders + - Added Interface InvoiceSectionsDeleteOptionalParams + - Added Interface InvoiceSectionsValidateDeleteEligibilityOptionalParams + - Added Interface InvoiceSectionWithCreateSubPermissionListResult + - Added Interface InvoicesGetByBillingAccountOptionalParams + - Added Interface InvoicesGetByBillingSubscriptionOptionalParams + - Added Interface MoveBillingSubscriptionEligibilityResult + - Added Interface MoveBillingSubscriptionErrorDetails + - Added Interface MoveBillingSubscriptionRequest + - Added Interface MoveProductEligibilityResult + - Added Interface MoveProductEligibilityResultErrorDetails + - Added Interface MoveProductErrorDetails + - Added Interface MoveProductRequest + - Added Interface NextBillingCycleDetails + - Added Interface Participant + - Added Interface PartnerInitiateTransferRequest + - Added Interface PartnerTransferDetails + - Added Interface PartnerTransferDetailsListResult + - Added Interface PartnerTransfersCancelOptionalParams + - Added Interface PartnerTransfersGetOptionalParams + - Added Interface PartnerTransfersInitiateOptionalParams + - Added Interface PartnerTransfersListNextOptionalParams + - Added Interface PartnerTransfersListOptionalParams + - Added Interface Patch + - Added Interface Payment + - Added Interface PaymentAmount + - Added Interface PaymentDetail + - Added Interface PaymentMethod + - Added Interface PaymentMethodLink + - Added Interface PaymentMethodLinksListResult + - Added Interface PaymentMethodLogo + - Added Interface PaymentMethodProperties + - Added Interface PaymentMethodsDeleteByUserOptionalParams + - Added Interface PaymentMethodsGetByBillingAccountOptionalParams + - Added Interface PaymentMethodsGetByBillingProfileOptionalParams + - Added Interface PaymentMethodsGetByUserOptionalParams + - Added Interface PaymentMethodsListByBillingAccountNextOptionalParams + - Added Interface PaymentMethodsListByBillingAccountOptionalParams + - Added Interface PaymentMethodsListByBillingProfileNextOptionalParams + - Added Interface PaymentMethodsListByBillingProfileOptionalParams + - Added Interface PaymentMethodsListByUserNextOptionalParams + - Added Interface PaymentMethodsListByUserOptionalParams + - Added Interface PaymentMethodsListResult + - Added Interface PaymentOnAccount + - Added Interface PaymentOnAccountAmount + - Added Interface PaymentTerm + - Added Interface PaymentTermsEligibilityDetail + - Added Interface PaymentTermsEligibilityResult + - Added Interface PoliciesCreateOrUpdateByBillingAccountHeaders + - Added Interface PoliciesCreateOrUpdateByBillingAccountOptionalParams + - Added Interface PoliciesCreateOrUpdateByBillingProfileHeaders + - Added Interface PoliciesCreateOrUpdateByBillingProfileOptionalParams + - Added Interface PoliciesCreateOrUpdateByCustomerAtBillingAccountHeaders + - Added Interface PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams + - Added Interface PoliciesCreateOrUpdateByCustomerHeaders + - Added Interface PoliciesCreateOrUpdateByCustomerOptionalParams + - Added Interface PoliciesGetByBillingAccountOptionalParams + - Added Interface PoliciesGetByCustomerAtBillingAccountOptionalParams + - Added Interface PoliciesGetBySubscriptionOptionalParams + - Added Interface PolicySummary + - Added Interface Price + - Added Interface Principal + - Added Interface ProductDetails + - Added Interface ProductListResult + - Added Interface ProductPatch + - Added Interface ProductProperties + - Added Interface ProductPropertiesLastCharge + - Added Interface ProductPropertiesReseller + - Added Interface ProductsValidateMoveEligibilityOptionalParams + - Added Interface ProxyResource + - Added Interface ProxyResourceWithTags + - Added Interface PurchaseRequest + - Added Interface RecipientTransferDetails + - Added Interface RecipientTransferDetailsListResult + - Added Interface RecipientTransfersAcceptOptionalParams + - Added Interface RecipientTransfersDeclineOptionalParams + - Added Interface RecipientTransfersGetOptionalParams + - Added Interface RecipientTransfersListNextOptionalParams + - Added Interface RecipientTransfersListOptionalParams + - Added Interface RecipientTransfersValidateOptionalParams + - Added Interface RefundDetailsSummary + - Added Interface RefundDetailsSummaryAmountRefunded + - Added Interface RefundDetailsSummaryAmountRequested + - Added Interface RefundTransactionDetails + - Added Interface RefundTransactionDetailsAmountRefunded + - Added Interface RefundTransactionDetailsAmountRequested + - Added Interface RegistrationNumber + - Added Interface RenewalTermDetails + - Added Interface RenewProperties + - Added Interface RenewPropertiesResponse + - Added Interface ReservationAppliedScopeProperties + - Added Interface ReservationExtendedStatusInfo + - Added Interface ReservationList + - Added Interface ReservationMergeProperties + - Added Interface ReservationOrder + - Added Interface ReservationOrderBillingPlanInformation + - Added Interface ReservationOrderList + - Added Interface ReservationOrdersGetByBillingAccountOptionalParams + - Added Interface ReservationOrdersListByBillingAccountNextOptionalParams + - Added Interface ReservationOrdersListByBillingAccountOptionalParams + - Added Interface ReservationPaymentDetail + - Added Interface ReservationPurchaseRequest + - Added Interface ReservationsGetByReservationOrderOptionalParams + - Added Interface ReservationsListByReservationOrderNextOptionalParams + - Added Interface ReservationsListByReservationOrderOptionalParams + - Added Interface ReservationSplitProperties + - Added Interface ReservationsUpdateByBillingAccountHeaders + - Added Interface ReservationsUpdateByBillingAccountOptionalParams + - Added Interface ReservationSwapProperties + - Added Interface SavingsPlanModel + - Added Interface SavingsPlanModelList + - Added Interface SavingsPlanModelListResult + - Added Interface SavingsPlanOrderModel + - Added Interface SavingsPlanOrderModelList + - Added Interface SavingsPlanOrdersGetByBillingAccountOptionalParams + - Added Interface SavingsPlanOrdersListByBillingAccountNextOptionalParams + - Added Interface SavingsPlanOrdersListByBillingAccountOptionalParams + - Added Interface SavingsPlansGetByBillingAccountOptionalParams + - Added Interface SavingsPlansListByBillingAccountNextOptionalParams + - Added Interface SavingsPlansListByBillingAccountOptionalParams + - Added Interface SavingsPlansListBySavingsPlanOrderNextOptionalParams + - Added Interface SavingsPlansListBySavingsPlanOrderOptionalParams + - Added Interface SavingsPlanSummaryCount + - Added Interface SavingsPlansUpdateByBillingAccountHeaders + - Added Interface SavingsPlansUpdateByBillingAccountOptionalParams + - Added Interface SavingsPlansValidateUpdateByBillingAccountOptionalParams + - Added Interface SavingsPlanUpdateRequest + - Added Interface SavingsPlanUpdateRequestProperties + - Added Interface SavingsPlanUpdateValidateRequest + - Added Interface SavingsPlanValidateResponse + - Added Interface SavingsPlanValidResponseProperty + - Added Interface Sku + - Added Interface SkuName + - Added Interface SpendingLimitDetails + - Added Interface SubscriptionEnrollmentDetails + - Added Interface SubscriptionPolicy + - Added Interface SubscriptionPolicyProperties + - Added Interface SystemData + - Added Interface SystemOverrides + - Added Interface TaxIdentifier + - Added Interface TransactionProperties + - Added Interface TransactionPropertiesAzureCreditApplied + - Added Interface TransactionPropertiesConsumptionCommitmentDecremented + - Added Interface TransactionPropertiesEffectivePrice + - Added Interface TransactionPropertiesMarketPrice + - Added Interface TransactionPropertiesRefundTransactionDetails + - Added Interface TransactionPropertiesSubTotal + - Added Interface TransactionPropertiesTax + - Added Interface TransactionPropertiesTransactionAmount + - Added Interface TransactionsGetTransactionSummaryByInvoiceOptionalParams + - Added Interface TransactionsListByBillingProfileNextOptionalParams + - Added Interface TransactionsListByBillingProfileOptionalParams + - Added Interface TransactionsListByCustomerNextOptionalParams + - Added Interface TransactionsListByCustomerOptionalParams + - Added Interface TransactionsListByInvoiceSectionNextOptionalParams + - Added Interface TransactionsListByInvoiceSectionOptionalParams + - Added Interface TransactionsTransactionsDownloadByInvoiceHeaders + - Added Interface TransactionsTransactionsDownloadByInvoiceOptionalParams + - Added Interface TransactionSummary + - Added Interface TransferDetails + - Added Interface TransferDetailsListResult + - Added Interface TransferError + - Added Interface TransferItemQueryParameter + - Added Interface TransfersCancelOptionalParams + - Added Interface TransfersGetOptionalParams + - Added Interface TransfersInitiateOptionalParams + - Added Interface TransfersListNextOptionalParams + - Added Interface TransfersListOptionalParams + - Added Interface TransitionDetails + - Added Interface Utilization + - Added Interface UtilizationAggregates + - Added Interface ValidateTransferListResponse + - Added Interface ValidateTransferResponse + - Added Interface ValidationResultProperties + - Added Type Alias AccessDecision + - Added Type Alias AccountSubType + - Added Type Alias AppliedScopeType + - Added Type Alias AssociatedTenantsCreateOrUpdateResponse + - Added Type Alias AssociatedTenantsDeleteResponse + - Added Type Alias AssociatedTenantsGetResponse + - Added Type Alias AssociatedTenantsListByBillingAccountNextResponse + - Added Type Alias AssociatedTenantsListByBillingAccountResponse + - Added Type Alias AvailableBalancesGetByBillingAccountResponse + - Added Type Alias AvailableBalancesGetByBillingProfileResponse + - Added Type Alias BillingAccountsAddPaymentTermsResponse + - Added Type Alias BillingAccountsCancelPaymentTermsResponse + - Added Type Alias BillingAccountsConfirmTransitionResponse + - Added Type Alias BillingAccountStatusReasonCode + - Added Type Alias BillingAccountsValidatePaymentTermsResponse + - Added Type Alias BillingManagementTenantState + - Added Type Alias BillingPermissionsCheckAccessByBillingAccountResponse + - Added Type Alias BillingPermissionsCheckAccessByBillingProfileResponse + - Added Type Alias BillingPermissionsCheckAccessByCustomerResponse + - Added Type Alias BillingPermissionsCheckAccessByDepartmentResponse + - Added Type Alias BillingPermissionsCheckAccessByEnrollmentAccountResponse + - Added Type Alias BillingPermissionsCheckAccessByInvoiceSectionResponse + - Added Type Alias BillingPermissionsListByCustomerAtBillingAccountNextResponse + - Added Type Alias BillingPermissionsListByCustomerAtBillingAccountResponse + - Added Type Alias BillingPermissionsListByDepartmentNextResponse + - Added Type Alias BillingPermissionsListByDepartmentResponse + - Added Type Alias BillingPermissionsListByEnrollmentAccountNextResponse + - Added Type Alias BillingPermissionsListByEnrollmentAccountResponse + - Added Type Alias BillingPermissionsListByInvoiceSectionNextResponse + - Added Type Alias BillingPermissionsListByInvoiceSectionResponse + - Added Type Alias BillingPlan + - Added Type Alias BillingProfilesDeleteResponse + - Added Type Alias BillingProfilesValidateDeleteEligibilityResponse + - Added Type Alias BillingRequestsCreateOrUpdateResponse + - Added Type Alias BillingRequestsGetResponse + - Added Type Alias BillingRequestsListByBillingAccountNextResponse + - Added Type Alias BillingRequestsListByBillingAccountResponse + - Added Type Alias BillingRequestsListByBillingProfileNextResponse + - Added Type Alias BillingRequestsListByBillingProfileResponse + - Added Type Alias BillingRequestsListByCustomerNextResponse + - Added Type Alias BillingRequestsListByCustomerResponse + - Added Type Alias BillingRequestsListByInvoiceSectionNextResponse + - Added Type Alias BillingRequestsListByInvoiceSectionResponse + - Added Type Alias BillingRequestsListByUserNextResponse + - Added Type Alias BillingRequestsListByUserResponse + - Added Type Alias BillingRequestStatus + - Added Type Alias BillingRequestType + - Added Type Alias BillingRoleAssignmentsCreateByBillingAccountResponse + - Added Type Alias BillingRoleAssignmentsCreateByBillingProfileResponse + - Added Type Alias BillingRoleAssignmentsCreateByCustomerResponse + - Added Type Alias BillingRoleAssignmentsCreateByInvoiceSectionResponse + - Added Type Alias BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse + - Added Type Alias BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse + - Added Type Alias BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse + - Added Type Alias BillingRoleAssignmentsGetByCustomerResponse + - Added Type Alias BillingRoleAssignmentsGetByDepartmentResponse + - Added Type Alias BillingRoleAssignmentsGetByEnrollmentAccountResponse + - Added Type Alias BillingRoleAssignmentsListByCustomerNextResponse + - Added Type Alias BillingRoleAssignmentsListByCustomerResponse + - Added Type Alias BillingRoleAssignmentsListByDepartmentNextResponse + - Added Type Alias BillingRoleAssignmentsListByDepartmentResponse + - Added Type Alias BillingRoleAssignmentsListByEnrollmentAccountNextResponse + - Added Type Alias BillingRoleAssignmentsListByEnrollmentAccountResponse + - Added Type Alias BillingRoleAssignmentsResolveByBillingAccountResponse + - Added Type Alias BillingRoleAssignmentsResolveByBillingProfileResponse + - Added Type Alias BillingRoleAssignmentsResolveByCustomerResponse + - Added Type Alias BillingRoleAssignmentsResolveByInvoiceSectionResponse + - Added Type Alias BillingRoleDefinitionGetByBillingAccountResponse + - Added Type Alias BillingRoleDefinitionGetByBillingProfileResponse + - Added Type Alias BillingRoleDefinitionGetByCustomerResponse + - Added Type Alias BillingRoleDefinitionGetByDepartmentResponse + - Added Type Alias BillingRoleDefinitionGetByEnrollmentAccountResponse + - Added Type Alias BillingRoleDefinitionGetByInvoiceSectionResponse + - Added Type Alias BillingRoleDefinitionListByBillingAccountNextResponse + - Added Type Alias BillingRoleDefinitionListByBillingAccountResponse + - Added Type Alias BillingRoleDefinitionListByBillingProfileNextResponse + - Added Type Alias BillingRoleDefinitionListByBillingProfileResponse + - Added Type Alias BillingRoleDefinitionListByCustomerNextResponse + - Added Type Alias BillingRoleDefinitionListByCustomerResponse + - Added Type Alias BillingRoleDefinitionListByDepartmentNextResponse + - Added Type Alias BillingRoleDefinitionListByDepartmentResponse + - Added Type Alias BillingRoleDefinitionListByEnrollmentAccountNextResponse + - Added Type Alias BillingRoleDefinitionListByEnrollmentAccountResponse + - Added Type Alias BillingRoleDefinitionListByInvoiceSectionNextResponse + - Added Type Alias BillingRoleDefinitionListByInvoiceSectionResponse + - Added Type Alias BillingSubscriptionOperationStatus + - Added Type Alias BillingSubscriptionsAliasesCreateOrUpdateResponse + - Added Type Alias BillingSubscriptionsAliasesGetResponse + - Added Type Alias BillingSubscriptionsAliasesListByBillingAccountNextResponse + - Added Type Alias BillingSubscriptionsAliasesListByBillingAccountResponse + - Added Type Alias BillingSubscriptionsCancelResponse + - Added Type Alias BillingSubscriptionsDeleteResponse + - Added Type Alias BillingSubscriptionsGetByBillingProfileResponse + - Added Type Alias BillingSubscriptionsListByCustomerAtBillingAccountNextResponse + - Added Type Alias BillingSubscriptionsListByCustomerAtBillingAccountResponse + - Added Type Alias BillingSubscriptionsListByEnrollmentAccountNextResponse + - Added Type Alias BillingSubscriptionsListByEnrollmentAccountResponse + - Added Type Alias BillingSubscriptionsMergeResponse + - Added Type Alias BillingSubscriptionsSplitResponse + - Added Type Alias BillingSubscriptionStatus + - Added Type Alias BillingSubscriptionsValidateMoveEligibilityResponse + - Added Type Alias Cancellation + - Added Type Alias CancellationReason + - Added Type Alias CommitmentGrain + - Added Type Alias CreatedByType + - Added Type Alias CreditType + - Added Type Alias CustomersGetByBillingAccountResponse + - Added Type Alias CustomerStatus + - Added Type Alias DeleteBillingProfileEligibilityCode + - Added Type Alias DeleteBillingProfileEligibilityStatus + - Added Type Alias DeleteInvoiceSectionEligibilityCode + - Added Type Alias DeleteInvoiceSectionEligibilityStatus + - Added Type Alias DepartmentsGetResponse + - Added Type Alias DepartmentsListByBillingAccountNextResponse + - Added Type Alias DepartmentsListByBillingAccountResponse + - Added Type Alias EligibleProductType + - Added Type Alias EnrollmentAccountOwnerViewCharges + - Added Type Alias EnrollmentAccountsGetByDepartmentResponse + - Added Type Alias EnrollmentAccountsListByBillingAccountNextResponse + - Added Type Alias EnrollmentAccountsListByBillingAccountResponse + - Added Type Alias EnrollmentAccountsListByDepartmentNextResponse + - Added Type Alias EnrollmentAccountsListByDepartmentResponse + - Added Type Alias EnrollmentAuthLevelState + - Added Type Alias EnrollmentDepartmentAdminViewCharges + - Added Type Alias ExtendedTermOption + - Added Type Alias FailedPaymentReason + - Added Type Alias InitiatorCustomerType + - Added Type Alias InstanceFlexibility + - Added Type Alias InvoicesAmendResponse + - Added Type Alias InvoicesDownloadByBillingAccountResponse + - Added Type Alias InvoicesDownloadByBillingSubscriptionResponse + - Added Type Alias InvoicesDownloadDocumentsByBillingAccountResponse + - Added Type Alias InvoicesDownloadDocumentsByBillingSubscriptionResponse + - Added Type Alias InvoicesDownloadSummaryByBillingAccountResponse + - Added Type Alias InvoiceSectionLabelManagementPolicy + - Added Type Alias InvoiceSectionsDeleteResponse + - Added Type Alias InvoiceSectionStateReasonCode + - Added Type Alias InvoiceSectionsValidateDeleteEligibilityResponse + - Added Type Alias InvoicesGetByBillingAccountResponse + - Added Type Alias InvoicesGetByBillingSubscriptionResponse + - Added Type Alias MarkupStatus + - Added Type Alias MoveValidationErrorCode + - Added Type Alias PartnerTransfersCancelResponse + - Added Type Alias PartnerTransfersGetResponse + - Added Type Alias PartnerTransfersInitiateResponse + - Added Type Alias PartnerTransfersListNextResponse + - Added Type Alias PartnerTransfersListResponse + - Added Type Alias PaymentMethodsGetByBillingAccountResponse + - Added Type Alias PaymentMethodsGetByBillingProfileResponse + - Added Type Alias PaymentMethodsGetByUserResponse + - Added Type Alias PaymentMethodsListByBillingAccountNextResponse + - Added Type Alias PaymentMethodsListByBillingAccountResponse + - Added Type Alias PaymentMethodsListByBillingProfileNextResponse + - Added Type Alias PaymentMethodsListByBillingProfileResponse + - Added Type Alias PaymentMethodsListByUserNextResponse + - Added Type Alias PaymentMethodsListByUserResponse + - Added Type Alias PaymentMethodStatus + - Added Type Alias PaymentStatus + - Added Type Alias PaymentTermsEligibilityCode + - Added Type Alias PaymentTermsEligibilityStatus + - Added Type Alias PoliciesCreateOrUpdateByBillingAccountResponse + - Added Type Alias PoliciesCreateOrUpdateByBillingProfileResponse + - Added Type Alias PoliciesCreateOrUpdateByCustomerAtBillingAccountResponse + - Added Type Alias PoliciesCreateOrUpdateByCustomerResponse + - Added Type Alias PoliciesGetByBillingAccountResponse + - Added Type Alias PoliciesGetByCustomerAtBillingAccountResponse + - Added Type Alias PoliciesGetBySubscriptionResponse + - Added Type Alias PolicyType + - Added Type Alias PrincipalType + - Added Type Alias ProductStatus + - Added Type Alias ProductsValidateMoveEligibilityResponse + - Added Type Alias ProductTransferStatus + - Added Type Alias ProductType + - Added Type Alias ProvisioningState + - Added Type Alias ProvisioningTenantState + - Added Type Alias RecipientTransfersAcceptResponse + - Added Type Alias RecipientTransfersDeclineResponse + - Added Type Alias RecipientTransfersGetResponse + - Added Type Alias RecipientTransfersListNextResponse + - Added Type Alias RecipientTransfersListResponse + - Added Type Alias RecipientTransfersValidateResponse + - Added Type Alias RefundReasonCode + - Added Type Alias RefundStatus + - Added Type Alias ReservationBillingPlan + - Added Type Alias ReservationOrdersGetByBillingAccountResponse + - Added Type Alias ReservationOrdersListByBillingAccountNextResponse + - Added Type Alias ReservationOrdersListByBillingAccountResponse + - Added Type Alias ReservationsGetByReservationOrderResponse + - Added Type Alias ReservationsListByReservationOrderNextResponse + - Added Type Alias ReservationsListByReservationOrderResponse + - Added Type Alias ReservationStatusCode + - Added Type Alias ReservationsUpdateByBillingAccountResponse + - Added Type Alias SavingsPlanOrdersGetByBillingAccountResponse + - Added Type Alias SavingsPlanOrdersListByBillingAccountNextResponse + - Added Type Alias SavingsPlanOrdersListByBillingAccountResponse + - Added Type Alias SavingsPlanPurchasesPolicy + - Added Type Alias SavingsPlansGetByBillingAccountResponse + - Added Type Alias SavingsPlansListByBillingAccountNextResponse + - Added Type Alias SavingsPlansListByBillingAccountResponse + - Added Type Alias SavingsPlansListBySavingsPlanOrderNextResponse + - Added Type Alias SavingsPlansListBySavingsPlanOrderResponse + - Added Type Alias SavingsPlansUpdateByBillingAccountResponse + - Added Type Alias SavingsPlansValidateUpdateByBillingAccountResponse + - Added Type Alias SavingsPlanTerm + - Added Type Alias ServiceDefinedResourceName + - Added Type Alias SpecialTaxationType + - Added Type Alias SpendingLimitStatus + - Added Type Alias SpendingLimitType + - Added Type Alias SubscriptionBillingType + - Added Type Alias SubscriptionEnrollmentAccountStatus + - Added Type Alias SubscriptionStatusReason + - Added Type Alias SubscriptionWorkloadType + - Added Type Alias SupportedAccountType + - Added Type Alias SupportLevel + - Added Type Alias TaxIdentifierStatus + - Added Type Alias TaxIdentifierType + - Added Type Alias TransactionKind + - Added Type Alias TransactionsGetTransactionSummaryByInvoiceResponse + - Added Type Alias TransactionsListByBillingProfileNextResponse + - Added Type Alias TransactionsListByBillingProfileResponse + - Added Type Alias TransactionsListByCustomerNextResponse + - Added Type Alias TransactionsListByCustomerResponse + - Added Type Alias TransactionsListByInvoiceSectionNextResponse + - Added Type Alias TransactionsListByInvoiceSectionResponse + - Added Type Alias TransactionsTransactionsDownloadByInvoiceResponse + - Added Type Alias TransactionType + - Added Type Alias TransfersCancelResponse + - Added Type Alias TransfersGetResponse + - Added Type Alias TransfersInitiateResponse + - Added Type Alias TransfersListNextResponse + - Added Type Alias TransfersListResponse + - Added Type Alias TransferStatus + - Interface AddressDetails has a new optional parameter isValidAddress + - Interface Agreement has a new optional parameter properties + - Interface AvailableBalance has a new optional parameter properties + - Interface AzurePlan has a new optional parameter productId + - Interface BillingAccount has a new optional parameter properties + - Interface BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams has a new optional parameter filter + - Interface BillingAccountsListOptionalParams has a new optional parameter filter + - Interface BillingAccountsListOptionalParams has a new optional parameter includeAll + - Interface BillingAccountsListOptionalParams has a new optional parameter includeAllWithoutBillingProfiles + - Interface BillingAccountsListOptionalParams has a new optional parameter includeDeleted + - Interface BillingAccountsListOptionalParams has a new optional parameter includePendingAgreement + - Interface BillingAccountsListOptionalParams has a new optional parameter includeResellee + - Interface BillingAccountsListOptionalParams has a new optional parameter legalOwnerOID + - Interface BillingAccountsListOptionalParams has a new optional parameter legalOwnerTID + - Interface BillingAccountsListOptionalParams has a new optional parameter search + - Interface BillingAccountsListOptionalParams has a new optional parameter skip + - Interface BillingAccountsListOptionalParams has a new optional parameter top + - Interface BillingManagementClientOptionalParams has a new optional parameter apiVersion + - Interface BillingProfile has a new optional parameter properties + - Interface BillingProfilesListByBillingAccountOptionalParams has a new optional parameter count + - Interface BillingProfilesListByBillingAccountOptionalParams has a new optional parameter filter + - Interface BillingProfilesListByBillingAccountOptionalParams has a new optional parameter includeDeleted + - Interface BillingProfilesListByBillingAccountOptionalParams has a new optional parameter orderBy + - Interface BillingProfilesListByBillingAccountOptionalParams has a new optional parameter search + - Interface BillingProfilesListByBillingAccountOptionalParams has a new optional parameter skip + - Interface BillingProfilesListByBillingAccountOptionalParams has a new optional parameter top + - Interface BillingProperty has a new optional parameter properties + - Interface BillingPropertyGetOptionalParams has a new optional parameter includeBillingCountry + - Interface BillingPropertyGetOptionalParams has a new optional parameter includeTransitionStatus + - Interface BillingRoleAssignment has a new optional parameter properties + - Interface BillingRoleAssignmentsListByBillingAccountOptionalParams has a new optional parameter filter + - Interface BillingRoleAssignmentsListByBillingAccountOptionalParams has a new optional parameter skip + - Interface BillingRoleAssignmentsListByBillingAccountOptionalParams has a new optional parameter top + - Interface BillingRoleAssignmentsListByBillingProfileOptionalParams has a new optional parameter filter + - Interface BillingRoleAssignmentsListByBillingProfileOptionalParams has a new optional parameter skip + - Interface BillingRoleAssignmentsListByBillingProfileOptionalParams has a new optional parameter top + - Interface BillingRoleAssignmentsListByInvoiceSectionOptionalParams has a new optional parameter filter + - Interface BillingRoleAssignmentsListByInvoiceSectionOptionalParams has a new optional parameter skip + - Interface BillingRoleAssignmentsListByInvoiceSectionOptionalParams has a new optional parameter top + - Interface BillingRoleDefinition has a new optional parameter properties + - Interface BillingSubscription has a new optional parameter autoRenew + - Interface BillingSubscription has a new optional parameter beneficiary + - Interface BillingSubscription has a new optional parameter beneficiaryTenantId + - Interface BillingSubscription has a new optional parameter billingFrequency + - Interface BillingSubscription has a new optional parameter billingPolicies + - Interface BillingSubscription has a new optional parameter billingProfileName + - Interface BillingSubscription has a new optional parameter consumptionCostCenter + - Interface BillingSubscription has a new optional parameter customerName + - Interface BillingSubscription has a new optional parameter enrollmentAccountDisplayName + - Interface BillingSubscription has a new optional parameter enrollmentAccountId + - Interface BillingSubscription has a new optional parameter enrollmentAccountStartDate + - Interface BillingSubscription has a new optional parameter invoiceSectionName + - Interface BillingSubscription has a new optional parameter nextBillingCycleDetails + - Interface BillingSubscription has a new optional parameter offerId + - Interface BillingSubscription has a new optional parameter operationStatus + - Interface BillingSubscription has a new optional parameter productCategory + - Interface BillingSubscription has a new optional parameter productType + - Interface BillingSubscription has a new optional parameter productTypeId + - Interface BillingSubscription has a new optional parameter provisioningState + - Interface BillingSubscription has a new optional parameter provisioningTenantId + - Interface BillingSubscription has a new optional parameter purchaseDate + - Interface BillingSubscription has a new optional parameter quantity + - Interface BillingSubscription has a new optional parameter renewalTermDetails + - Interface BillingSubscription has a new optional parameter resourceUri + - Interface BillingSubscription has a new optional parameter status + - Interface BillingSubscription has a new optional parameter subscriptionEnrollmentAccountStatus + - Interface BillingSubscription has a new optional parameter suspensionReasonDetails + - Interface BillingSubscription has a new optional parameter systemOverrides + - Interface BillingSubscription has a new optional parameter termDuration + - Interface BillingSubscription has a new optional parameter termEndDate + - Interface BillingSubscription has a new optional parameter termStartDate + - Interface BillingSubscriptionsGetOptionalParams has a new optional parameter expand + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter count + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter expand + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter filter + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter includeDeleted + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter includeFailed + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter includeTenantSubscriptions + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter orderBy + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter search + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter skip + - Interface BillingSubscriptionsListByBillingAccountOptionalParams has a new optional parameter top + - Interface BillingSubscriptionsListByBillingProfileOptionalParams has a new optional parameter count + - Interface BillingSubscriptionsListByBillingProfileOptionalParams has a new optional parameter expand + - Interface BillingSubscriptionsListByBillingProfileOptionalParams has a new optional parameter filter + - Interface BillingSubscriptionsListByBillingProfileOptionalParams has a new optional parameter includeDeleted + - Interface BillingSubscriptionsListByBillingProfileOptionalParams has a new optional parameter orderBy + - Interface BillingSubscriptionsListByBillingProfileOptionalParams has a new optional parameter search + - Interface BillingSubscriptionsListByBillingProfileOptionalParams has a new optional parameter skip + - Interface BillingSubscriptionsListByBillingProfileOptionalParams has a new optional parameter top + - Interface BillingSubscriptionsListByCustomerOptionalParams has a new optional parameter count + - Interface BillingSubscriptionsListByCustomerOptionalParams has a new optional parameter expand + - Interface BillingSubscriptionsListByCustomerOptionalParams has a new optional parameter filter + - Interface BillingSubscriptionsListByCustomerOptionalParams has a new optional parameter includeDeleted + - Interface BillingSubscriptionsListByCustomerOptionalParams has a new optional parameter orderBy + - Interface BillingSubscriptionsListByCustomerOptionalParams has a new optional parameter search + - Interface BillingSubscriptionsListByCustomerOptionalParams has a new optional parameter skip + - Interface BillingSubscriptionsListByCustomerOptionalParams has a new optional parameter top + - Interface BillingSubscriptionsListByInvoiceSectionOptionalParams has a new optional parameter count + - Interface BillingSubscriptionsListByInvoiceSectionOptionalParams has a new optional parameter expand + - Interface BillingSubscriptionsListByInvoiceSectionOptionalParams has a new optional parameter filter + - Interface BillingSubscriptionsListByInvoiceSectionOptionalParams has a new optional parameter includeDeleted + - Interface BillingSubscriptionsListByInvoiceSectionOptionalParams has a new optional parameter orderBy + - Interface BillingSubscriptionsListByInvoiceSectionOptionalParams has a new optional parameter search + - Interface BillingSubscriptionsListByInvoiceSectionOptionalParams has a new optional parameter skip + - Interface BillingSubscriptionsListByInvoiceSectionOptionalParams has a new optional parameter top + - Interface BillingSubscriptionsUpdateOptionalParams has a new optional parameter resumeFrom + - Interface BillingSubscriptionsUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Interface Customer has a new optional parameter properties + - Interface CustomerPolicy has a new optional parameter properties + - Interface CustomersListByBillingAccountOptionalParams has a new optional parameter count + - Interface CustomersListByBillingAccountOptionalParams has a new optional parameter expand + - Interface CustomersListByBillingAccountOptionalParams has a new optional parameter orderBy + - Interface CustomersListByBillingAccountOptionalParams has a new optional parameter skip + - Interface CustomersListByBillingAccountOptionalParams has a new optional parameter top + - Interface CustomersListByBillingProfileOptionalParams has a new optional parameter count + - Interface CustomersListByBillingProfileOptionalParams has a new optional parameter expand + - Interface CustomersListByBillingProfileOptionalParams has a new optional parameter orderBy + - Interface CustomersListByBillingProfileOptionalParams has a new optional parameter skip + - Interface CustomersListByBillingProfileOptionalParams has a new optional parameter top + - Interface Department has a new optional parameter properties + - Interface EnrollmentAccount has a new optional parameter properties + - Interface Invoice has a new optional parameter properties + - Interface InvoiceSection has a new optional parameter properties + - Interface InvoiceSectionsListByBillingProfileOptionalParams has a new optional parameter count + - Interface InvoiceSectionsListByBillingProfileOptionalParams has a new optional parameter filter + - Interface InvoiceSectionsListByBillingProfileOptionalParams has a new optional parameter includeDeleted + - Interface InvoiceSectionsListByBillingProfileOptionalParams has a new optional parameter orderBy + - Interface InvoiceSectionsListByBillingProfileOptionalParams has a new optional parameter search + - Interface InvoiceSectionsListByBillingProfileOptionalParams has a new optional parameter skip + - Interface InvoiceSectionsListByBillingProfileOptionalParams has a new optional parameter top + - Interface InvoicesListByBillingAccountOptionalParams has a new optional parameter count + - Interface InvoicesListByBillingAccountOptionalParams has a new optional parameter filter + - Interface InvoicesListByBillingAccountOptionalParams has a new optional parameter orderBy + - Interface InvoicesListByBillingAccountOptionalParams has a new optional parameter periodEndDate + - Interface InvoicesListByBillingAccountOptionalParams has a new optional parameter periodStartDate + - Interface InvoicesListByBillingAccountOptionalParams has a new optional parameter search + - Interface InvoicesListByBillingAccountOptionalParams has a new optional parameter skip + - Interface InvoicesListByBillingAccountOptionalParams has a new optional parameter top + - Interface InvoicesListByBillingProfileOptionalParams has a new optional parameter count + - Interface InvoicesListByBillingProfileOptionalParams has a new optional parameter filter + - Interface InvoicesListByBillingProfileOptionalParams has a new optional parameter orderBy + - Interface InvoicesListByBillingProfileOptionalParams has a new optional parameter periodEndDate + - Interface InvoicesListByBillingProfileOptionalParams has a new optional parameter periodStartDate + - Interface InvoicesListByBillingProfileOptionalParams has a new optional parameter search + - Interface InvoicesListByBillingProfileOptionalParams has a new optional parameter skip + - Interface InvoicesListByBillingProfileOptionalParams has a new optional parameter top + - Interface InvoicesListByBillingSubscriptionOptionalParams has a new optional parameter count + - Interface InvoicesListByBillingSubscriptionOptionalParams has a new optional parameter filter + - Interface InvoicesListByBillingSubscriptionOptionalParams has a new optional parameter orderBy + - Interface InvoicesListByBillingSubscriptionOptionalParams has a new optional parameter periodEndDate + - Interface InvoicesListByBillingSubscriptionOptionalParams has a new optional parameter periodStartDate + - Interface InvoicesListByBillingSubscriptionOptionalParams has a new optional parameter search + - Interface InvoicesListByBillingSubscriptionOptionalParams has a new optional parameter skip + - Interface InvoicesListByBillingSubscriptionOptionalParams has a new optional parameter top + - Interface Product has a new optional parameter properties + - Interface ProductsListByBillingAccountOptionalParams has a new optional parameter count + - Interface ProductsListByBillingAccountOptionalParams has a new optional parameter orderBy + - Interface ProductsListByBillingAccountOptionalParams has a new optional parameter search + - Interface ProductsListByBillingAccountOptionalParams has a new optional parameter skip + - Interface ProductsListByBillingAccountOptionalParams has a new optional parameter top + - Interface ProductsListByBillingProfileOptionalParams has a new optional parameter count + - Interface ProductsListByBillingProfileOptionalParams has a new optional parameter orderBy + - Interface ProductsListByBillingProfileOptionalParams has a new optional parameter search + - Interface ProductsListByBillingProfileOptionalParams has a new optional parameter skip + - Interface ProductsListByBillingProfileOptionalParams has a new optional parameter top + - Interface ProductsListByCustomerOptionalParams has a new optional parameter count + - Interface ProductsListByCustomerOptionalParams has a new optional parameter filter + - Interface ProductsListByCustomerOptionalParams has a new optional parameter orderBy + - Interface ProductsListByCustomerOptionalParams has a new optional parameter search + - Interface ProductsListByCustomerOptionalParams has a new optional parameter skip + - Interface ProductsListByCustomerOptionalParams has a new optional parameter top + - Interface ProductsListByInvoiceSectionOptionalParams has a new optional parameter count + - Interface ProductsListByInvoiceSectionOptionalParams has a new optional parameter orderBy + - Interface ProductsListByInvoiceSectionOptionalParams has a new optional parameter search + - Interface ProductsListByInvoiceSectionOptionalParams has a new optional parameter skip + - Interface ProductsListByInvoiceSectionOptionalParams has a new optional parameter top + - Interface ProductsMoveOptionalParams has a new optional parameter resumeFrom + - Interface ProductsMoveOptionalParams has a new optional parameter updateIntervalInMs + - Interface Reservation has a new optional parameter aggregates + - Interface Reservation has a new optional parameter appliedScopeProperties + - Interface Reservation has a new optional parameter archived + - Interface Reservation has a new optional parameter benefitStartTime + - Interface Reservation has a new optional parameter billingPlan + - Interface Reservation has a new optional parameter billingScopeId + - Interface Reservation has a new optional parameter capabilities + - Interface Reservation has a new optional parameter etag + - Interface Reservation has a new optional parameter expiryDateTime + - Interface Reservation has a new optional parameter extendedStatusInfo + - Interface Reservation has a new optional parameter instanceFlexibility + - Interface Reservation has a new optional parameter lastUpdatedDateTime + - Interface Reservation has a new optional parameter mergeProperties + - Interface Reservation has a new optional parameter productCode + - Interface Reservation has a new optional parameter purchaseDate + - Interface Reservation has a new optional parameter purchaseDateTime + - Interface Reservation has a new optional parameter renewDestination + - Interface Reservation has a new optional parameter renewProperties + - Interface Reservation has a new optional parameter reviewDateTime + - Interface Reservation has a new optional parameter splitProperties + - Interface Reservation has a new optional parameter swapProperties + - Interface Reservation has a new optional parameter tags + - Interface Reservation has a new optional parameter trend + - Interface ReservationsListByBillingAccountOptionalParams has a new optional parameter orderBy + - Interface ReservationsListByBillingAccountOptionalParams has a new optional parameter skiptoken + - Interface ReservationsListByBillingAccountOptionalParams has a new optional parameter take + - Interface ReservationsListByBillingProfileOptionalParams has a new optional parameter orderBy + - Interface ReservationsListByBillingProfileOptionalParams has a new optional parameter skiptoken + - Interface ReservationsListByBillingProfileOptionalParams has a new optional parameter take + - Interface ReservationSummary has a new optional parameter noBenefitCount + - Interface ReservationSummary has a new optional parameter processingCount + - Interface ReservationSummary has a new optional parameter warningCount + - Interface Resource has a new optional parameter systemData + - Interface Transaction has a new optional parameter properties + - Interface TransactionsListByInvoiceOptionalParams has a new optional parameter count + - Interface TransactionsListByInvoiceOptionalParams has a new optional parameter filter + - Interface TransactionsListByInvoiceOptionalParams has a new optional parameter orderBy + - Interface TransactionsListByInvoiceOptionalParams has a new optional parameter search + - Interface TransactionsListByInvoiceOptionalParams has a new optional parameter skip + - Interface TransactionsListByInvoiceOptionalParams has a new optional parameter top + - Added Enum KnownAccessDecision + - Added Enum KnownAccountSubType + - Added Enum KnownAppliedScopeType + - Added Enum KnownBillingAccountStatusReasonCode + - Added Enum KnownBillingManagementTenantState + - Added Enum KnownBillingPlan + - Added Enum KnownBillingRequestStatus + - Added Enum KnownBillingRequestType + - Added Enum KnownBillingSubscriptionOperationStatus + - Added Enum KnownBillingSubscriptionStatus + - Added Enum KnownCancellation + - Added Enum KnownCancellationReason + - Added Enum KnownCommitmentGrain + - Added Enum KnownCreatedByType + - Added Enum KnownCreditType + - Added Enum KnownCustomerStatus + - Added Enum KnownDeleteBillingProfileEligibilityCode + - Added Enum KnownDeleteBillingProfileEligibilityStatus + - Added Enum KnownDeleteInvoiceSectionEligibilityCode + - Added Enum KnownDeleteInvoiceSectionEligibilityStatus + - Added Enum KnownEligibleProductType + - Added Enum KnownEnrollmentAccountOwnerViewCharges + - Added Enum KnownEnrollmentAuthLevelState + - Added Enum KnownEnrollmentDepartmentAdminViewCharges + - Added Enum KnownExtendedTermOption + - Added Enum KnownFailedPaymentReason + - Added Enum KnownInitiatorCustomerType + - Added Enum KnownInstanceFlexibility + - Added Enum KnownInvoiceSectionLabelManagementPolicy + - Added Enum KnownInvoiceSectionStateReasonCode + - Added Enum KnownMarkupStatus + - Added Enum KnownMoveValidationErrorCode + - Added Enum KnownPaymentMethodStatus + - Added Enum KnownPaymentStatus + - Added Enum KnownPaymentTermsEligibilityCode + - Added Enum KnownPaymentTermsEligibilityStatus + - Added Enum KnownPolicyType + - Added Enum KnownPrincipalType + - Added Enum KnownProductStatus + - Added Enum KnownProductTransferStatus + - Added Enum KnownProductType + - Added Enum KnownProvisioningState + - Added Enum KnownProvisioningTenantState + - Added Enum KnownRefundReasonCode + - Added Enum KnownRefundStatus + - Added Enum KnownReservationBillingPlan + - Added Enum KnownReservationStatusCode + - Added Enum KnownSavingsPlanPurchasesPolicy + - Added Enum KnownSavingsPlanTerm + - Added Enum KnownServiceDefinedResourceName + - Added Enum KnownSpecialTaxationType + - Added Enum KnownSpendingLimitStatus + - Added Enum KnownSpendingLimitType + - Added Enum KnownSubscriptionBillingType + - Added Enum KnownSubscriptionEnrollmentAccountStatus + - Added Enum KnownSubscriptionStatusReason + - Added Enum KnownSubscriptionWorkloadType + - Added Enum KnownSupportedAccountType + - Added Enum KnownSupportLevel + - Added Enum KnownTaxIdentifierStatus + - Added Enum KnownTaxIdentifierType + - Added Enum KnownTransactionKind + - Added Enum KnownTransactionType + - Added Enum KnownTransferStatus + - Enum KnownAcceptanceMode has a new value Implicit + - Enum KnownAcceptanceMode has a new value Offline + - Enum KnownAcceptanceMode has a new value Other + - Enum KnownAcceptanceMode has a new value PhysicalSign + - Enum KnownAccountStatus has a new value New + - Enum KnownAccountStatus has a new value Other + - Enum KnownAccountStatus has a new value Pending + - Enum KnownAccountStatus has a new value UnderReview + - Enum KnownAccountType has a new value Business + - Enum KnownAccountType has a new value ClassicPartner + - Enum KnownAccountType has a new value Internal + - Enum KnownAccountType has a new value Other + - Enum KnownAccountType has a new value Reseller + - Enum KnownAccountType has a new value Tenant + - Enum KnownAddressValidationStatus has a new value Other + - Enum KnownAgreementType has a new value Other + - Enum KnownBillingProfileStatus has a new value Deleted + - Enum KnownBillingProfileStatus has a new value Other + - Enum KnownBillingProfileStatus has a new value UnderReview + - Enum KnownBillingProfileStatusReasonCode has a new value Other + - Enum KnownBillingProfileStatusReasonCode has a new value UnusualActivity + - Enum KnownBillingRelationshipType has a new value CSPCustomer + - Enum KnownBillingRelationshipType has a new value Other + - Enum KnownCategory has a new value IndirectForGovernmentAgreement + - Enum KnownCategory has a new value MicrosoftPartnerAgreement + - Enum KnownCategory has a new value UKCloudComputeFramework + - Enum KnownDocumentSource has a new value Other + - Enum KnownInvoiceDocumentType has a new value Other + - Enum KnownInvoiceDocumentType has a new value Summary + - Enum KnownInvoiceDocumentType has a new value TaxReceipt + - Enum KnownInvoiceDocumentType has a new value Transactions + - Enum KnownInvoiceDocumentType has a new value VoidNote + - Enum KnownInvoiceSectionState has a new value Deleted + - Enum KnownInvoiceSectionState has a new value Disabled + - Enum KnownInvoiceSectionState has a new value Other + - Enum KnownInvoiceSectionState has a new value UnderReview + - Enum KnownInvoiceSectionState has a new value Warned + - Enum KnownInvoiceStatus has a new value Locked + - Enum KnownInvoiceStatus has a new value Other + - Enum KnownInvoiceType has a new value AzureServices + - Enum KnownInvoiceType has a new value Other + - Enum KnownMarketplacePurchasesPolicy has a new value Disabled + - Enum KnownMarketplacePurchasesPolicy has a new value Other + - Enum KnownPaymentMethodFamily has a new value DirectDebit + - Enum KnownPaymentMethodFamily has a new value EWallet + - Enum KnownPaymentMethodFamily has a new value Other + - Enum KnownPaymentMethodFamily has a new value TaskOrder + - Enum KnownReservationPurchasesPolicy has a new value Disabled + - Enum KnownReservationPurchasesPolicy has a new value Other + - Enum KnownSubscriptionTransferValidationErrorCode has a new value AccountIsLocked + - Enum KnownSubscriptionTransferValidationErrorCode has a new value AssetHasCap + - Enum KnownSubscriptionTransferValidationErrorCode has a new value AssetNotActive + - Enum KnownSubscriptionTransferValidationErrorCode has a new value BillingProfilePastDue + - Enum KnownSubscriptionTransferValidationErrorCode has a new value InvoiceSectionIsRestricted + - Enum KnownSubscriptionTransferValidationErrorCode has a new value NoActiveAzurePlan + - Enum KnownSubscriptionTransferValidationErrorCode has a new value None + - Enum KnownSubscriptionTransferValidationErrorCode has a new value Other + - Enum KnownSubscriptionTransferValidationErrorCode has a new value SubscriptionHasReservations + - Enum KnownViewChargesPolicy has a new value Other -### Other Changes +### Breaking Changes + - Removed operation group BillingPeriods + - Removed operation group BillingRoleDefinitions + - Removed operation group Instructions + - Removed operation AvailableBalances.get + - Removed operation BillingPermissions.listByInvoiceSections + - Removed operation BillingSubscriptions.update + - Removed operation BillingSubscriptions.validateMove + - Removed operation EnrollmentAccounts.list + - Removed operation Invoices.beginDownloadBillingSubscriptionInvoice + - Removed operation Invoices.beginDownloadBillingSubscriptionInvoiceAndWait + - Removed operation Invoices.beginDownloadInvoice + - Removed operation Invoices.beginDownloadInvoiceAndWait + - Removed operation Invoices.beginDownloadMultipleBillingProfileInvoices + - Removed operation Invoices.beginDownloadMultipleBillingProfileInvoicesAndWait + - Removed operation Invoices.beginDownloadMultipleBillingSubscriptionInvoices + - Removed operation Invoices.beginDownloadMultipleBillingSubscriptionInvoicesAndWait + - Removed operation Invoices.getById + - Removed operation Invoices.getBySubscriptionAndInvoiceId + - Removed operation Policies.update + - Removed operation Policies.updateCustomer + - Removed operation Products.move + - Removed operation Products.validateMove + - Operation BillingAccounts.beginUpdate has a new signature + - Operation BillingAccounts.beginUpdateAndWait has a new signature + - Operation BillingPermissions.listByCustomer has a new signature + - Operation BillingSubscriptions.beginMove has a new signature + - Operation BillingSubscriptions.beginMoveAndWait has a new signature + - Operation BillingSubscriptions.get has a new signature + - Operation BillingSubscriptions.listByCustomer has a new signature + - Operation Customers.get has a new signature + - Operation EnrollmentAccounts.get has a new signature + - Operation Invoices.get has a new signature + - Operation Invoices.listByBillingAccount has a new signature + - Operation Invoices.listByBillingProfile has a new signature + - Operation Invoices.listByBillingSubscription has a new signature + - Operation Policies.getByCustomer has a new signature + - Operation Products.update has a new signature + - Class BillingManagementClient has a new signature + - Interface Agreement no longer has parameter acceptanceMode + - Interface Agreement no longer has parameter agreementLink + - Interface Agreement no longer has parameter category + - Interface Agreement no longer has parameter effectiveDate + - Interface Agreement no longer has parameter expirationDate + - Interface Agreement no longer has parameter participants + - Interface Agreement no longer has parameter status + - Interface AgreementsGetOptionalParams no longer has parameter expand + - Interface AgreementsListByBillingAccountNextOptionalParams no longer has parameter expand + - Interface AvailableBalance no longer has parameter amount + - Interface BillingAccount no longer has parameter accountStatus + - Interface BillingAccount no longer has parameter accountType + - Interface BillingAccount no longer has parameter agreementType + - Interface BillingAccount no longer has parameter billingProfiles + - Interface BillingAccount no longer has parameter departments + - Interface BillingAccount no longer has parameter displayName + - Interface BillingAccount no longer has parameter enrollmentAccounts + - Interface BillingAccount no longer has parameter enrollmentDetails + - Interface BillingAccount no longer has parameter hasReadAccess + - Interface BillingAccount no longer has parameter notificationEmailAddress + - Interface BillingAccount no longer has parameter soldTo + - Interface BillingAccountsGetOptionalParams no longer has parameter expand + - Interface BillingAccountsListNextOptionalParams no longer has parameter expand + - Interface BillingProfile no longer has parameter billingRelationshipType + - Interface BillingProfile no longer has parameter billTo + - Interface BillingProfile no longer has parameter currency + - Interface BillingProfile no longer has parameter displayName + - Interface BillingProfile no longer has parameter enabledAzurePlans + - Interface BillingProfile no longer has parameter hasReadAccess + - Interface BillingProfile no longer has parameter indirectRelationshipInfo + - Interface BillingProfile no longer has parameter invoiceDay + - Interface BillingProfile no longer has parameter invoiceEmailOptIn + - Interface BillingProfile no longer has parameter invoiceSections + - Interface BillingProfile no longer has parameter poNumber + - Interface BillingProfile no longer has parameter spendingLimit + - Interface BillingProfile no longer has parameter status + - Interface BillingProfile no longer has parameter statusReasonCode + - Interface BillingProfile no longer has parameter systemId + - Interface BillingProfile no longer has parameter targetClouds + - Interface BillingProfilesGetOptionalParams no longer has parameter expand + - Interface BillingProfilesListByBillingAccountNextOptionalParams no longer has parameter expand + - Interface BillingProfilesListByBillingAccountOptionalParams no longer has parameter expand + - Interface BillingProperty no longer has parameter accountAdminNotificationEmailAddress + - Interface BillingProperty no longer has parameter billingAccountDisplayName + - Interface BillingProperty no longer has parameter billingAccountId + - Interface BillingProperty no longer has parameter billingProfileDisplayName + - Interface BillingProperty no longer has parameter billingProfileId + - Interface BillingProperty no longer has parameter billingProfileSpendingLimit + - Interface BillingProperty no longer has parameter billingProfileStatus + - Interface BillingProperty no longer has parameter billingProfileStatusReasonCode + - Interface BillingProperty no longer has parameter billingTenantId + - Interface BillingProperty no longer has parameter costCenter + - Interface BillingProperty no longer has parameter invoiceSectionDisplayName + - Interface BillingProperty no longer has parameter invoiceSectionId + - Interface BillingProperty no longer has parameter isAccountAdmin + - Interface BillingProperty no longer has parameter productId + - Interface BillingProperty no longer has parameter productName + - Interface BillingProperty no longer has parameter skuDescription + - Interface BillingProperty no longer has parameter skuId + - Interface BillingRoleAssignment no longer has parameter createdByPrincipalId + - Interface BillingRoleAssignment no longer has parameter createdByPrincipalTenantId + - Interface BillingRoleAssignment no longer has parameter createdByUserEmailAddress + - Interface BillingRoleAssignment no longer has parameter createdOn + - Interface BillingRoleAssignment no longer has parameter principalId + - Interface BillingRoleAssignment no longer has parameter principalTenantId + - Interface BillingRoleAssignment no longer has parameter roleDefinitionId + - Interface BillingRoleAssignment no longer has parameter scope + - Interface BillingRoleAssignment no longer has parameter userAuthenticationType + - Interface BillingRoleAssignment no longer has parameter userEmailAddress + - Interface BillingRoleDefinition no longer has parameter description + - Interface BillingRoleDefinition no longer has parameter permissions + - Interface BillingRoleDefinition no longer has parameter roleName + - Interface BillingSubscription no longer has parameter costCenter + - Interface BillingSubscription no longer has parameter subscriptionBillingStatus + - Interface Customer no longer has parameter billingProfileDisplayName + - Interface Customer no longer has parameter billingProfileId + - Interface Customer no longer has parameter displayName + - Interface Customer no longer has parameter enabledAzurePlans + - Interface Customer no longer has parameter resellers + - Interface CustomerListResult no longer has parameter totalCount + - Interface CustomerPolicy no longer has parameter viewCharges + - Interface CustomersGetOptionalParams no longer has parameter expand + - Interface CustomersListByBillingAccountNextOptionalParams no longer has parameter filter + - Interface CustomersListByBillingAccountNextOptionalParams no longer has parameter search + - Interface CustomersListByBillingProfileNextOptionalParams no longer has parameter filter + - Interface CustomersListByBillingProfileNextOptionalParams no longer has parameter search + - Interface Department no longer has parameter costCenter + - Interface Department no longer has parameter departmentName + - Interface Department no longer has parameter enrollmentAccounts + - Interface Department no longer has parameter status + - Interface EnrollmentAccount no longer has parameter accountName + - Interface EnrollmentAccount no longer has parameter accountOwner + - Interface EnrollmentAccount no longer has parameter accountOwnerEmail + - Interface EnrollmentAccount no longer has parameter costCenter + - Interface EnrollmentAccount no longer has parameter department + - Interface EnrollmentAccount no longer has parameter endDate + - Interface EnrollmentAccount no longer has parameter startDate + - Interface EnrollmentAccount no longer has parameter status + - Interface Invoice no longer has parameter amountDue + - Interface Invoice no longer has parameter azurePrepaymentApplied + - Interface Invoice no longer has parameter billedAmount + - Interface Invoice no longer has parameter billedDocumentId + - Interface Invoice no longer has parameter billingProfileDisplayName + - Interface Invoice no longer has parameter billingProfileId + - Interface Invoice no longer has parameter creditAmount + - Interface Invoice no longer has parameter creditForDocumentId + - Interface Invoice no longer has parameter documents + - Interface Invoice no longer has parameter documentType + - Interface Invoice no longer has parameter dueDate + - Interface Invoice no longer has parameter freeAzureCreditApplied + - Interface Invoice no longer has parameter invoiceDate + - Interface Invoice no longer has parameter invoicePeriodEndDate + - Interface Invoice no longer has parameter invoicePeriodStartDate + - Interface Invoice no longer has parameter invoiceType + - Interface Invoice no longer has parameter isMonthlyInvoice + - Interface Invoice no longer has parameter payments + - Interface Invoice no longer has parameter purchaseOrderNumber + - Interface Invoice no longer has parameter rebillDetails + - Interface Invoice no longer has parameter status + - Interface Invoice no longer has parameter subscriptionId + - Interface Invoice no longer has parameter subTotal + - Interface Invoice no longer has parameter taxAmount + - Interface Invoice no longer has parameter totalAmount + - Interface InvoiceListResult no longer has parameter totalCount + - Interface InvoiceSection no longer has parameter displayName + - Interface InvoiceSection no longer has parameter labels + - Interface InvoiceSection no longer has parameter state + - Interface InvoiceSection no longer has parameter systemId + - Interface InvoiceSection no longer has parameter targetCloud + - Interface InvoiceSectionListResult no longer has parameter totalCount + - Interface Product no longer has parameter autoRenew + - Interface Product no longer has parameter availabilityId + - Interface Product no longer has parameter billingFrequency + - Interface Product no longer has parameter billingProfileDisplayName + - Interface Product no longer has parameter billingProfileId + - Interface Product no longer has parameter customerDisplayName + - Interface Product no longer has parameter customerId + - Interface Product no longer has parameter displayName + - Interface Product no longer has parameter endDate + - Interface Product no longer has parameter invoiceSectionDisplayName + - Interface Product no longer has parameter invoiceSectionId + - Interface Product no longer has parameter lastCharge + - Interface Product no longer has parameter lastChargeDate + - Interface Product no longer has parameter productType + - Interface Product no longer has parameter productTypeId + - Interface Product no longer has parameter purchaseDate + - Interface Product no longer has parameter quantity + - Interface Product no longer has parameter reseller + - Interface Product no longer has parameter skuDescription + - Interface Product no longer has parameter skuId + - Interface Product no longer has parameter status + - Interface Product no longer has parameter tenantId + - Interface ProductsListByBillingAccountNextOptionalParams no longer has parameter filter + - Interface ProductsListByBillingProfileNextOptionalParams no longer has parameter filter + - Interface ProductsListByInvoiceSectionNextOptionalParams no longer has parameter filter + - Interface Reservation no longer has parameter id + - Interface Reservation no longer has parameter name + - Interface Reservation no longer has parameter type + - Interface Reservation no longer has parameter utilization + - Interface ReservationsListByBillingAccountNextOptionalParams no longer has parameter filter + - Interface ReservationsListByBillingAccountNextOptionalParams no longer has parameter orderby + - Interface ReservationsListByBillingAccountNextOptionalParams no longer has parameter refreshSummary + - Interface ReservationsListByBillingAccountNextOptionalParams no longer has parameter selectedState + - Interface ReservationsListByBillingAccountOptionalParams no longer has parameter orderby + - Interface ReservationsListByBillingProfileNextOptionalParams no longer has parameter filter + - Interface ReservationsListByBillingProfileNextOptionalParams no longer has parameter orderby + - Interface ReservationsListByBillingProfileNextOptionalParams no longer has parameter refreshSummary + - Interface ReservationsListByBillingProfileNextOptionalParams no longer has parameter selectedState + - Interface ReservationsListByBillingProfileOptionalParams no longer has parameter orderby + - Interface Transaction no longer has parameter azureCreditApplied + - Interface Transaction no longer has parameter azurePlan + - Interface Transaction no longer has parameter billingCurrency + - Interface Transaction no longer has parameter billingProfileDisplayName + - Interface Transaction no longer has parameter billingProfileId + - Interface Transaction no longer has parameter customerDisplayName + - Interface Transaction no longer has parameter customerId + - Interface Transaction no longer has parameter date + - Interface Transaction no longer has parameter discount + - Interface Transaction no longer has parameter effectivePrice + - Interface Transaction no longer has parameter exchangeRate + - Interface Transaction no longer has parameter invoice + - Interface Transaction no longer has parameter invoiceId + - Interface Transaction no longer has parameter invoiceSectionDisplayName + - Interface Transaction no longer has parameter invoiceSectionId + - Interface Transaction no longer has parameter kind + - Interface Transaction no longer has parameter marketPrice + - Interface Transaction no longer has parameter orderId + - Interface Transaction no longer has parameter orderName + - Interface Transaction no longer has parameter pricingCurrency + - Interface Transaction no longer has parameter productDescription + - Interface Transaction no longer has parameter productFamily + - Interface Transaction no longer has parameter productType + - Interface Transaction no longer has parameter productTypeId + - Interface Transaction no longer has parameter quantity + - Interface Transaction no longer has parameter servicePeriodEndDate + - Interface Transaction no longer has parameter servicePeriodStartDate + - Interface Transaction no longer has parameter subscriptionId + - Interface Transaction no longer has parameter subscriptionName + - Interface Transaction no longer has parameter subTotal + - Interface Transaction no longer has parameter tax + - Interface Transaction no longer has parameter transactionAmount + - Interface Transaction no longer has parameter transactionType + - Interface Transaction no longer has parameter unitOfMeasure + - Interface Transaction no longer has parameter units + - Interface Transaction no longer has parameter unitType + - Interface TransactionListResult no longer has parameter totalCount + - Type of parameter value of interface EnrollmentAccountListResult is changed from EnrollmentAccountSummary[] to EnrollmentAccount[] + - Type of parameter error of interface ErrorResponse is changed from ErrorDetails to ErrorDetail + - Type of parameter billingProfileSpendingLimit of interface InvoiceSectionWithCreateSubPermission is changed from SpendingLimitForBillingProfile to SpendingLimit + - Type of parameter billingProfileStatusReasonCode of interface InvoiceSectionWithCreateSubPermission is changed from StatusReasonCodeForBillingProfile to BillingProfileStatusReasonCode + - Type of parameter rebillDetails of interface RebillDetails is changed from { + [propertyName: string]: RebillDetails; + } to RebillDetails + - Type of parameter effectiveDateTime of interface Reservation is changed from string to Date + - Class BillingManagementClient no longer has parameter billingPeriods + - Class BillingManagementClient no longer has parameter billingRoleDefinitions + - Class BillingManagementClient no longer has parameter instructions + - Removed Enum KnownBillingFrequency + - Removed Enum KnownBillingProfileSpendingLimit + - Removed Enum KnownBillingSubscriptionStatusType + - Removed Enum KnownDocumentType + - Removed Enum KnownProductStatusType + - Removed Enum KnownProductTransferValidationErrorCode + - Removed Enum KnownReservationType + - Removed Enum KnownSpendingLimitForBillingProfile + - Removed Enum KnownStatusReasonCode + - Removed Enum KnownStatusReasonCodeForBillingProfile + - Removed Enum KnownTargetCloud + - Removed Enum KnownTransactionTypeKind + - Removed Enum KnownViewCharges + - Enum KnownInvoiceType no longer has value AzureService + - Enum KnownSubscriptionTransferValidationErrorCode no longer has value NotAvailableForDestinationMarket + + ## 4.1.0 (2022-11-16) -**Features** +### Features Added - Added Interface Agreement - Added Interface AvailableBalance @@ -47,4 +1417,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/billing/arm-billing/LICENSE b/sdk/billing/arm-billing/LICENSE index 5d1d36e0af80..7d5934740965 100644 --- a/sdk/billing/arm-billing/LICENSE +++ b/sdk/billing/arm-billing/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2024 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/billing/arm-billing/README.md b/sdk/billing/arm-billing/README.md index 55e805859e00..3f788cbebc4f 100644 --- a/sdk/billing/arm-billing/README.md +++ b/sdk/billing/arm-billing/README.md @@ -2,7 +2,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure BillingManagement client. -Billing client provides access to billing resources for Azure subscriptions. +Billing Client [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) | diff --git a/sdk/billing/arm-billing/_meta.json b/sdk/billing/arm-billing/_meta.json index 34c9ae4279a2..82f340e50083 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.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\billing\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "commit": "f958cceb74699d24953a6ea04536ed65767fbeb6", + "readme": "specification/billing/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\billing\\resource-manager\\readme.md --use=@autorest/typescript@6.0.26 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "js-sdk-release-tools@2.7.21-beta", + "use": "@autorest/typescript@6.0.26" } \ No newline at end of file diff --git a/sdk/billing/arm-billing/assets.json b/sdk/billing/arm-billing/assets.json index af5d569a7708..1482d598a8dd 100644 --- a/sdk/billing/arm-billing/assets.json +++ b/sdk/billing/arm-billing/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/billing/arm-billing", - "Tag": "js/billing/arm-billing_1a048e9efe" + "Tag": "js/billing/arm-billing_f0861b8724" } diff --git a/sdk/billing/arm-billing/package.json b/sdk/billing/arm-billing/package.json index 9ddb5d69a044..59443722ad23 100644 --- a/sdk/billing/arm-billing/package.json +++ b/sdk/billing/arm-billing/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for BillingManagementClient.", - "version": "4.1.1", + "version": "5.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", - "@azure/abort-controller": "^1.0.0", + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -33,19 +33,20 @@ "typescript": "~5.5.3", "uglify-js": "^3.4.9", "rimraf": "^5.0.5", - "@azure/identity": "^4.0.1", + "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^4.2.1", "@azure-tools/test-recorder": "^3.0.0", - "@azure-tools/test-credential": "^1.0.0", + "@azure-tools/test-credential": "^1.1.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "tsx": "^4.7.1", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0", - "@types/mocha": "^10.0.0" + "ts-node": "^10.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billing/arm-billing", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -77,7 +78,6 @@ "pack": "npm pack 2>&1", "extract-api": "dev-tool run extract-api", "lint": "echo skipped", - "audit": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", @@ -106,6 +106,7 @@ ] }, "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billing/arm-billing", "//sampleConfiguration": { "productName": "", "productSlugs": [ diff --git a/sdk/billing/arm-billing/review/arm-billing.api.md b/sdk/billing/arm-billing/review/arm-billing.api.md index b55d7775d90b..4e7df3a2ad7e 100644 --- a/sdk/billing/arm-billing/review/arm-billing.api.md +++ b/sdk/billing/arm-billing/review/arm-billing.api.md @@ -6,22 +6,33 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public export type AcceptanceMode = string; +// @public +export interface AcceptTransferRequest { + productDetails?: ProductDetails[]; +} + +// @public +export type AccessDecision = string; + // @public export type AccountStatus = string; +// @public +export type AccountSubType = string; + // @public export type AccountType = string; // @public export interface Address { - validate(address: AddressDetails, options?: AddressValidateOptionalParams): Promise; + validate(parameters: AddressDetails, options?: AddressValidateOptionalParams): Promise; } // @public @@ -35,6 +46,7 @@ export interface AddressDetails { district?: string; email?: string; firstName?: string; + isValidAddress?: boolean; lastName?: string; middleName?: string; phoneNumber?: string; @@ -47,20 +59,21 @@ export interface AddressValidateOptionalParams extends coreClient.OperationOptio } // @public -export type AddressValidateResponse = ValidateAddressResponse; +export type AddressValidateResponse = AddressValidationResponse; + +// @public +export interface AddressValidationResponse { + readonly status?: AddressValidationStatus; + readonly suggestedAddresses?: AddressDetails[]; + readonly validationMessage?: string; +} // @public export type AddressValidationStatus = string; // @public -export interface Agreement extends Resource { - readonly acceptanceMode?: AcceptanceMode; - readonly agreementLink?: string; - readonly category?: Category; - readonly effectiveDate?: Date; - readonly expirationDate?: Date; - participants?: Participants[]; - readonly status?: string; +export interface Agreement extends ProxyResourceWithTags { + properties?: AgreementProperties; } // @public @@ -69,6 +82,20 @@ export interface AgreementListResult { readonly value?: Agreement[]; } +// @public +export interface AgreementProperties { + readonly acceptanceMode?: AcceptanceMode; + readonly agreementLink?: string; + readonly billingProfileInfo?: BillingProfileInfo[]; + readonly category?: Category; + readonly displayName?: string; + readonly effectiveDate?: Date; + readonly expirationDate?: Date; + readonly leadBillingAccountName?: string; + readonly participants?: Participant[]; + readonly status?: string; +} + // @public export interface Agreements { get(billingAccountName: string, agreementName: string, options?: AgreementsGetOptionalParams): Promise; @@ -77,7 +104,6 @@ export interface Agreements { // @public export interface AgreementsGetOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -85,7 +111,6 @@ export type AgreementsGetResponse = Agreement; // @public export interface AgreementsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -105,68 +130,296 @@ export type AgreementType = string; // @public export interface Amount { readonly currency?: string; - value?: number; + readonly value?: number; +} + +// @public +export interface AppliedScopeProperties { + displayName?: string; + managementGroupId?: string; + resourceGroupId?: string; + subscriptionId?: string; + tenantId?: string; +} + +// @public +export type AppliedScopeType = string; + +// @public +export interface AssociatedTenant extends ProxyResourceWithTags { + properties?: AssociatedTenantProperties; +} + +// @public +export interface AssociatedTenantListResult { + readonly nextLink?: string; + readonly value?: AssociatedTenant[]; +} + +// @public +export interface AssociatedTenantProperties { + billingManagementState?: BillingManagementTenantState; + displayName?: string; + readonly provisioningBillingRequestId?: string; + provisioningManagementState?: ProvisioningTenantState; + readonly provisioningState?: ProvisioningState; + tenantId?: string; +} + +// @public +export interface AssociatedTenants { + beginCreateOrUpdate(billingAccountName: string, associatedTenantName: string, parameters: AssociatedTenant, options?: AssociatedTenantsCreateOrUpdateOptionalParams): Promise, AssociatedTenantsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(billingAccountName: string, associatedTenantName: string, parameters: AssociatedTenant, options?: AssociatedTenantsCreateOrUpdateOptionalParams): Promise; + beginDelete(billingAccountName: string, associatedTenantName: string, options?: AssociatedTenantsDeleteOptionalParams): Promise, AssociatedTenantsDeleteResponse>>; + beginDeleteAndWait(billingAccountName: string, associatedTenantName: string, options?: AssociatedTenantsDeleteOptionalParams): Promise; + get(billingAccountName: string, associatedTenantName: string, options?: AssociatedTenantsGetOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: AssociatedTenantsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AssociatedTenantsCreateOrUpdateHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface AssociatedTenantsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AssociatedTenantsCreateOrUpdateResponse = AssociatedTenant; + +// @public +export interface AssociatedTenantsDeleteHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface AssociatedTenantsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AssociatedTenantsDeleteResponse = AssociatedTenantsDeleteHeaders; + +// @public +export interface AssociatedTenantsGetOptionalParams extends coreClient.OperationOptions { } +// @public +export type AssociatedTenantsGetResponse = AssociatedTenant; + +// @public +export interface AssociatedTenantsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AssociatedTenantsListByBillingAccountNextResponse = AssociatedTenantListResult; + +// @public +export interface AssociatedTenantsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + includeRevoked?: boolean; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type AssociatedTenantsListByBillingAccountResponse = AssociatedTenantListResult; + // @public export type AutoRenew = string; // @public -export interface AvailableBalance extends Resource { - readonly amount?: Amount; +export interface AvailableBalance extends ProxyResourceWithTags { + properties?: AvailableBalanceProperties; +} + +// @public +export interface AvailableBalanceProperties { + amount?: AvailableBalancePropertiesAmount; + readonly paymentsOnAccount?: PaymentOnAccount[]; + totalPaymentsOnAccount?: AvailableBalancePropertiesTotalPaymentsOnAccount; +} + +// @public +export interface AvailableBalancePropertiesAmount extends Amount { +} + +// @public +export interface AvailableBalancePropertiesTotalPaymentsOnAccount extends Amount { } // @public export interface AvailableBalances { - get(billingAccountName: string, billingProfileName: string, options?: AvailableBalancesGetOptionalParams): Promise; + getByBillingAccount(billingAccountName: string, options?: AvailableBalancesGetByBillingAccountOptionalParams): Promise; + getByBillingProfile(billingAccountName: string, billingProfileName: string, options?: AvailableBalancesGetByBillingProfileOptionalParams): Promise; } // @public -export interface AvailableBalancesGetOptionalParams extends coreClient.OperationOptions { +export interface AvailableBalancesGetByBillingAccountOptionalParams extends coreClient.OperationOptions { } // @public -export type AvailableBalancesGetResponse = AvailableBalance; +export type AvailableBalancesGetByBillingAccountResponse = AvailableBalance; + +// @public +export interface AvailableBalancesGetByBillingProfileOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AvailableBalancesGetByBillingProfileResponse = AvailableBalance; // @public export interface AzurePlan { - readonly skuDescription?: string; + productId?: string; + skuDescription?: string; skuId?: string; } // @public -export interface BillingAccount extends Resource { +export interface Beneficiary { + objectId?: string; + tenantId?: string; +} + +// @public +export interface BillingAccount extends ProxyResourceWithTags { + properties?: BillingAccountProperties; +} + +// @public +export interface BillingAccountListResult { + readonly nextLink?: string; + readonly value?: BillingAccount[]; +} + +// @public +export interface BillingAccountPatch extends ProxyResourceWithTags { + properties?: BillingAccountProperties; +} + +// @public +export interface BillingAccountPolicy extends ProxyResourceWithTags { + properties?: BillingAccountPolicyProperties; +} + +// @public +export interface BillingAccountPolicyProperties { + enterpriseAgreementPolicies?: BillingAccountPolicyPropertiesEnterpriseAgreementPolicies; + marketplacePurchases?: MarketplacePurchasesPolicy; + policies?: PolicySummary[]; + readonly provisioningState?: ProvisioningState; + reservationPurchases?: ReservationPurchasesPolicy; + savingsPlanPurchases?: SavingsPlanPurchasesPolicy; +} + +// @public +export interface BillingAccountPolicyPropertiesEnterpriseAgreementPolicies extends EnterpriseAgreementPolicies { +} + +// @public +export interface BillingAccountProperties { readonly accountStatus?: AccountStatus; + readonly accountStatusReasonCode?: BillingAccountStatusReasonCode; + readonly accountSubType?: AccountSubType; readonly accountType?: AccountType; readonly agreementType?: AgreementType; - billingProfiles?: BillingProfilesOnExpand; - departments?: Department[]; + readonly billingRelationshipTypes?: BillingRelationshipType[]; displayName?: string; - enrollmentAccounts?: EnrollmentAccount[]; - readonly enrollmentDetails?: Enrollment; - readonly hasReadAccess?: boolean; + enrollmentDetails?: BillingAccountPropertiesEnrollmentDetails; + hasNoBillingProfiles?: boolean; + hasReadAccess?: boolean; notificationEmailAddress?: string; - soldTo?: AddressDetails; + primaryBillingTenantId?: string; + readonly provisioningState?: ProvisioningState; + readonly qualifications?: string[]; + registrationNumber?: BillingAccountPropertiesRegistrationNumber; + soldTo?: BillingAccountPropertiesSoldTo; + taxIds?: TaxIdentifier[]; } // @public -export interface BillingAccountListResult { - readonly nextLink?: string; - readonly value?: BillingAccount[]; +export interface BillingAccountPropertiesEnrollmentDetails extends EnrollmentDetails { +} + +// @public +export interface BillingAccountPropertiesRegistrationNumber extends RegistrationNumber { +} + +// @public +export interface BillingAccountPropertiesSoldTo extends AddressDetails { } // @public export interface BillingAccounts { - beginUpdate(billingAccountName: string, parameters: BillingAccountUpdateRequest, options?: BillingAccountsUpdateOptionalParams): Promise, BillingAccountsUpdateResponse>>; - beginUpdateAndWait(billingAccountName: string, parameters: BillingAccountUpdateRequest, options?: BillingAccountsUpdateOptionalParams): Promise; + beginAddPaymentTerms(billingAccountName: string, parameters: PaymentTerm[], options?: BillingAccountsAddPaymentTermsOptionalParams): Promise, BillingAccountsAddPaymentTermsResponse>>; + beginAddPaymentTermsAndWait(billingAccountName: string, parameters: PaymentTerm[], options?: BillingAccountsAddPaymentTermsOptionalParams): Promise; + beginCancelPaymentTerms(billingAccountName: string, parameters: Date, options?: BillingAccountsCancelPaymentTermsOptionalParams): Promise, BillingAccountsCancelPaymentTermsResponse>>; + beginCancelPaymentTermsAndWait(billingAccountName: string, parameters: Date, options?: BillingAccountsCancelPaymentTermsOptionalParams): Promise; + beginUpdate(billingAccountName: string, parameters: BillingAccountPatch, options?: BillingAccountsUpdateOptionalParams): Promise, BillingAccountsUpdateResponse>>; + beginUpdateAndWait(billingAccountName: string, parameters: BillingAccountPatch, options?: BillingAccountsUpdateOptionalParams): Promise; + confirmTransition(billingAccountName: string, options?: BillingAccountsConfirmTransitionOptionalParams): Promise; get(billingAccountName: string, options?: BillingAccountsGetOptionalParams): Promise; list(options?: BillingAccountsListOptionalParams): PagedAsyncIterableIterator; listInvoiceSectionsByCreateSubscriptionPermission(billingAccountName: string, options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams): PagedAsyncIterableIterator; + validatePaymentTerms(billingAccountName: string, parameters: PaymentTerm[], options?: BillingAccountsValidatePaymentTermsOptionalParams): Promise; +} + +// @public +export interface BillingAccountsAddPaymentTermsHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface BillingAccountsAddPaymentTermsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BillingAccountsAddPaymentTermsResponse = BillingAccount; + +// @public +export interface BillingAccountsCancelPaymentTermsHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface BillingAccountsCancelPaymentTermsOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BillingAccountsCancelPaymentTermsResponse = BillingAccount; + +// @public +export interface BillingAccountsConfirmTransitionOptionalParams extends coreClient.OperationOptions { } +// @public +export type BillingAccountsConfirmTransitionResponse = TransitionDetails; + // @public export interface BillingAccountsGetOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -177,18 +430,18 @@ export interface BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissio } // @public -export type BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextResponse = InvoiceSectionListWithCreateSubPermissionResult; +export type BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextResponse = InvoiceSectionWithCreateSubPermissionListResult; // @public export interface BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export type BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionResponse = InvoiceSectionListWithCreateSubPermissionResult; +export type BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionResponse = InvoiceSectionWithCreateSubPermissionListResult; // @public export interface BillingAccountsListNextOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -197,11 +450,33 @@ export type BillingAccountsListNextResponse = BillingAccountListResult; // @public export interface BillingAccountsListOptionalParams extends coreClient.OperationOptions { expand?: string; + filter?: string; + includeAll?: boolean; + includeAllWithoutBillingProfiles?: boolean; + includeDeleted?: boolean; + includePendingAgreement?: boolean; + includeResellee?: boolean; + legalOwnerOID?: string; + legalOwnerTID?: string; + search?: string; + skip?: number; + top?: number; } // @public export type BillingAccountsListResponse = BillingAccountListResult; +// @public +export type BillingAccountStatusReasonCode = string; + +// @public +export interface BillingAccountsUpdateHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + // @public export interface BillingAccountsUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -212,56 +487,52 @@ export interface BillingAccountsUpdateOptionalParams extends coreClient.Operatio export type BillingAccountsUpdateResponse = BillingAccount; // @public -export interface BillingAccountUpdateRequest { - readonly accountStatus?: AccountStatus; - readonly accountType?: AccountType; - readonly agreementType?: AgreementType; - billingProfiles?: BillingProfilesOnExpand; - departments?: Department[]; - displayName?: string; - enrollmentAccounts?: EnrollmentAccount[]; - readonly enrollmentDetails?: Enrollment; - readonly hasReadAccess?: boolean; - notificationEmailAddress?: string; - soldTo?: AddressDetails; +export interface BillingAccountsValidatePaymentTermsOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingFrequency = string; +export type BillingAccountsValidatePaymentTermsResponse = PaymentTermsEligibilityResult; // @public (undocumented) export class BillingManagementClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: BillingManagementClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: BillingManagementClientOptionalParams); // (undocumented) address: Address; // (undocumented) agreements: Agreements; // (undocumented) + apiVersion: string; + // (undocumented) + associatedTenants: AssociatedTenants; + // (undocumented) availableBalances: AvailableBalances; // (undocumented) billingAccounts: BillingAccounts; // (undocumented) - billingPeriods: BillingPeriods; - // (undocumented) billingPermissions: BillingPermissions; // (undocumented) billingProfiles: BillingProfiles; // (undocumented) billingPropertyOperations: BillingPropertyOperations; // (undocumented) + billingRequests: BillingRequests; + // (undocumented) billingRoleAssignments: BillingRoleAssignments; // (undocumented) - billingRoleDefinitions: BillingRoleDefinitions; + billingRoleDefinitionOperations: BillingRoleDefinitionOperations; // (undocumented) billingSubscriptions: BillingSubscriptions; // (undocumented) + billingSubscriptionsAliases: BillingSubscriptionsAliases; + // (undocumented) customers: Customers; // (undocumented) - enrollmentAccounts: EnrollmentAccounts; + departments: Departments; // (undocumented) - instructions: Instructions; + enrollmentAccounts: EnrollmentAccounts; // (undocumented) invoices: Invoices; // (undocumented) @@ -269,194 +540,328 @@ export class BillingManagementClient extends coreClient.ServiceClient { // (undocumented) operations: Operations; // (undocumented) + partnerTransfers: PartnerTransfers; + // (undocumented) + paymentMethods: PaymentMethods; + // (undocumented) policies: Policies; // (undocumented) products: Products; // (undocumented) + recipientTransfers: RecipientTransfers; + // (undocumented) + reservationOrders: ReservationOrders; + // (undocumented) reservations: Reservations; // (undocumented) - subscriptionId: string; + savingsPlanOrders: SavingsPlanOrders; + // (undocumented) + savingsPlans: SavingsPlans; + // (undocumented) + subscriptionId?: string; // (undocumented) transactions: Transactions; + // (undocumented) + transfers: Transfers; } // @public export interface BillingManagementClientOptionalParams extends coreClient.ServiceClientOptions { $host?: string; + apiVersion?: string; endpoint?: string; } // @public -export interface BillingPeriod extends Resource { - readonly billingPeriodEndDate?: Date; - readonly billingPeriodStartDate?: Date; - readonly invoiceIds?: string[]; +export type BillingManagementTenantState = string; + +// @public +export interface BillingPermission { + readonly actions?: string[]; + readonly notActions?: string[]; } // @public -export interface BillingPeriods { - get(billingPeriodName: string, options?: BillingPeriodsGetOptionalParams): Promise; - list(options?: BillingPeriodsListOptionalParams): PagedAsyncIterableIterator; +export interface BillingPermissionListResult { + readonly nextLink?: string; + readonly value?: BillingPermission[]; } // @public -export interface BillingPeriodsGetOptionalParams extends coreClient.OperationOptions { +export interface BillingPermissions { + checkAccessByBillingAccount(billingAccountName: string, parameters: CheckAccessRequest, options?: BillingPermissionsCheckAccessByBillingAccountOptionalParams): Promise; + checkAccessByBillingProfile(billingAccountName: string, billingProfileName: string, parameters: CheckAccessRequest, options?: BillingPermissionsCheckAccessByBillingProfileOptionalParams): Promise; + checkAccessByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, parameters: CheckAccessRequest, options?: BillingPermissionsCheckAccessByCustomerOptionalParams): Promise; + checkAccessByDepartment(billingAccountName: string, departmentName: string, parameters: CheckAccessRequest, options?: BillingPermissionsCheckAccessByDepartmentOptionalParams): Promise; + checkAccessByEnrollmentAccount(billingAccountName: string, enrollmentAccountName: string, parameters: CheckAccessRequest, options?: BillingPermissionsCheckAccessByEnrollmentAccountOptionalParams): Promise; + checkAccessByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, parameters: CheckAccessRequest, options?: BillingPermissionsCheckAccessByInvoiceSectionOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: BillingPermissionsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingPermissionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, options?: BillingPermissionsListByCustomerOptionalParams): PagedAsyncIterableIterator; + listByCustomerAtBillingAccount(billingAccountName: string, customerName: string, options?: BillingPermissionsListByCustomerAtBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByDepartment(billingAccountName: string, departmentName: string, options?: BillingPermissionsListByDepartmentOptionalParams): PagedAsyncIterableIterator; + listByEnrollmentAccount(billingAccountName: string, enrollmentAccountName: string, options?: BillingPermissionsListByEnrollmentAccountOptionalParams): PagedAsyncIterableIterator; + listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingPermissionsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; } // @public -export type BillingPeriodsGetResponse = BillingPeriod; +export interface BillingPermissionsCheckAccessByBillingAccountOptionalParams extends coreClient.OperationOptions { +} // @public -export interface BillingPeriodsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - skiptoken?: string; - top?: number; +export type BillingPermissionsCheckAccessByBillingAccountResponse = CheckAccessResponse[]; + +// @public +export interface BillingPermissionsCheckAccessByBillingProfileOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPeriodsListNextResponse = BillingPeriodsListResult; +export type BillingPermissionsCheckAccessByBillingProfileResponse = CheckAccessResponse[]; // @public -export interface BillingPeriodsListOptionalParams extends coreClient.OperationOptions { - filter?: string; - skiptoken?: string; - top?: number; +export interface BillingPermissionsCheckAccessByCustomerOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPeriodsListResponse = BillingPeriodsListResult; +export type BillingPermissionsCheckAccessByCustomerResponse = CheckAccessResponse[]; // @public -export interface BillingPeriodsListResult { - readonly nextLink?: string; - readonly value?: BillingPeriod[]; +export interface BillingPermissionsCheckAccessByDepartmentOptionalParams extends coreClient.OperationOptions { } // @public -export interface BillingPermissions { - listByBillingAccount(billingAccountName: string, options?: BillingPermissionsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; - listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingPermissionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; - listByCustomer(billingAccountName: string, customerName: string, options?: BillingPermissionsListByCustomerOptionalParams): PagedAsyncIterableIterator; - listByInvoiceSections(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingPermissionsListByInvoiceSectionsOptionalParams): PagedAsyncIterableIterator; +export type BillingPermissionsCheckAccessByDepartmentResponse = CheckAccessResponse[]; + +// @public +export interface BillingPermissionsCheckAccessByEnrollmentAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingPermissionsCheckAccessByEnrollmentAccountResponse = CheckAccessResponse[]; + +// @public +export interface BillingPermissionsCheckAccessByInvoiceSectionOptionalParams extends coreClient.OperationOptions { } +// @public +export type BillingPermissionsCheckAccessByInvoiceSectionResponse = CheckAccessResponse[]; + // @public export interface BillingPermissionsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPermissionsListByBillingAccountNextResponse = BillingPermissionsListResult; +export type BillingPermissionsListByBillingAccountNextResponse = BillingPermissionListResult; // @public export interface BillingPermissionsListByBillingAccountOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPermissionsListByBillingAccountResponse = BillingPermissionsListResult; +export type BillingPermissionsListByBillingAccountResponse = BillingPermissionListResult; // @public export interface BillingPermissionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPermissionsListByBillingProfileNextResponse = BillingPermissionsListResult; +export type BillingPermissionsListByBillingProfileNextResponse = BillingPermissionListResult; // @public export interface BillingPermissionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPermissionsListByBillingProfileResponse = BillingPermissionsListResult; +export type BillingPermissionsListByBillingProfileResponse = BillingPermissionListResult; + +// @public +export interface BillingPermissionsListByCustomerAtBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingPermissionsListByCustomerAtBillingAccountNextResponse = BillingPermissionListResult; + +// @public +export interface BillingPermissionsListByCustomerAtBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingPermissionsListByCustomerAtBillingAccountResponse = BillingPermissionListResult; // @public export interface BillingPermissionsListByCustomerNextOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPermissionsListByCustomerNextResponse = BillingPermissionsListResult; +export type BillingPermissionsListByCustomerNextResponse = BillingPermissionListResult; // @public export interface BillingPermissionsListByCustomerOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPermissionsListByCustomerResponse = BillingPermissionsListResult; +export type BillingPermissionsListByCustomerResponse = BillingPermissionListResult; // @public -export interface BillingPermissionsListByInvoiceSectionsNextOptionalParams extends coreClient.OperationOptions { +export interface BillingPermissionsListByDepartmentNextOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPermissionsListByInvoiceSectionsNextResponse = BillingPermissionsListResult; +export type BillingPermissionsListByDepartmentNextResponse = BillingPermissionListResult; // @public -export interface BillingPermissionsListByInvoiceSectionsOptionalParams extends coreClient.OperationOptions { +export interface BillingPermissionsListByDepartmentOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingPermissionsListByInvoiceSectionsResponse = BillingPermissionsListResult; +export type BillingPermissionsListByDepartmentResponse = BillingPermissionListResult; // @public -export interface BillingPermissionsListResult { - readonly nextLink?: string; - readonly value?: BillingPermissionsProperties[]; +export interface BillingPermissionsListByEnrollmentAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface BillingPermissionsProperties { - readonly actions?: string[]; - readonly notActions?: string[]; +export type BillingPermissionsListByEnrollmentAccountNextResponse = BillingPermissionListResult; + +// @public +export interface BillingPermissionsListByEnrollmentAccountOptionalParams extends coreClient.OperationOptions { } // @public -export interface BillingProfile extends Resource { - readonly billingRelationshipType?: BillingRelationshipType; - billTo?: AddressDetails; - readonly currency?: string; - displayName?: string; +export type BillingPermissionsListByEnrollmentAccountResponse = BillingPermissionListResult; + +// @public +export interface BillingPermissionsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingPermissionsListByInvoiceSectionNextResponse = BillingPermissionListResult; + +// @public +export interface BillingPermissionsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingPermissionsListByInvoiceSectionResponse = BillingPermissionListResult; + +// @public +export type BillingPlan = string; + +// @public +export interface BillingPlanInformation { + nextPaymentDueDate?: Date; + pricingCurrencyTotal?: Price; + startDate?: Date; + // (undocumented) + transactions?: PaymentDetail[]; +} + +// @public +export interface BillingProfile extends ProxyResourceWithTags { + properties?: BillingProfileProperties; +} + +// @public +export interface BillingProfileInfo { + billingAccountId?: string; + billingProfileDisplayName?: string; + billingProfileId?: string; + billingProfileSystemId?: string; + indirectRelationshipOrganizationName?: string; +} + +// @public +export interface BillingProfileListResult { + readonly nextLink?: string; + readonly value?: BillingProfile[]; +} + +// @public +export interface BillingProfilePolicy extends ProxyResourceWithTags { + properties?: BillingProfilePolicyProperties; +} + +// @public +export interface BillingProfilePolicyProperties { + enterpriseAgreementPolicies?: BillingProfilePolicyPropertiesEnterpriseAgreementPolicies; + invoiceSectionLabelManagement?: InvoiceSectionLabelManagementPolicy; + marketplacePurchases?: MarketplacePurchasesPolicy; + policies?: PolicySummary[]; + readonly provisioningState?: ProvisioningState; + reservationPurchases?: ReservationPurchasesPolicy; + savingsPlanPurchases?: SavingsPlanPurchasesPolicy; + viewCharges?: ViewChargesPolicy; +} + +// @public +export interface BillingProfilePolicyPropertiesEnterpriseAgreementPolicies extends EnterpriseAgreementPolicies { +} + +// @public +export interface BillingProfileProperties { + readonly billingRelationshipType?: BillingRelationshipType; + billTo?: BillingProfilePropertiesBillTo; + readonly currency?: string; + currentPaymentTerm?: BillingProfilePropertiesCurrentPaymentTerm; + displayName?: string; enabledAzurePlans?: AzurePlan[]; readonly hasReadAccess?: boolean; - readonly indirectRelationshipInfo?: IndirectRelationshipInfo; + indirectRelationshipInfo?: BillingProfilePropertiesIndirectRelationshipInfo; readonly invoiceDay?: number; invoiceEmailOptIn?: boolean; - invoiceSections?: InvoiceSectionsOnExpand; + invoiceRecipients?: string[]; + readonly otherPaymentTerms?: PaymentTerm[]; poNumber?: string; + readonly provisioningState?: ProvisioningState; + shipTo?: BillingProfilePropertiesShipTo; + soldTo?: BillingProfilePropertiesSoldTo; readonly spendingLimit?: SpendingLimit; + readonly spendingLimitDetails?: SpendingLimitDetails[]; readonly status?: BillingProfileStatus; - readonly statusReasonCode?: StatusReasonCode; + readonly statusReasonCode?: BillingProfileStatusReasonCode; readonly systemId?: string; tags?: { [propertyName: string]: string; }; - readonly targetClouds?: TargetCloud[]; + readonly targetClouds?: string[]; } // @public -export interface BillingProfileCreationRequest { - billTo?: AddressDetails; - displayName?: string; - enabledAzurePlans?: AzurePlan[]; - invoiceEmailOptIn?: boolean; - poNumber?: string; +export interface BillingProfilePropertiesBillTo extends AddressDetails { } // @public -export interface BillingProfileListResult { - readonly nextLink?: string; - readonly value?: BillingProfile[]; +export interface BillingProfilePropertiesCurrentPaymentTerm extends PaymentTerm { +} + +// @public +export interface BillingProfilePropertiesIndirectRelationshipInfo extends IndirectRelationshipInfo { +} + +// @public +export interface BillingProfilePropertiesShipTo extends AddressDetails { +} + +// @public +export interface BillingProfilePropertiesSoldTo extends AddressDetails { } // @public export interface BillingProfiles { - beginCreateOrUpdate(billingAccountName: string, billingProfileName: string, parameters: BillingProfile, options?: BillingProfilesCreateOrUpdateOptionalParams): Promise, BillingProfilesCreateOrUpdateResponse>>; + beginCreateOrUpdate(billingAccountName: string, billingProfileName: string, parameters: BillingProfile, options?: BillingProfilesCreateOrUpdateOptionalParams): Promise, BillingProfilesCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(billingAccountName: string, billingProfileName: string, parameters: BillingProfile, options?: BillingProfilesCreateOrUpdateOptionalParams): Promise; + beginDelete(billingAccountName: string, billingProfileName: string, options?: BillingProfilesDeleteOptionalParams): Promise, BillingProfilesDeleteResponse>>; + beginDeleteAndWait(billingAccountName: string, billingProfileName: string, options?: BillingProfilesDeleteOptionalParams): Promise; get(billingAccountName: string, billingProfileName: string, options?: BillingProfilesGetOptionalParams): Promise; listByBillingAccount(billingAccountName: string, options?: BillingProfilesListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + validateDeleteEligibility(billingAccountName: string, billingProfileName: string, options?: BillingProfilesValidateDeleteEligibilityOptionalParams): Promise; } // @public export interface BillingProfilesCreateOrUpdateHeaders { + // (undocumented) location?: string; + // (undocumented) retryAfter?: number; } @@ -469,9 +874,25 @@ export interface BillingProfilesCreateOrUpdateOptionalParams extends coreClient. // @public export type BillingProfilesCreateOrUpdateResponse = BillingProfile; +// @public +export interface BillingProfilesDeleteHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface BillingProfilesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BillingProfilesDeleteResponse = BillingProfilesDeleteHeaders; + // @public export interface BillingProfilesGetOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -479,7 +900,6 @@ export type BillingProfilesGetResponse = BillingProfile; // @public export interface BillingProfilesListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -487,59 +907,100 @@ export type BillingProfilesListByBillingAccountNextResponse = BillingProfileList // @public export interface BillingProfilesListByBillingAccountOptionalParams extends coreClient.OperationOptions { - expand?: string; + count?: boolean; + filter?: string; + includeDeleted?: boolean; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public export type BillingProfilesListByBillingAccountResponse = BillingProfileListResult; // @public -export interface BillingProfilesOnExpand { - readonly hasMoreResults?: boolean; - value?: BillingProfile[]; +export type BillingProfileStatus = string; + +// @public +export type BillingProfileStatusReasonCode = string; + +// @public +export interface BillingProfilesValidateDeleteEligibilityOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingProfileSpendingLimit = string; +export type BillingProfilesValidateDeleteEligibilityResponse = DeleteBillingProfileEligibilityResult; // @public -export type BillingProfileStatus = string; +export interface BillingProperty extends ProxyResourceWithTags { + properties?: BillingPropertyProperties; +} // @public -export type BillingProfileStatusReasonCode = string; +export interface BillingPropertyGetOptionalParams extends coreClient.OperationOptions { + includeBillingCountry?: boolean; + includeTransitionStatus?: boolean; +} + +// @public +export type BillingPropertyGetResponse = BillingProperty; + +// @public +export interface BillingPropertyOperations { + get(options?: BillingPropertyGetOptionalParams): Promise; + update(parameters: BillingProperty, options?: BillingPropertyUpdateOptionalParams): Promise; +} // @public -export interface BillingProperty extends Resource { +export interface BillingPropertyProperties { readonly accountAdminNotificationEmailAddress?: string; + readonly billingAccountAgreementType?: AgreementType; readonly billingAccountDisplayName?: string; readonly billingAccountId?: string; + readonly billingAccountSoldToCountry?: string; + readonly billingAccountStatus?: AccountStatus; + readonly billingAccountStatusReasonCode?: BillingAccountStatusReasonCode; + readonly billingAccountSubType?: AccountSubType; + readonly billingAccountType?: AccountType; + readonly billingCurrency?: string; readonly billingProfileDisplayName?: string; readonly billingProfileId?: string; - readonly billingProfileSpendingLimit?: BillingProfileSpendingLimit; + readonly billingProfilePaymentMethodFamily?: PaymentMethodFamily; + readonly billingProfilePaymentMethodType?: string; + readonly billingProfileSpendingLimit?: SpendingLimit; + readonly billingProfileSpendingLimitDetails?: SpendingLimitDetails[]; readonly billingProfileStatus?: BillingProfileStatus; readonly billingProfileStatusReasonCode?: BillingProfileStatusReasonCode; readonly billingTenantId?: string; costCenter?: string; + readonly customerDisplayName?: string; + readonly customerId?: string; + readonly customerStatus?: CustomerStatus; + enrollmentDetails?: BillingPropertyPropertiesEnrollmentDetails; readonly invoiceSectionDisplayName?: string; readonly invoiceSectionId?: string; + readonly invoiceSectionStatus?: InvoiceSectionState; + readonly invoiceSectionStatusReasonCode?: InvoiceSectionStateReasonCode; readonly isAccountAdmin?: boolean; + readonly isTransitionedBillingAccount?: boolean; readonly productId?: string; readonly productName?: string; readonly skuDescription?: string; readonly skuId?: string; + readonly subscriptionBillingStatus?: BillingSubscriptionStatus; + readonly subscriptionBillingStatusDetails?: BillingSubscriptionStatusDetails[]; + readonly subscriptionBillingType?: SubscriptionBillingType; + subscriptionServiceUsageAddress?: BillingPropertyPropertiesSubscriptionServiceUsageAddress; + readonly subscriptionWorkloadType?: SubscriptionWorkloadType; } // @public -export interface BillingPropertyGetOptionalParams extends coreClient.OperationOptions { +export interface BillingPropertyPropertiesEnrollmentDetails extends SubscriptionEnrollmentDetails { } // @public -export type BillingPropertyGetResponse = BillingProperty; - -// @public -export interface BillingPropertyOperations { - get(options?: BillingPropertyGetOptionalParams): Promise; - update(parameters: BillingProperty, options?: BillingPropertyUpdateOptionalParams): Promise; +export interface BillingPropertyPropertiesSubscriptionServiceUsageAddress extends AddressDetails { } // @public @@ -553,1680 +1014,5063 @@ export type BillingPropertyUpdateResponse = BillingProperty; export type BillingRelationshipType = string; // @public -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; +export interface BillingRequest extends ProxyResourceWithTags { + properties?: BillingRequestProperties; } // @public -export interface BillingRoleAssignmentListResult { +export interface BillingRequestListResult { readonly nextLink?: string; - readonly value?: BillingRoleAssignment[]; + readonly value?: BillingRequest[]; } // @public -export interface BillingRoleAssignments { - deleteByBillingAccount(billingAccountName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsDeleteByBillingAccountOptionalParams): Promise; - deleteByBillingProfile(billingAccountName: string, billingProfileName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsDeleteByBillingProfileOptionalParams): Promise; - deleteByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams): Promise; - getByBillingAccount(billingAccountName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsGetByBillingAccountOptionalParams): Promise; - getByBillingProfile(billingAccountName: string, billingProfileName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsGetByBillingProfileOptionalParams): Promise; - getByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsGetByInvoiceSectionOptionalParams): Promise; - listByBillingAccount(billingAccountName: string, options?: BillingRoleAssignmentsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; - listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingRoleAssignmentsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; - listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; +export interface BillingRequestProperties { + additionalInformation?: { + [propertyName: string]: string; + }; + readonly billingAccountDisplayName?: string; + readonly billingAccountId?: string; + readonly billingAccountName?: string; + readonly billingAccountPrimaryBillingTenantId?: string; + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + readonly billingProfileName?: string; + readonly billingScope?: string; + createdBy?: BillingRequestPropertiesCreatedBy; + readonly creationDate?: Date; + readonly customerDisplayName?: string; + readonly customerId?: string; + readonly customerName?: string; + decisionReason?: string; + readonly expirationDate?: Date; + readonly invoiceSectionDisplayName?: string; + readonly invoiceSectionId?: string; + readonly invoiceSectionName?: string; + justification?: string; + lastUpdatedBy?: BillingRequestPropertiesLastUpdatedBy; + readonly lastUpdatedDate?: Date; + readonly provisioningState?: ProvisioningState; + recipients?: Principal[]; + requestScope?: string; + readonly reviewalDate?: Date; + reviewedBy?: BillingRequestPropertiesReviewedBy; + status?: BillingRequestStatus; + readonly subscriptionDisplayName?: string; + readonly subscriptionId?: string; + readonly subscriptionName?: string; + type?: BillingRequestType; } // @public -export interface BillingRoleAssignmentsDeleteByBillingAccountOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestPropertiesCreatedBy extends Principal { } // @public -export type BillingRoleAssignmentsDeleteByBillingAccountResponse = BillingRoleAssignment; +export interface BillingRequestPropertiesLastUpdatedBy extends Principal { +} // @public -export interface BillingRoleAssignmentsDeleteByBillingProfileOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestPropertiesReviewedBy extends Principal { } // @public -export type BillingRoleAssignmentsDeleteByBillingProfileResponse = BillingRoleAssignment; +export interface BillingRequests { + beginCreateOrUpdate(billingRequestName: string, parameters: BillingRequest, options?: BillingRequestsCreateOrUpdateOptionalParams): Promise, BillingRequestsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(billingRequestName: string, parameters: BillingRequest, options?: BillingRequestsCreateOrUpdateOptionalParams): Promise; + get(billingRequestName: string, options?: BillingRequestsGetOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: BillingRequestsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingRequestsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, options?: BillingRequestsListByCustomerOptionalParams): PagedAsyncIterableIterator; + listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingRequestsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; + listByUser(options?: BillingRequestsListByUserOptionalParams): PagedAsyncIterableIterator; +} // @public -export interface BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestsCreateOrUpdateHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export type BillingRoleAssignmentsDeleteByInvoiceSectionResponse = BillingRoleAssignment; +export interface BillingRequestsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} // @public -export interface BillingRoleAssignmentsGetByBillingAccountOptionalParams extends coreClient.OperationOptions { +export type BillingRequestsCreateOrUpdateResponse = BillingRequest; + +// @public +export interface BillingRequestsGetOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingRoleAssignmentsGetByBillingAccountResponse = BillingRoleAssignment; +export type BillingRequestsGetResponse = BillingRequest; // @public -export interface BillingRoleAssignmentsGetByBillingProfileOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingRoleAssignmentsGetByBillingProfileResponse = BillingRoleAssignment; +export type BillingRequestsListByBillingAccountNextResponse = BillingRequestListResult; // @public -export interface BillingRoleAssignmentsGetByInvoiceSectionOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export type BillingRoleAssignmentsGetByInvoiceSectionResponse = BillingRoleAssignment; +export type BillingRequestsListByBillingAccountResponse = BillingRequestListResult; // @public -export interface BillingRoleAssignmentsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingRoleAssignmentsListByBillingAccountNextResponse = BillingRoleAssignmentListResult; +export type BillingRequestsListByBillingProfileNextResponse = BillingRequestListResult; // @public -export interface BillingRoleAssignmentsListByBillingAccountOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestsListByBillingProfileOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export type BillingRoleAssignmentsListByBillingAccountResponse = BillingRoleAssignmentListResult; +export type BillingRequestsListByBillingProfileResponse = BillingRequestListResult; // @public -export interface BillingRoleAssignmentsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestsListByCustomerNextOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingRoleAssignmentsListByBillingProfileNextResponse = BillingRoleAssignmentListResult; +export type BillingRequestsListByCustomerNextResponse = BillingRequestListResult; // @public -export interface BillingRoleAssignmentsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestsListByCustomerOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export type BillingRoleAssignmentsListByBillingProfileResponse = BillingRoleAssignmentListResult; +export type BillingRequestsListByCustomerResponse = BillingRequestListResult; // @public -export interface BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingRoleAssignmentsListByInvoiceSectionNextResponse = BillingRoleAssignmentListResult; +export type BillingRequestsListByInvoiceSectionNextResponse = BillingRequestListResult; // @public -export interface BillingRoleAssignmentsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { +export interface BillingRequestsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export type BillingRoleAssignmentsListByInvoiceSectionResponse = BillingRoleAssignmentListResult; +export type BillingRequestsListByInvoiceSectionResponse = BillingRequestListResult; // @public -export interface BillingRoleDefinition extends Resource { - readonly description?: string; - permissions?: BillingPermissionsProperties[]; - readonly roleName?: string; +export interface BillingRequestsListByUserNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface BillingRoleDefinitionListResult { - readonly nextLink?: string; - readonly value?: BillingRoleDefinition[]; -} +export type BillingRequestsListByUserNextResponse = BillingRequestListResult; // @public -export interface BillingRoleDefinitions { - getByBillingAccount(billingAccountName: string, billingRoleDefinitionName: string, options?: BillingRoleDefinitionsGetByBillingAccountOptionalParams): Promise; - getByBillingProfile(billingAccountName: string, billingProfileName: string, billingRoleDefinitionName: string, options?: BillingRoleDefinitionsGetByBillingProfileOptionalParams): Promise; - getByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, billingRoleDefinitionName: string, options?: BillingRoleDefinitionsGetByInvoiceSectionOptionalParams): Promise; - listByBillingAccount(billingAccountName: string, options?: BillingRoleDefinitionsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; - listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingRoleDefinitionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; - listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingRoleDefinitionsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; +export interface BillingRequestsListByUserOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export interface BillingRoleDefinitionsGetByBillingAccountOptionalParams extends coreClient.OperationOptions { -} +export type BillingRequestsListByUserResponse = BillingRequestListResult; // @public -export type BillingRoleDefinitionsGetByBillingAccountResponse = BillingRoleDefinition; +export type BillingRequestStatus = string; // @public -export interface BillingRoleDefinitionsGetByBillingProfileOptionalParams extends coreClient.OperationOptions { -} +export type BillingRequestType = string; // @public -export type BillingRoleDefinitionsGetByBillingProfileResponse = BillingRoleDefinition; +export interface BillingRoleAssignment extends ProxyResourceWithTags { + properties?: BillingRoleAssignmentProperties; +} // @public -export interface BillingRoleDefinitionsGetByInvoiceSectionOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentListResult { + readonly nextLink?: string; + readonly value?: BillingRoleAssignment[]; } // @public -export type BillingRoleDefinitionsGetByInvoiceSectionResponse = BillingRoleDefinition; +export interface BillingRoleAssignmentProperties { + readonly billingAccountDisplayName?: string; + readonly billingAccountId?: string; + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + readonly billingRequestId?: string; + readonly createdByPrincipalId?: string; + readonly createdByPrincipalPuid?: string; + readonly createdByPrincipalTenantId?: string; + readonly createdByUserEmailAddress?: string; + readonly createdOn?: Date; + readonly customerDisplayName?: string; + readonly customerId?: string; + readonly invoiceSectionDisplayName?: string; + readonly invoiceSectionId?: string; + readonly modifiedByPrincipalId?: string; + readonly modifiedByPrincipalPuid?: string; + readonly modifiedByPrincipalTenantId?: string; + readonly modifiedByUserEmailAddress?: string; + readonly modifiedOn?: Date; + readonly principalDisplayName?: string; + principalId?: string; + principalPuid?: string; + principalTenantId?: string; + readonly principalTenantName?: string; + readonly principalType?: PrincipalType; + readonly provisioningState?: ProvisioningState; + roleDefinitionId: string; + scope?: string; + userAuthenticationType?: string; + userEmailAddress?: string; +} // @public -export interface BillingRoleDefinitionsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignments { + beginCreateByBillingAccount(billingAccountName: string, parameters: BillingRoleAssignmentProperties, options?: BillingRoleAssignmentsCreateByBillingAccountOptionalParams): Promise, BillingRoleAssignmentsCreateByBillingAccountResponse>>; + beginCreateByBillingAccountAndWait(billingAccountName: string, parameters: BillingRoleAssignmentProperties, options?: BillingRoleAssignmentsCreateByBillingAccountOptionalParams): Promise; + beginCreateByBillingProfile(billingAccountName: string, billingProfileName: string, parameters: BillingRoleAssignmentProperties, options?: BillingRoleAssignmentsCreateByBillingProfileOptionalParams): Promise, BillingRoleAssignmentsCreateByBillingProfileResponse>>; + beginCreateByBillingProfileAndWait(billingAccountName: string, billingProfileName: string, parameters: BillingRoleAssignmentProperties, options?: BillingRoleAssignmentsCreateByBillingProfileOptionalParams): Promise; + beginCreateByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, parameters: BillingRoleAssignmentProperties, options?: BillingRoleAssignmentsCreateByCustomerOptionalParams): Promise, BillingRoleAssignmentsCreateByCustomerResponse>>; + beginCreateByCustomerAndWait(billingAccountName: string, billingProfileName: string, customerName: string, parameters: BillingRoleAssignmentProperties, options?: BillingRoleAssignmentsCreateByCustomerOptionalParams): Promise; + beginCreateByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, parameters: BillingRoleAssignmentProperties, options?: BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams): Promise, BillingRoleAssignmentsCreateByInvoiceSectionResponse>>; + beginCreateByInvoiceSectionAndWait(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, parameters: BillingRoleAssignmentProperties, options?: BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams): Promise; + beginCreateOrUpdateByBillingAccount(billingAccountName: string, billingRoleAssignmentName: string, parameters: BillingRoleAssignment, options?: BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams): Promise, BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse>>; + beginCreateOrUpdateByBillingAccountAndWait(billingAccountName: string, billingRoleAssignmentName: string, parameters: BillingRoleAssignment, options?: BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams): Promise; + beginCreateOrUpdateByDepartment(billingAccountName: string, departmentName: string, billingRoleAssignmentName: string, parameters: BillingRoleAssignment, options?: BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams): Promise, BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse>>; + beginCreateOrUpdateByDepartmentAndWait(billingAccountName: string, departmentName: string, billingRoleAssignmentName: string, parameters: BillingRoleAssignment, options?: BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams): Promise; + beginCreateOrUpdateByEnrollmentAccount(billingAccountName: string, enrollmentAccountName: string, billingRoleAssignmentName: string, parameters: BillingRoleAssignment, options?: BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams): Promise, BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse>>; + beginCreateOrUpdateByEnrollmentAccountAndWait(billingAccountName: string, enrollmentAccountName: string, billingRoleAssignmentName: string, parameters: BillingRoleAssignment, options?: BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams): Promise; + beginResolveByBillingAccount(billingAccountName: string, options?: BillingRoleAssignmentsResolveByBillingAccountOptionalParams): Promise, BillingRoleAssignmentsResolveByBillingAccountResponse>>; + beginResolveByBillingAccountAndWait(billingAccountName: string, options?: BillingRoleAssignmentsResolveByBillingAccountOptionalParams): Promise; + beginResolveByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingRoleAssignmentsResolveByBillingProfileOptionalParams): Promise, BillingRoleAssignmentsResolveByBillingProfileResponse>>; + beginResolveByBillingProfileAndWait(billingAccountName: string, billingProfileName: string, options?: BillingRoleAssignmentsResolveByBillingProfileOptionalParams): Promise; + beginResolveByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, options?: BillingRoleAssignmentsResolveByCustomerOptionalParams): Promise, BillingRoleAssignmentsResolveByCustomerResponse>>; + beginResolveByCustomerAndWait(billingAccountName: string, billingProfileName: string, customerName: string, options?: BillingRoleAssignmentsResolveByCustomerOptionalParams): Promise; + beginResolveByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams): Promise, BillingRoleAssignmentsResolveByInvoiceSectionResponse>>; + beginResolveByInvoiceSectionAndWait(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams): Promise; + deleteByBillingAccount(billingAccountName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsDeleteByBillingAccountOptionalParams): Promise; + deleteByBillingProfile(billingAccountName: string, billingProfileName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsDeleteByBillingProfileOptionalParams): Promise; + deleteByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsDeleteByCustomerOptionalParams): Promise; + deleteByDepartment(billingAccountName: string, departmentName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsDeleteByDepartmentOptionalParams): Promise; + deleteByEnrollmentAccount(billingAccountName: string, enrollmentAccountName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams): Promise; + deleteByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams): Promise; + getByBillingAccount(billingAccountName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsGetByBillingAccountOptionalParams): Promise; + getByBillingProfile(billingAccountName: string, billingProfileName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsGetByBillingProfileOptionalParams): Promise; + getByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsGetByCustomerOptionalParams): Promise; + getByDepartment(billingAccountName: string, departmentName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsGetByDepartmentOptionalParams): Promise; + getByEnrollmentAccount(billingAccountName: string, enrollmentAccountName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams): Promise; + getByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, billingRoleAssignmentName: string, options?: BillingRoleAssignmentsGetByInvoiceSectionOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: BillingRoleAssignmentsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingRoleAssignmentsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, options?: BillingRoleAssignmentsListByCustomerOptionalParams): PagedAsyncIterableIterator; + listByDepartment(billingAccountName: string, departmentName: string, options?: BillingRoleAssignmentsListByDepartmentOptionalParams): PagedAsyncIterableIterator; + listByEnrollmentAccount(billingAccountName: string, enrollmentAccountName: string, options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams): PagedAsyncIterableIterator; + listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; } // @public -export type BillingRoleDefinitionsListByBillingAccountNextResponse = BillingRoleDefinitionListResult; +export interface BillingRoleAssignmentsCreateByBillingAccountHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} // @public -export interface BillingRoleDefinitionsListByBillingAccountOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsCreateByBillingAccountOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type BillingRoleDefinitionsListByBillingAccountResponse = BillingRoleDefinitionListResult; +export type BillingRoleAssignmentsCreateByBillingAccountResponse = BillingRoleAssignment; // @public -export interface BillingRoleDefinitionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsCreateByBillingProfileHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export type BillingRoleDefinitionsListByBillingProfileNextResponse = BillingRoleDefinitionListResult; +export interface BillingRoleAssignmentsCreateByBillingProfileOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} // @public -export interface BillingRoleDefinitionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { -} +export type BillingRoleAssignmentsCreateByBillingProfileResponse = BillingRoleAssignment; // @public -export type BillingRoleDefinitionsListByBillingProfileResponse = BillingRoleDefinitionListResult; +export interface BillingRoleAssignmentsCreateByCustomerHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} // @public -export interface BillingRoleDefinitionsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsCreateByCustomerOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type BillingRoleDefinitionsListByInvoiceSectionNextResponse = BillingRoleDefinitionListResult; +export type BillingRoleAssignmentsCreateByCustomerResponse = BillingRoleAssignment; // @public -export interface BillingRoleDefinitionsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsCreateByInvoiceSectionHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export type BillingRoleDefinitionsListByInvoiceSectionResponse = BillingRoleDefinitionListResult; +export interface BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} // @public -export interface BillingSubscription extends Resource { - readonly billingProfileDisplayName?: string; - readonly billingProfileId?: string; - costCenter?: string; - readonly customerDisplayName?: string; - readonly customerId?: string; - readonly displayName?: string; - readonly invoiceSectionDisplayName?: string; - readonly invoiceSectionId?: string; - readonly lastMonthCharges?: Amount; - readonly monthToDateCharges?: Amount; - readonly reseller?: Reseller; - readonly skuDescription?: string; - skuId?: string; - subscriptionBillingStatus?: BillingSubscriptionStatusType; - readonly subscriptionId?: string; - readonly suspensionReasons?: string[]; -} +export type BillingRoleAssignmentsCreateByInvoiceSectionResponse = BillingRoleAssignment; // @public -export interface BillingSubscriptions { - beginMove(billingAccountName: string, parameters: TransferBillingSubscriptionRequestProperties, options?: BillingSubscriptionsMoveOptionalParams): Promise, BillingSubscriptionsMoveResponse>>; - beginMoveAndWait(billingAccountName: string, parameters: TransferBillingSubscriptionRequestProperties, options?: BillingSubscriptionsMoveOptionalParams): Promise; - get(billingAccountName: string, options?: BillingSubscriptionsGetOptionalParams): Promise; - listByBillingAccount(billingAccountName: string, options?: BillingSubscriptionsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; - listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingSubscriptionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; - listByCustomer(billingAccountName: string, customerName: string, options?: BillingSubscriptionsListByCustomerOptionalParams): PagedAsyncIterableIterator; - listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingSubscriptionsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; - update(billingAccountName: string, parameters: BillingSubscription, options?: BillingSubscriptionsUpdateOptionalParams): Promise; - validateMove(billingAccountName: string, parameters: TransferBillingSubscriptionRequestProperties, options?: BillingSubscriptionsValidateMoveOptionalParams): Promise; +export interface BillingRoleAssignmentsCreateOrUpdateByBillingAccountHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export interface BillingSubscriptionsGetOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type BillingSubscriptionsGetResponse = BillingSubscription; +export type BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse = BillingRoleAssignment; // @public -export interface BillingSubscriptionsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsCreateOrUpdateByDepartmentHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export type BillingSubscriptionsListByBillingAccountNextResponse = BillingSubscriptionsListResult; +export interface BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} // @public -export interface BillingSubscriptionsListByBillingAccountOptionalParams extends coreClient.OperationOptions { -} +export type BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse = BillingRoleAssignment; // @public -export type BillingSubscriptionsListByBillingAccountResponse = BillingSubscriptionsListResult; +export interface BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} // @public -export interface BillingSubscriptionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type BillingSubscriptionsListByBillingProfileNextResponse = BillingSubscriptionsListResult; +export type BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse = BillingRoleAssignment; // @public -export interface BillingSubscriptionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsDeleteByBillingAccountOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingSubscriptionsListByBillingProfileResponse = BillingSubscriptionsListResult; +export interface BillingRoleAssignmentsDeleteByBillingProfileOptionalParams extends coreClient.OperationOptions { +} // @public -export interface BillingSubscriptionsListByCustomerNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsDeleteByCustomerOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingSubscriptionsListByCustomerNextResponse = BillingSubscriptionsListResult; +export interface BillingRoleAssignmentsDeleteByDepartmentOptionalParams extends coreClient.OperationOptions { +} // @public -export interface BillingSubscriptionsListByCustomerOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingSubscriptionsListByCustomerResponse = BillingSubscriptionsListResult; +export interface BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams extends coreClient.OperationOptions { +} // @public -export interface BillingSubscriptionsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsGetByBillingAccountOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingSubscriptionsListByInvoiceSectionNextResponse = BillingSubscriptionsListResult; +export type BillingRoleAssignmentsGetByBillingAccountResponse = BillingRoleAssignment; // @public -export interface BillingSubscriptionsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsGetByBillingProfileOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingSubscriptionsListByInvoiceSectionResponse = BillingSubscriptionsListResult; +export type BillingRoleAssignmentsGetByBillingProfileResponse = BillingRoleAssignment; // @public -export interface BillingSubscriptionsListResult { - readonly nextLink?: string; - readonly totalCount?: number; - readonly value?: BillingSubscription[]; +export interface BillingRoleAssignmentsGetByCustomerOptionalParams extends coreClient.OperationOptions { } // @public -export interface BillingSubscriptionsMoveHeaders { - location?: string; - retryAfter?: number; -} +export type BillingRoleAssignmentsGetByCustomerResponse = BillingRoleAssignment; // @public -export interface BillingSubscriptionsMoveOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface BillingRoleAssignmentsGetByDepartmentOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingSubscriptionsMoveResponse = BillingSubscription; +export type BillingRoleAssignmentsGetByDepartmentResponse = BillingRoleAssignment; // @public -export type BillingSubscriptionStatusType = string; +export interface BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams extends coreClient.OperationOptions { +} // @public -export interface BillingSubscriptionsUpdateOptionalParams extends coreClient.OperationOptions { +export type BillingRoleAssignmentsGetByEnrollmentAccountResponse = BillingRoleAssignment; + +// @public +export interface BillingRoleAssignmentsGetByInvoiceSectionOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingSubscriptionsUpdateResponse = BillingSubscription; +export type BillingRoleAssignmentsGetByInvoiceSectionResponse = BillingRoleAssignment; // @public -export interface BillingSubscriptionsValidateMoveOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export type BillingSubscriptionsValidateMoveResponse = ValidateSubscriptionTransferEligibilityResult; +export type BillingRoleAssignmentsListByBillingAccountNextResponse = BillingRoleAssignmentListResult; // @public -export type Category = string; +export interface BillingRoleAssignmentsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; + skip?: number; + top?: number; +} // @public -export interface Customer extends Resource { - readonly billingProfileDisplayName?: string; - readonly billingProfileId?: string; - displayName?: string; - enabledAzurePlans?: AzurePlan[]; - resellers?: Reseller[]; -} +export type BillingRoleAssignmentsListByBillingAccountResponse = BillingRoleAssignmentListResult; // @public -export interface CustomerListResult { - readonly nextLink?: string; - readonly totalCount?: number; - readonly value?: Customer[]; +export interface BillingRoleAssignmentsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface CustomerPolicy extends Resource { - viewCharges?: ViewCharges; -} +export type BillingRoleAssignmentsListByBillingProfileNextResponse = BillingRoleAssignmentListResult; // @public -export interface Customers { - get(billingAccountName: string, customerName: string, options?: CustomersGetOptionalParams): Promise; - listByBillingAccount(billingAccountName: string, options?: CustomersListByBillingAccountOptionalParams): PagedAsyncIterableIterator; - listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: CustomersListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +export interface BillingRoleAssignmentsListByBillingProfileOptionalParams extends coreClient.OperationOptions { + filter?: string; + skip?: number; + top?: number; } // @public -export interface CustomersGetOptionalParams extends coreClient.OperationOptions { - expand?: string; +export type BillingRoleAssignmentsListByBillingProfileResponse = BillingRoleAssignmentListResult; + +// @public +export interface BillingRoleAssignmentsListByCustomerNextOptionalParams extends coreClient.OperationOptions { } // @public -export type CustomersGetResponse = Customer; +export type BillingRoleAssignmentsListByCustomerNextResponse = BillingRoleAssignmentListResult; // @public -export interface CustomersListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsListByCustomerOptionalParams extends coreClient.OperationOptions { filter?: string; - search?: string; + skip?: number; + top?: number; } // @public -export type CustomersListByBillingAccountNextResponse = CustomerListResult; +export type BillingRoleAssignmentsListByCustomerResponse = BillingRoleAssignmentListResult; // @public -export interface CustomersListByBillingAccountOptionalParams extends coreClient.OperationOptions { - filter?: string; - search?: string; +export interface BillingRoleAssignmentsListByDepartmentNextOptionalParams extends coreClient.OperationOptions { } // @public -export type CustomersListByBillingAccountResponse = CustomerListResult; +export type BillingRoleAssignmentsListByDepartmentNextResponse = BillingRoleAssignmentListResult; // @public -export interface CustomersListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - search?: string; +export interface BillingRoleAssignmentsListByDepartmentOptionalParams extends coreClient.OperationOptions { } // @public -export type CustomersListByBillingProfileNextResponse = CustomerListResult; +export type BillingRoleAssignmentsListByDepartmentResponse = BillingRoleAssignmentListResult; // @public -export interface CustomersListByBillingProfileOptionalParams extends coreClient.OperationOptions { - filter?: string; - search?: string; +export interface BillingRoleAssignmentsListByEnrollmentAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export type CustomersListByBillingProfileResponse = CustomerListResult; +export type BillingRoleAssignmentsListByEnrollmentAccountNextResponse = BillingRoleAssignmentListResult; // @public -export interface Department extends Resource { - costCenter?: string; - departmentName?: string; - enrollmentAccounts?: EnrollmentAccount[]; - status?: string; +export interface BillingRoleAssignmentsListByEnrollmentAccountOptionalParams extends coreClient.OperationOptions { } // @public -interface Document_2 { - readonly kind?: DocumentType_2; - readonly source?: DocumentSource; - readonly url?: string; -} -export { Document_2 as Document } +export type BillingRoleAssignmentsListByEnrollmentAccountResponse = BillingRoleAssignmentListResult; // @public -export type DocumentSource = string; +export interface BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { +} // @public -type DocumentType_2 = string; -export { DocumentType_2 as DocumentType } +export type BillingRoleAssignmentsListByInvoiceSectionNextResponse = BillingRoleAssignmentListResult; // @public -export interface DownloadUrl { - readonly expiryTime?: Date; - readonly url?: string; +export interface BillingRoleAssignmentsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { + filter?: string; + skip?: number; + top?: number; } // @public -export interface Enrollment { - readonly billingCycle?: string; - readonly channel?: string; - readonly countryCode?: string; - readonly currency?: string; - endDate?: Date; - readonly language?: string; - readonly policies?: EnrollmentPolicies; - startDate?: Date; - readonly status?: string; -} +export type BillingRoleAssignmentsListByInvoiceSectionResponse = BillingRoleAssignmentListResult; // @public -export interface EnrollmentAccount extends Resource { - accountName?: string; - accountOwner?: string; - accountOwnerEmail?: string; - costCenter?: string; - department?: Department; - endDate?: Date; - startDate?: Date; - status?: string; +export interface BillingRoleAssignmentsResolveByBillingAccountHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export interface EnrollmentAccountContext { - costCenter?: string; - endDate?: Date; - enrollmentAccountName?: string; - startDate?: Date; +export interface BillingRoleAssignmentsResolveByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; + resolveScopeDisplayNames?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export interface EnrollmentAccountListResult { - readonly nextLink?: string; - readonly value?: EnrollmentAccountSummary[]; -} +export type BillingRoleAssignmentsResolveByBillingAccountResponse = BillingRoleAssignmentListResult; // @public -export interface EnrollmentAccounts { - get(name: string, options?: EnrollmentAccountsGetOptionalParams): Promise; - list(options?: EnrollmentAccountsListOptionalParams): PagedAsyncIterableIterator; +export interface BillingRoleAssignmentsResolveByBillingProfileHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export interface EnrollmentAccountsGetOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsResolveByBillingProfileOptionalParams extends coreClient.OperationOptions { + filter?: string; + resolveScopeDisplayNames?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type EnrollmentAccountsGetResponse = EnrollmentAccountSummary; +export type BillingRoleAssignmentsResolveByBillingProfileResponse = BillingRoleAssignmentListResult; // @public -export interface EnrollmentAccountsListNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsResolveByCustomerHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export type EnrollmentAccountsListNextResponse = EnrollmentAccountListResult; - -// @public -export interface EnrollmentAccountsListOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleAssignmentsResolveByCustomerOptionalParams extends coreClient.OperationOptions { + filter?: string; + resolveScopeDisplayNames?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type EnrollmentAccountsListResponse = EnrollmentAccountListResult; +export type BillingRoleAssignmentsResolveByCustomerResponse = BillingRoleAssignmentListResult; // @public -export interface EnrollmentAccountSummary extends Resource { - readonly principalName?: string; +export interface BillingRoleAssignmentsResolveByInvoiceSectionHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export interface EnrollmentPolicies { - readonly accountOwnerViewCharges?: boolean; - readonly departmentAdminViewCharges?: boolean; - readonly marketplaceEnabled?: boolean; - readonly reservedInstancesEnabled?: boolean; +export interface BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams extends coreClient.OperationOptions { + filter?: string; + resolveScopeDisplayNames?: boolean; + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export interface ErrorDetails { - readonly code?: string; - readonly details?: ErrorSubDetailsItem[]; - readonly message?: string; - readonly target?: string; -} +export type BillingRoleAssignmentsResolveByInvoiceSectionResponse = BillingRoleAssignmentListResult; // @public -export interface ErrorResponse { - error?: ErrorDetails; +export interface BillingRoleDefinition extends ProxyResourceWithTags { + properties?: BillingRoleDefinitionProperties; } -// @public (undocumented) -export interface ErrorSubDetailsItem { - readonly code?: string; - readonly message?: string; - readonly target?: string; +// @public +export interface BillingRoleDefinitionGetByBillingAccountOptionalParams extends coreClient.OperationOptions { } // @public -export function getContinuationToken(page: unknown): string | undefined; +export type BillingRoleDefinitionGetByBillingAccountResponse = BillingRoleDefinition; // @public -export interface IndirectRelationshipInfo { - billingAccountName?: string; - billingProfileName?: string; - displayName?: string; +export interface BillingRoleDefinitionGetByBillingProfileOptionalParams extends coreClient.OperationOptions { } // @public -export interface Instruction extends Resource { - amount?: number; - creationDate?: Date; - endDate?: Date; - startDate?: Date; -} +export type BillingRoleDefinitionGetByBillingProfileResponse = BillingRoleDefinition; // @public -export interface InstructionListResult { - readonly nextLink?: string; - readonly value?: Instruction[]; +export interface BillingRoleDefinitionGetByCustomerOptionalParams extends coreClient.OperationOptions { } // @public -export interface Instructions { - get(billingAccountName: string, billingProfileName: string, instructionName: string, options?: InstructionsGetOptionalParams): Promise; - listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: InstructionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; - put(billingAccountName: string, billingProfileName: string, instructionName: string, parameters: Instruction, options?: InstructionsPutOptionalParams): Promise; -} +export type BillingRoleDefinitionGetByCustomerResponse = BillingRoleDefinition; // @public -export interface InstructionsGetOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleDefinitionGetByDepartmentOptionalParams extends coreClient.OperationOptions { } // @public -export type InstructionsGetResponse = Instruction; +export type BillingRoleDefinitionGetByDepartmentResponse = BillingRoleDefinition; // @public -export interface InstructionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleDefinitionGetByEnrollmentAccountOptionalParams extends coreClient.OperationOptions { } // @public -export type InstructionsListByBillingProfileNextResponse = InstructionListResult; +export type BillingRoleDefinitionGetByEnrollmentAccountResponse = BillingRoleDefinition; // @public -export interface InstructionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleDefinitionGetByInvoiceSectionOptionalParams extends coreClient.OperationOptions { } // @public -export type InstructionsListByBillingProfileResponse = InstructionListResult; +export type BillingRoleDefinitionGetByInvoiceSectionResponse = BillingRoleDefinition; // @public -export interface InstructionsPutOptionalParams extends coreClient.OperationOptions { +export interface BillingRoleDefinitionListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export type InstructionsPutResponse = Instruction; +export type BillingRoleDefinitionListByBillingAccountNextResponse = BillingRoleDefinitionListResult; // @public -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 invoiceDate?: Date; - readonly invoicePeriodEndDate?: Date; - readonly invoicePeriodStartDate?: Date; - readonly invoiceType?: InvoiceType; - readonly isMonthlyInvoice?: boolean; - readonly payments?: PaymentProperties[]; - readonly purchaseOrderNumber?: string; - readonly rebillDetails?: { - [propertyName: string]: RebillDetails; - }; - readonly status?: InvoiceStatus; - readonly subscriptionId?: string; - readonly subTotal?: Amount; - readonly taxAmount?: Amount; - readonly totalAmount?: Amount; +export interface BillingRoleDefinitionListByBillingAccountOptionalParams extends coreClient.OperationOptions { } // @public -export type InvoiceDocumentType = string; +export type BillingRoleDefinitionListByBillingAccountResponse = BillingRoleDefinitionListResult; // @public -export interface InvoiceListResult { - readonly nextLink?: string; - readonly totalCount?: number; - readonly value?: Invoice[]; +export interface BillingRoleDefinitionListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface Invoices { - beginDownloadBillingSubscriptionInvoice(invoiceName: string, downloadToken: string, options?: InvoicesDownloadBillingSubscriptionInvoiceOptionalParams): Promise, InvoicesDownloadBillingSubscriptionInvoiceResponse>>; - beginDownloadBillingSubscriptionInvoiceAndWait(invoiceName: string, downloadToken: string, options?: InvoicesDownloadBillingSubscriptionInvoiceOptionalParams): Promise; - beginDownloadInvoice(billingAccountName: string, invoiceName: string, downloadToken: string, options?: InvoicesDownloadInvoiceOptionalParams): Promise, InvoicesDownloadInvoiceResponse>>; - beginDownloadInvoiceAndWait(billingAccountName: string, invoiceName: string, downloadToken: string, options?: InvoicesDownloadInvoiceOptionalParams): Promise; - beginDownloadMultipleBillingProfileInvoices(billingAccountName: string, downloadUrls: string[], options?: InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams): Promise, InvoicesDownloadMultipleBillingProfileInvoicesResponse>>; - beginDownloadMultipleBillingProfileInvoicesAndWait(billingAccountName: string, downloadUrls: string[], options?: InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams): Promise; - beginDownloadMultipleBillingSubscriptionInvoices(downloadUrls: string[], options?: InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams): Promise, InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse>>; - beginDownloadMultipleBillingSubscriptionInvoicesAndWait(downloadUrls: string[], options?: InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams): Promise; - get(billingAccountName: string, invoiceName: string, options?: InvoicesGetOptionalParams): Promise; - getById(invoiceName: string, options?: InvoicesGetByIdOptionalParams): Promise; - getBySubscriptionAndInvoiceId(invoiceName: string, options?: InvoicesGetBySubscriptionAndInvoiceIdOptionalParams): Promise; - listByBillingAccount(billingAccountName: string, periodStartDate: string, periodEndDate: string, options?: InvoicesListByBillingAccountOptionalParams): PagedAsyncIterableIterator; - listByBillingProfile(billingAccountName: string, billingProfileName: string, periodStartDate: string, periodEndDate: string, options?: InvoicesListByBillingProfileOptionalParams): PagedAsyncIterableIterator; - listByBillingSubscription(periodStartDate: string, periodEndDate: string, options?: InvoicesListByBillingSubscriptionOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface InvoicesDownloadBillingSubscriptionInvoiceHeaders { - location?: string; - retryAfter?: string; -} +export type BillingRoleDefinitionListByBillingProfileNextResponse = BillingRoleDefinitionListResult; // @public -export interface InvoicesDownloadBillingSubscriptionInvoiceOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface BillingRoleDefinitionListByBillingProfileOptionalParams extends coreClient.OperationOptions { } // @public -export type InvoicesDownloadBillingSubscriptionInvoiceResponse = DownloadUrl; +export type BillingRoleDefinitionListByBillingProfileResponse = BillingRoleDefinitionListResult; // @public -export interface InvoicesDownloadInvoiceHeaders { - location?: string; - retryAfter?: string; +export interface BillingRoleDefinitionListByCustomerNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface InvoicesDownloadInvoiceOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export type BillingRoleDefinitionListByCustomerNextResponse = BillingRoleDefinitionListResult; + +// @public +export interface BillingRoleDefinitionListByCustomerOptionalParams extends coreClient.OperationOptions { } // @public -export type InvoicesDownloadInvoiceResponse = DownloadUrl; +export type BillingRoleDefinitionListByCustomerResponse = BillingRoleDefinitionListResult; // @public -export interface InvoicesDownloadMultipleBillingProfileInvoicesHeaders { - location?: string; - retryAfter?: string; +export interface BillingRoleDefinitionListByDepartmentNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export type BillingRoleDefinitionListByDepartmentNextResponse = BillingRoleDefinitionListResult; + +// @public +export interface BillingRoleDefinitionListByDepartmentOptionalParams extends coreClient.OperationOptions { } // @public -export type InvoicesDownloadMultipleBillingProfileInvoicesResponse = DownloadUrl; +export type BillingRoleDefinitionListByDepartmentResponse = BillingRoleDefinitionListResult; // @public -export interface InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders { - location?: string; - retryAfter?: string; +export interface BillingRoleDefinitionListByEnrollmentAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export type BillingRoleDefinitionListByEnrollmentAccountNextResponse = BillingRoleDefinitionListResult; + +// @public +export interface BillingRoleDefinitionListByEnrollmentAccountOptionalParams extends coreClient.OperationOptions { } // @public -export type InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse = DownloadUrl; +export type BillingRoleDefinitionListByEnrollmentAccountResponse = BillingRoleDefinitionListResult; // @public -export interface InvoiceSection extends Resource { - displayName?: string; - labels?: { - [propertyName: string]: string; - }; - readonly state?: InvoiceSectionState; - readonly systemId?: string; - tags?: { - [propertyName: string]: string; - }; - readonly targetCloud?: TargetCloud; +export interface BillingRoleDefinitionListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface InvoiceSectionCreationRequest { +export type BillingRoleDefinitionListByInvoiceSectionNextResponse = BillingRoleDefinitionListResult; + +// @public +export interface BillingRoleDefinitionListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingRoleDefinitionListByInvoiceSectionResponse = BillingRoleDefinitionListResult; + +// @public +export interface BillingRoleDefinitionListResult { + readonly nextLink?: string; + readonly value?: BillingRoleDefinition[]; +} + +// @public +export interface BillingRoleDefinitionOperations { + getByBillingAccount(billingAccountName: string, roleDefinitionName: string, options?: BillingRoleDefinitionGetByBillingAccountOptionalParams): Promise; + getByBillingProfile(billingAccountName: string, billingProfileName: string, roleDefinitionName: string, options?: BillingRoleDefinitionGetByBillingProfileOptionalParams): Promise; + getByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, roleDefinitionName: string, options?: BillingRoleDefinitionGetByCustomerOptionalParams): Promise; + getByDepartment(billingAccountName: string, departmentName: string, roleDefinitionName: string, options?: BillingRoleDefinitionGetByDepartmentOptionalParams): Promise; + getByEnrollmentAccount(billingAccountName: string, enrollmentAccountName: string, roleDefinitionName: string, options?: BillingRoleDefinitionGetByEnrollmentAccountOptionalParams): Promise; + getByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, roleDefinitionName: string, options?: BillingRoleDefinitionGetByInvoiceSectionOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: BillingRoleDefinitionListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingRoleDefinitionListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, options?: BillingRoleDefinitionListByCustomerOptionalParams): PagedAsyncIterableIterator; + listByDepartment(billingAccountName: string, departmentName: string, options?: BillingRoleDefinitionListByDepartmentOptionalParams): PagedAsyncIterableIterator; + listByEnrollmentAccount(billingAccountName: string, enrollmentAccountName: string, options?: BillingRoleDefinitionListByEnrollmentAccountOptionalParams): PagedAsyncIterableIterator; + listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingRoleDefinitionListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BillingRoleDefinitionProperties { + readonly description?: string; + readonly permissions?: BillingPermission[]; + roleName: string; +} + +// @public +export interface BillingSubscription extends ProxyResourceWithTags { + autoRenew?: AutoRenew; + beneficiary?: Beneficiary; + beneficiaryTenantId?: string; + billingFrequency?: string; + readonly billingPolicies?: { + [propertyName: string]: string; + }; + readonly billingProfileDisplayName?: string; + billingProfileId?: string; + readonly billingProfileName?: string; + consumptionCostCenter?: string; + readonly customerDisplayName?: string; + customerId?: string; + readonly customerName?: string; + displayName?: string; + readonly enrollmentAccountDisplayName?: string; + readonly enrollmentAccountId?: string; + readonly enrollmentAccountStartDate?: Date; + readonly invoiceSectionDisplayName?: string; + invoiceSectionId?: string; + readonly invoiceSectionName?: string; + readonly lastMonthCharges?: Amount; + readonly monthToDateCharges?: Amount; + readonly nextBillingCycleDetails?: NextBillingCycleDetails; + readonly offerId?: string; + readonly operationStatus?: BillingSubscriptionOperationStatus; + readonly productCategory?: string; + readonly productType?: string; + productTypeId?: string; + readonly provisioningState?: ProvisioningState; + provisioningTenantId?: string; + readonly purchaseDate?: Date; + quantity?: number; + readonly renewalTermDetails?: RenewalTermDetails; + readonly reseller?: Reseller; + readonly resourceUri?: string; + readonly skuDescription?: string; + skuId?: string; + readonly status?: BillingSubscriptionStatus; + readonly subscriptionEnrollmentAccountStatus?: SubscriptionEnrollmentAccountStatus; + readonly subscriptionId?: string; + readonly suspensionReasonDetails?: BillingSubscriptionStatusDetails[]; + readonly suspensionReasons?: string[]; + systemOverrides?: SystemOverrides; + termDuration?: string; + readonly termEndDate?: Date; + readonly termStartDate?: Date; +} + +// @public +export interface BillingSubscriptionAlias extends ProxyResourceWithTags { + autoRenew?: AutoRenew; + beneficiary?: Beneficiary; + beneficiaryTenantId?: string; + billingFrequency?: string; + readonly billingPolicies?: { + [propertyName: string]: string; + }; + readonly billingProfileDisplayName?: string; + billingProfileId?: string; + readonly billingProfileName?: string; + readonly billingSubscriptionId?: string; + consumptionCostCenter?: string; + readonly customerDisplayName?: string; + customerId?: string; + readonly customerName?: string; displayName?: string; + readonly enrollmentAccountDisplayName?: string; + readonly enrollmentAccountId?: string; + readonly enrollmentAccountStartDate?: Date; + readonly invoiceSectionDisplayName?: string; + invoiceSectionId?: string; + readonly invoiceSectionName?: string; + readonly lastMonthCharges?: Amount; + readonly monthToDateCharges?: Amount; + readonly nextBillingCycleDetails?: NextBillingCycleDetails; + readonly offerId?: string; + readonly operationStatus?: BillingSubscriptionOperationStatus; + readonly productCategory?: string; + readonly productType?: string; + productTypeId?: string; + readonly provisioningState?: ProvisioningState; + provisioningTenantId?: string; + readonly purchaseDate?: Date; + quantity?: number; + readonly renewalTermDetails?: RenewalTermDetails; + readonly reseller?: Reseller; + readonly resourceUri?: string; + readonly skuDescription?: string; + skuId?: string; + readonly status?: BillingSubscriptionStatus; + readonly subscriptionEnrollmentAccountStatus?: SubscriptionEnrollmentAccountStatus; + readonly subscriptionId?: string; + readonly suspensionReasonDetails?: BillingSubscriptionStatusDetails[]; + readonly suspensionReasons?: string[]; + systemOverrides?: SystemOverrides; + termDuration?: string; + readonly termEndDate?: Date; + readonly termStartDate?: Date; } // @public -export interface InvoiceSectionListResult { +export interface BillingSubscriptionAliasListResult { readonly nextLink?: string; - readonly totalCount?: number; - readonly value?: InvoiceSection[]; + readonly value?: BillingSubscriptionAlias[]; +} + +// @public +export interface BillingSubscriptionAliasProperties extends BillingSubscriptionProperties { + readonly billingSubscriptionId?: string; } // @public -export interface InvoiceSectionListWithCreateSubPermissionResult { +export interface BillingSubscriptionListResult { readonly nextLink?: string; - value?: InvoiceSectionWithCreateSubPermission[]; + readonly totalCount?: number; + readonly value?: BillingSubscription[]; } // @public -export interface InvoiceSections { - beginCreateOrUpdate(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, parameters: InvoiceSection, options?: InvoiceSectionsCreateOrUpdateOptionalParams): Promise, InvoiceSectionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, parameters: InvoiceSection, options?: InvoiceSectionsCreateOrUpdateOptionalParams): Promise; - get(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: InvoiceSectionsGetOptionalParams): Promise; - listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: InvoiceSectionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +export interface BillingSubscriptionMergeRequest { + quantity?: number; + targetBillingSubscriptionName?: string; } // @public -export interface InvoiceSectionsCreateOrUpdateHeaders { +export type BillingSubscriptionOperationStatus = string; + +// @public +export interface BillingSubscriptionPatch extends ProxyResourceWithTags { + autoRenew?: AutoRenew; + beneficiary?: Beneficiary; + beneficiaryTenantId?: string; + billingFrequency?: string; + readonly billingPolicies?: { + [propertyName: string]: string; + }; + readonly billingProfileDisplayName?: string; + billingProfileId?: string; + readonly billingProfileName?: string; + consumptionCostCenter?: string; + readonly customerDisplayName?: string; + customerId?: string; + readonly customerName?: string; + displayName?: string; + readonly enrollmentAccountDisplayName?: string; + readonly enrollmentAccountId?: string; + readonly enrollmentAccountStartDate?: Date; + readonly invoiceSectionDisplayName?: string; + invoiceSectionId?: string; + readonly invoiceSectionName?: string; + readonly lastMonthCharges?: Amount; + readonly monthToDateCharges?: Amount; + readonly nextBillingCycleDetails?: NextBillingCycleDetails; + readonly offerId?: string; + readonly operationStatus?: BillingSubscriptionOperationStatus; + readonly productCategory?: string; + readonly productType?: string; + productTypeId?: string; + readonly provisioningState?: ProvisioningState; + provisioningTenantId?: string; + readonly purchaseDate?: Date; + quantity?: number; + readonly renewalTermDetails?: RenewalTermDetails; + readonly reseller?: Reseller; + readonly resourceUri?: string; + readonly skuDescription?: string; + skuId?: string; + readonly status?: BillingSubscriptionStatus; + readonly subscriptionEnrollmentAccountStatus?: SubscriptionEnrollmentAccountStatus; + readonly subscriptionId?: string; + readonly suspensionReasonDetails?: BillingSubscriptionStatusDetails[]; + readonly suspensionReasons?: string[]; + systemOverrides?: SystemOverrides; + termDuration?: string; + readonly termEndDate?: Date; + readonly termStartDate?: Date; +} + +// @public +export interface BillingSubscriptionProperties { + autoRenew?: AutoRenew; + beneficiary?: Beneficiary; + beneficiaryTenantId?: string; + billingFrequency?: string; + readonly billingPolicies?: { + [propertyName: string]: string; + }; + readonly billingProfileDisplayName?: string; + billingProfileId?: string; + readonly billingProfileName?: string; + consumptionCostCenter?: string; + readonly customerDisplayName?: string; + customerId?: string; + readonly customerName?: string; + displayName?: string; + readonly enrollmentAccountDisplayName?: string; + readonly enrollmentAccountId?: string; + readonly enrollmentAccountStartDate?: Date; + readonly invoiceSectionDisplayName?: string; + invoiceSectionId?: string; + readonly invoiceSectionName?: string; + readonly lastMonthCharges?: Amount; + readonly monthToDateCharges?: Amount; + readonly nextBillingCycleDetails?: NextBillingCycleDetails; + readonly offerId?: string; + readonly operationStatus?: BillingSubscriptionOperationStatus; + readonly productCategory?: string; + readonly productType?: string; + productTypeId?: string; + readonly provisioningState?: ProvisioningState; + provisioningTenantId?: string; + readonly purchaseDate?: Date; + quantity?: number; + readonly renewalTermDetails?: RenewalTermDetails; + readonly reseller?: Reseller; + readonly resourceUri?: string; + readonly skuDescription?: string; + skuId?: string; + readonly status?: BillingSubscriptionStatus; + readonly subscriptionEnrollmentAccountStatus?: SubscriptionEnrollmentAccountStatus; + readonly subscriptionId?: string; + readonly suspensionReasonDetails?: BillingSubscriptionStatusDetails[]; + readonly suspensionReasons?: string[]; + systemOverrides?: SystemOverrides; + termDuration?: string; + readonly termEndDate?: Date; + readonly termStartDate?: Date; +} + +// @public +export interface BillingSubscriptions { + beginCancel(billingAccountName: string, billingSubscriptionName: string, parameters: CancelSubscriptionRequest, options?: BillingSubscriptionsCancelOptionalParams): Promise, BillingSubscriptionsCancelResponse>>; + beginCancelAndWait(billingAccountName: string, billingSubscriptionName: string, parameters: CancelSubscriptionRequest, options?: BillingSubscriptionsCancelOptionalParams): Promise; + beginDelete(billingAccountName: string, billingSubscriptionName: string, options?: BillingSubscriptionsDeleteOptionalParams): Promise, BillingSubscriptionsDeleteResponse>>; + beginDeleteAndWait(billingAccountName: string, billingSubscriptionName: string, options?: BillingSubscriptionsDeleteOptionalParams): Promise; + beginMerge(billingAccountName: string, billingSubscriptionName: string, parameters: BillingSubscriptionMergeRequest, options?: BillingSubscriptionsMergeOptionalParams): Promise, BillingSubscriptionsMergeResponse>>; + beginMergeAndWait(billingAccountName: string, billingSubscriptionName: string, parameters: BillingSubscriptionMergeRequest, options?: BillingSubscriptionsMergeOptionalParams): Promise; + beginMove(billingAccountName: string, billingSubscriptionName: string, parameters: MoveBillingSubscriptionRequest, options?: BillingSubscriptionsMoveOptionalParams): Promise, BillingSubscriptionsMoveResponse>>; + beginMoveAndWait(billingAccountName: string, billingSubscriptionName: string, parameters: MoveBillingSubscriptionRequest, options?: BillingSubscriptionsMoveOptionalParams): Promise; + beginSplit(billingAccountName: string, billingSubscriptionName: string, parameters: BillingSubscriptionSplitRequest, options?: BillingSubscriptionsSplitOptionalParams): Promise, BillingSubscriptionsSplitResponse>>; + beginSplitAndWait(billingAccountName: string, billingSubscriptionName: string, parameters: BillingSubscriptionSplitRequest, options?: BillingSubscriptionsSplitOptionalParams): Promise; + beginUpdate(billingAccountName: string, billingSubscriptionName: string, parameters: BillingSubscriptionPatch, options?: BillingSubscriptionsUpdateOptionalParams): Promise, BillingSubscriptionsUpdateResponse>>; + beginUpdateAndWait(billingAccountName: string, billingSubscriptionName: string, parameters: BillingSubscriptionPatch, options?: BillingSubscriptionsUpdateOptionalParams): Promise; + get(billingAccountName: string, billingSubscriptionName: string, options?: BillingSubscriptionsGetOptionalParams): Promise; + getByBillingProfile(billingAccountName: string, billingProfileName: string, billingSubscriptionName: string, options?: BillingSubscriptionsGetByBillingProfileOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: BillingSubscriptionsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: BillingSubscriptionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, options?: BillingSubscriptionsListByCustomerOptionalParams): PagedAsyncIterableIterator; + listByCustomerAtBillingAccount(billingAccountName: string, customerName: string, options?: BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByEnrollmentAccount(billingAccountName: string, enrollmentAccountName: string, options?: BillingSubscriptionsListByEnrollmentAccountOptionalParams): PagedAsyncIterableIterator; + listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: BillingSubscriptionsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; + validateMoveEligibility(billingAccountName: string, billingSubscriptionName: string, parameters: MoveBillingSubscriptionRequest, options?: BillingSubscriptionsValidateMoveEligibilityOptionalParams): Promise; +} + +// @public +export interface BillingSubscriptionsAliases { + beginCreateOrUpdate(billingAccountName: string, aliasName: string, parameters: BillingSubscriptionAlias, options?: BillingSubscriptionsAliasesCreateOrUpdateOptionalParams): Promise, BillingSubscriptionsAliasesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(billingAccountName: string, aliasName: string, parameters: BillingSubscriptionAlias, options?: BillingSubscriptionsAliasesCreateOrUpdateOptionalParams): Promise; + get(billingAccountName: string, aliasName: string, options?: BillingSubscriptionsAliasesGetOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: BillingSubscriptionsAliasesListByBillingAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface BillingSubscriptionsAliasesCreateOrUpdateHeaders { + // (undocumented) location?: string; + // (undocumented) retryAfter?: number; } // @public -export interface InvoiceSectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface BillingSubscriptionsAliasesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type InvoiceSectionsCreateOrUpdateResponse = InvoiceSection; +export type BillingSubscriptionsAliasesCreateOrUpdateResponse = BillingSubscriptionAlias; // @public -export interface InvoiceSectionsGetOptionalParams extends coreClient.OperationOptions { +export interface BillingSubscriptionsAliasesGetOptionalParams extends coreClient.OperationOptions { } // @public -export type InvoiceSectionsGetResponse = InvoiceSection; +export type BillingSubscriptionsAliasesGetResponse = BillingSubscriptionAlias; // @public -export interface InvoiceSectionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +export interface BillingSubscriptionsAliasesListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export type InvoiceSectionsListByBillingProfileNextResponse = InvoiceSectionListResult; +export type BillingSubscriptionsAliasesListByBillingAccountNextResponse = BillingSubscriptionAliasListResult; // @public -export interface InvoiceSectionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +export interface BillingSubscriptionsAliasesListByBillingAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + includeDeleted?: boolean; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export type InvoiceSectionsListByBillingProfileResponse = InvoiceSectionListResult; +export type BillingSubscriptionsAliasesListByBillingAccountResponse = BillingSubscriptionAliasListResult; // @public -export interface InvoiceSectionsOnExpand { - readonly hasMoreResults?: boolean; - value?: InvoiceSection[]; +export interface BillingSubscriptionsCancelHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export type InvoiceSectionState = string; +export interface BillingSubscriptionsCancelOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} // @public -export interface InvoiceSectionWithCreateSubPermission { - readonly billingProfileDisplayName?: string; - readonly billingProfileId?: string; - readonly billingProfileSpendingLimit?: SpendingLimitForBillingProfile; - readonly billingProfileStatus?: BillingProfileStatus; - readonly billingProfileStatusReasonCode?: StatusReasonCodeForBillingProfile; - readonly billingProfileSystemId?: string; - enabledAzurePlans?: AzurePlan[]; - readonly invoiceSectionDisplayName?: string; - readonly invoiceSectionId?: string; - readonly invoiceSectionSystemId?: string; +export type BillingSubscriptionsCancelResponse = BillingSubscriptionsCancelHeaders; + +// @public +export interface BillingSubscriptionsDeleteHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export interface InvoicesGetByIdOptionalParams extends coreClient.OperationOptions { +export interface BillingSubscriptionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type InvoicesGetByIdResponse = Invoice; +export type BillingSubscriptionsDeleteResponse = BillingSubscriptionsDeleteHeaders; // @public -export interface InvoicesGetBySubscriptionAndInvoiceIdOptionalParams extends coreClient.OperationOptions { +export interface BillingSubscriptionsGetByBillingProfileOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public -export type InvoicesGetBySubscriptionAndInvoiceIdResponse = Invoice; +export type BillingSubscriptionsGetByBillingProfileResponse = BillingSubscription; // @public -export interface InvoicesGetOptionalParams extends coreClient.OperationOptions { +export interface BillingSubscriptionsGetOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public -export type InvoicesGetResponse = Invoice; +export type BillingSubscriptionsGetResponse = BillingSubscription; // @public -export interface InvoicesListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +export interface BillingSubscriptionsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export type InvoicesListByBillingAccountNextResponse = InvoiceListResult; +export type BillingSubscriptionsListByBillingAccountNextResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + expand?: string; + filter?: string; + includeDeleted?: boolean; + includeFailed?: boolean; + includeTenantSubscriptions?: boolean; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type BillingSubscriptionsListByBillingAccountResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingSubscriptionsListByBillingProfileNextResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { + count?: boolean; + expand?: string; + filter?: string; + includeDeleted?: boolean; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type BillingSubscriptionsListByBillingProfileResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByCustomerAtBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingSubscriptionsListByCustomerAtBillingAccountNextResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + expand?: string; + filter?: string; + includeDeleted?: boolean; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type BillingSubscriptionsListByCustomerAtBillingAccountResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByCustomerNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingSubscriptionsListByCustomerNextResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByCustomerOptionalParams extends coreClient.OperationOptions { + count?: boolean; + expand?: string; + filter?: string; + includeDeleted?: boolean; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type BillingSubscriptionsListByCustomerResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByEnrollmentAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingSubscriptionsListByEnrollmentAccountNextResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByEnrollmentAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type BillingSubscriptionsListByEnrollmentAccountResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingSubscriptionsListByInvoiceSectionNextResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { + count?: boolean; + expand?: string; + filter?: string; + includeDeleted?: boolean; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type BillingSubscriptionsListByInvoiceSectionResponse = BillingSubscriptionListResult; + +// @public +export interface BillingSubscriptionsMergeHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface BillingSubscriptionsMergeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BillingSubscriptionsMergeResponse = BillingSubscription; + +// @public +export interface BillingSubscriptionsMoveHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface BillingSubscriptionsMoveOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BillingSubscriptionsMoveResponse = BillingSubscription; + +// @public +export interface BillingSubscriptionSplitRequest { + billingFrequency?: string; + quantity?: number; + targetProductTypeId?: string; + targetSkuId?: string; + termDuration?: string; +} + +// @public +export interface BillingSubscriptionsSplitHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface BillingSubscriptionsSplitOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BillingSubscriptionsSplitResponse = BillingSubscription; + +// @public +export type BillingSubscriptionStatus = string; + +// @public +export interface BillingSubscriptionStatusDetails { + readonly effectiveDate?: Date; + readonly reason?: SubscriptionStatusReason; +} + +// @public +export interface BillingSubscriptionsUpdateHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface BillingSubscriptionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type BillingSubscriptionsUpdateResponse = BillingSubscription; + +// @public +export interface BillingSubscriptionsValidateMoveEligibilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BillingSubscriptionsValidateMoveEligibilityResponse = MoveBillingSubscriptionEligibilityResult; + +// @public +export type Cancellation = string; + +// @public +export type CancellationReason = string; + +// @public +export interface CancelSubscriptionRequest { + cancellationReason: CancellationReason; + customerId?: string; +} + +// @public +export type Category = string; + +// @public +export interface CheckAccessRequest { + actions?: string[]; +} + +// @public +export interface CheckAccessResponse { + readonly accessDecision?: AccessDecision; + readonly action?: string; +} + +// @public +export interface Commitment extends Price { + grain?: CommitmentGrain; +} + +// @public +export type CommitmentGrain = string; + +// @public +export type CreatedByType = string; + +// @public +export type CreditType = string; + +// @public +export interface Customer extends ProxyResourceWithTags { + properties?: CustomerProperties; +} + +// @public +export interface CustomerListResult { + readonly nextLink?: string; + readonly value?: Customer[]; +} + +// @public +export interface CustomerPolicy extends ProxyResourceWithTags { + properties?: CustomerPolicyProperties; +} + +// @public +export interface CustomerPolicyProperties { + policies?: PolicySummary[]; + readonly provisioningState?: ProvisioningState; + viewCharges: ViewChargesPolicy; +} + +// @public +export interface CustomerProperties { + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + readonly displayName?: string; + enabledAzurePlans?: AzurePlan[]; + resellers?: Reseller[]; + readonly status?: CustomerStatus; + readonly systemId?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Customers { + get(billingAccountName: string, billingProfileName: string, customerName: string, options?: CustomersGetOptionalParams): Promise; + getByBillingAccount(billingAccountName: string, customerName: string, options?: CustomersGetByBillingAccountOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: CustomersListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: CustomersListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CustomersGetByBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomersGetByBillingAccountResponse = Customer; + +// @public +export interface CustomersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomersGetResponse = Customer; + +// @public +export interface CustomersListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomersListByBillingAccountNextResponse = CustomerListResult; + +// @public +export interface CustomersListByBillingAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + expand?: string; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type CustomersListByBillingAccountResponse = CustomerListResult; + +// @public +export interface CustomersListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CustomersListByBillingProfileNextResponse = CustomerListResult; + +// @public +export interface CustomersListByBillingProfileOptionalParams extends coreClient.OperationOptions { + count?: boolean; + expand?: string; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type CustomersListByBillingProfileResponse = CustomerListResult; + +// @public +export type CustomerStatus = string; + +// @public +export type DeleteBillingProfileEligibilityCode = string; + +// @public +export interface DeleteBillingProfileEligibilityDetail { + code?: DeleteBillingProfileEligibilityCode; + message?: string; +} + +// @public +export interface DeleteBillingProfileEligibilityResult { + eligibilityDetails?: DeleteBillingProfileEligibilityDetail[]; + eligibilityStatus?: DeleteBillingProfileEligibilityStatus; +} + +// @public +export type DeleteBillingProfileEligibilityStatus = string; + +// @public +export type DeleteInvoiceSectionEligibilityCode = string; + +// @public +export interface DeleteInvoiceSectionEligibilityDetail { + code?: DeleteInvoiceSectionEligibilityCode; + message?: string; +} + +// @public +export interface DeleteInvoiceSectionEligibilityResult { + eligibilityDetails?: DeleteInvoiceSectionEligibilityDetail[]; + eligibilityStatus?: DeleteInvoiceSectionEligibilityStatus; +} + +// @public +export type DeleteInvoiceSectionEligibilityStatus = string; + +// @public +export interface Department extends ProxyResourceWithTags { + properties?: DepartmentProperties; +} + +// @public +export interface DepartmentListResult { + readonly nextLink?: string; + readonly value?: Department[]; +} + +// @public +export interface DepartmentProperties { + costCenter?: string; + displayName?: string; + readonly id?: string; + readonly status?: string; +} + +// @public +export interface Departments { + get(billingAccountName: string, departmentName: string, options?: DepartmentsGetOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: DepartmentsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DepartmentsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DepartmentsGetResponse = Department; + +// @public +export interface DepartmentsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DepartmentsListByBillingAccountNextResponse = DepartmentListResult; + +// @public +export interface DepartmentsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type DepartmentsListByBillingAccountResponse = DepartmentListResult; + +// @public +export interface DetailedTransferStatus { + errorDetails?: TransferError; + readonly productId?: string; + readonly productName?: string; + readonly productType?: ProductType; + readonly skuDescription?: string; + readonly transferStatus?: ProductTransferStatus; +} + +// @public +export interface DocumentDownloadRequest { + documentName?: string; + invoiceName?: string; +} + +// @public +export interface DocumentDownloadResult { + readonly expiryTime?: string; + readonly url?: string; +} + +// @public +export type DocumentSource = string; + +// @public +export type EligibleProductType = string; + +// @public +export interface EnrollmentAccount extends ProxyResourceWithTags { + properties?: EnrollmentAccountProperties; +} + +// @public +export interface EnrollmentAccountListResult { + readonly nextLink?: string; + readonly value?: EnrollmentAccount[]; +} + +// @public +export type EnrollmentAccountOwnerViewCharges = string; + +// @public +export interface EnrollmentAccountProperties { + readonly accountOwner?: string; + readonly authType?: string; + costCenter?: string; + readonly departmentDisplayName?: string; + readonly departmentId?: string; + displayName?: string; + readonly endDate?: Date; + isDevTestEnabled?: boolean; + readonly startDate?: Date; + readonly status?: string; +} + +// @public +export interface EnrollmentAccounts { + get(billingAccountName: string, enrollmentAccountName: string, options?: EnrollmentAccountsGetOptionalParams): Promise; + getByDepartment(billingAccountName: string, departmentName: string, enrollmentAccountName: string, options?: EnrollmentAccountsGetByDepartmentOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: EnrollmentAccountsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByDepartment(billingAccountName: string, departmentName: string, options?: EnrollmentAccountsListByDepartmentOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface EnrollmentAccountsGetByDepartmentOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnrollmentAccountsGetByDepartmentResponse = EnrollmentAccount; + +// @public +export interface EnrollmentAccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnrollmentAccountsGetResponse = EnrollmentAccount; + +// @public +export interface EnrollmentAccountsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnrollmentAccountsListByBillingAccountNextResponse = EnrollmentAccountListResult; + +// @public +export interface EnrollmentAccountsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type EnrollmentAccountsListByBillingAccountResponse = EnrollmentAccountListResult; + +// @public +export interface EnrollmentAccountsListByDepartmentNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnrollmentAccountsListByDepartmentNextResponse = EnrollmentAccountListResult; + +// @public +export interface EnrollmentAccountsListByDepartmentOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type EnrollmentAccountsListByDepartmentResponse = EnrollmentAccountListResult; + +// @public +export type EnrollmentAuthLevelState = string; + +// @public +export type EnrollmentDepartmentAdminViewCharges = string; + +// @public +export interface EnrollmentDetails { + readonly billingCycle?: string; + readonly channel?: string; + readonly cloud?: string; + readonly countryCode?: string; + readonly currency?: string; + endDate?: Date; + readonly extendedTermOption?: ExtendedTermOption; + indirectRelationshipInfo?: EnrollmentDetailsIndirectRelationshipInfo; + readonly invoiceRecipient?: string; + readonly language?: string; + readonly markupStatus?: MarkupStatus; + poNumber?: string; + startDate?: Date; + readonly supportCoverage?: string; + readonly supportLevel?: SupportLevel; +} + +// @public +export interface EnrollmentDetailsIndirectRelationshipInfo extends IndirectRelationshipInfo { +} + +// @public +export interface EnterpriseAgreementPolicies { + accountOwnerViewCharges?: EnrollmentAccountOwnerViewCharges; + authenticationType?: EnrollmentAuthLevelState; + departmentAdminViewCharges?: EnrollmentDepartmentAdminViewCharges; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ExtendedStatusDefinitionProperties { + subscriptionId?: string; +} + +// @public +export interface ExtendedStatusInfo { + message?: string; + statusCode?: string; + subscriptionId?: string; +} + +// @public +export type ExtendedTermOption = string; + +// @public +export interface ExternalReference { + readonly id?: string; + readonly url?: string; +} + +// @public +export interface FailedPayment { + readonly date?: Date; + readonly failedPaymentReason?: FailedPaymentReason; +} + +// @public +export type FailedPaymentReason = string; + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export interface IndirectRelationshipInfo { + billingAccountName?: string; + billingProfileName?: string; + displayName?: string; +} + +// @public +export interface InitiateTransferRequest { + recipientEmailId?: string; +} + +// @public +export type InitiatorCustomerType = string; + +// @public +export type InstanceFlexibility = string; + +// @public +export interface Invoice extends ProxyResourceWithTags { + properties?: InvoiceProperties; +} + +// @public +export interface InvoiceDocument { + readonly documentNumbers?: string[]; + readonly externalUrl?: string; + readonly kind?: InvoiceDocumentType; + readonly name?: string; + readonly source?: DocumentSource; + readonly url?: string; +} + +// @public +export type InvoiceDocumentType = string; + +// @public +export interface InvoiceListResult { + readonly nextLink?: string; + readonly value?: Invoice[]; +} + +// @public +export interface InvoiceProperties { + amountDue?: InvoicePropertiesAmountDue; + azurePrepaymentApplied?: InvoicePropertiesAzurePrepaymentApplied; + billedAmount?: InvoicePropertiesBilledAmount; + readonly billedDocumentId?: string; + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + creditAmount?: InvoicePropertiesCreditAmount; + readonly creditForDocumentId?: string; + readonly documents?: InvoiceDocument[]; + readonly documentType?: InvoiceDocumentType; + readonly dueDate?: Date; + readonly failedPayments?: FailedPayment[]; + freeAzureCreditApplied?: InvoicePropertiesFreeAzureCreditApplied; + readonly invoiceDate?: Date; + readonly invoicePeriodEndDate?: Date; + readonly invoicePeriodStartDate?: Date; + readonly invoiceType?: InvoiceType; + readonly isMonthlyInvoice?: boolean; + readonly payments?: Payment[]; + readonly purchaseOrderNumber?: string; + rebillDetails?: InvoicePropertiesRebillDetails; + refundDetails?: InvoicePropertiesRefundDetails; + readonly specialTaxationType?: SpecialTaxationType; + readonly status?: InvoiceStatus; + readonly subscriptionDisplayName?: string; + readonly subscriptionId?: string; + subTotal?: InvoicePropertiesSubTotal; + taxAmount?: InvoicePropertiesTaxAmount; + totalAmount?: InvoicePropertiesTotalAmount; +} + +// @public +export interface InvoicePropertiesAmountDue extends Amount { +} + +// @public +export interface InvoicePropertiesAzurePrepaymentApplied extends Amount { +} + +// @public +export interface InvoicePropertiesBilledAmount extends Amount { +} + +// @public +export interface InvoicePropertiesCreditAmount extends Amount { +} + +// @public +export interface InvoicePropertiesFreeAzureCreditApplied extends Amount { +} + +// @public +export interface InvoicePropertiesRebillDetails extends RebillDetails { +} + +// @public +export interface InvoicePropertiesRefundDetails extends RefundDetailsSummary { +} + +// @public +export interface InvoicePropertiesSubTotal extends Amount { +} + +// @public +export interface InvoicePropertiesTaxAmount extends Amount { +} + +// @public +export interface InvoicePropertiesTotalAmount extends Amount { +} + +// @public +export interface Invoices { + beginAmend(billingAccountName: string, invoiceName: string, options?: InvoicesAmendOptionalParams): Promise, InvoicesAmendResponse>>; + beginAmendAndWait(billingAccountName: string, invoiceName: string, options?: InvoicesAmendOptionalParams): Promise; + beginDownloadByBillingAccount(billingAccountName: string, invoiceName: string, options?: InvoicesDownloadByBillingAccountOptionalParams): Promise, InvoicesDownloadByBillingAccountResponse>>; + beginDownloadByBillingAccountAndWait(billingAccountName: string, invoiceName: string, options?: InvoicesDownloadByBillingAccountOptionalParams): Promise; + beginDownloadByBillingSubscription(invoiceName: string, options?: InvoicesDownloadByBillingSubscriptionOptionalParams): Promise, InvoicesDownloadByBillingSubscriptionResponse>>; + beginDownloadByBillingSubscriptionAndWait(invoiceName: string, options?: InvoicesDownloadByBillingSubscriptionOptionalParams): Promise; + beginDownloadDocumentsByBillingAccount(billingAccountName: string, parameters: DocumentDownloadRequest[], options?: InvoicesDownloadDocumentsByBillingAccountOptionalParams): Promise, InvoicesDownloadDocumentsByBillingAccountResponse>>; + beginDownloadDocumentsByBillingAccountAndWait(billingAccountName: string, parameters: DocumentDownloadRequest[], options?: InvoicesDownloadDocumentsByBillingAccountOptionalParams): Promise; + beginDownloadDocumentsByBillingSubscription(parameters: DocumentDownloadRequest[], options?: InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams): Promise, InvoicesDownloadDocumentsByBillingSubscriptionResponse>>; + beginDownloadDocumentsByBillingSubscriptionAndWait(parameters: DocumentDownloadRequest[], options?: InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams): Promise; + beginDownloadSummaryByBillingAccount(billingAccountName: string, invoiceName: string, options?: InvoicesDownloadSummaryByBillingAccountOptionalParams): Promise, InvoicesDownloadSummaryByBillingAccountResponse>>; + beginDownloadSummaryByBillingAccountAndWait(billingAccountName: string, invoiceName: string, options?: InvoicesDownloadSummaryByBillingAccountOptionalParams): Promise; + get(invoiceName: string, options?: InvoicesGetOptionalParams): Promise; + getByBillingAccount(billingAccountName: string, invoiceName: string, options?: InvoicesGetByBillingAccountOptionalParams): Promise; + getByBillingSubscription(invoiceName: string, options?: InvoicesGetByBillingSubscriptionOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: InvoicesListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: InvoicesListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByBillingSubscription(options?: InvoicesListByBillingSubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface InvoicesAmendHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface InvoicesAmendOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type InvoicesAmendResponse = InvoicesAmendHeaders; + +// @public +export interface InvoicesDownloadByBillingAccountHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface InvoicesDownloadByBillingAccountOptionalParams extends coreClient.OperationOptions { + documentName?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type InvoicesDownloadByBillingAccountResponse = DocumentDownloadResult; + +// @public +export interface InvoicesDownloadByBillingSubscriptionHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface InvoicesDownloadByBillingSubscriptionOptionalParams extends coreClient.OperationOptions { + documentName?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type InvoicesDownloadByBillingSubscriptionResponse = DocumentDownloadResult; + +// @public +export interface InvoicesDownloadDocumentsByBillingAccountHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface InvoicesDownloadDocumentsByBillingAccountOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type InvoicesDownloadDocumentsByBillingAccountResponse = DocumentDownloadResult; + +// @public +export interface InvoicesDownloadDocumentsByBillingSubscriptionHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type InvoicesDownloadDocumentsByBillingSubscriptionResponse = DocumentDownloadResult; + +// @public +export interface InvoicesDownloadSummaryByBillingAccountHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface InvoicesDownloadSummaryByBillingAccountOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type InvoicesDownloadSummaryByBillingAccountResponse = DocumentDownloadResult; + +// @public +export interface InvoiceSection extends ProxyResourceWithTags { + properties?: InvoiceSectionProperties; +} + +// @public +export type InvoiceSectionLabelManagementPolicy = string; + +// @public +export interface InvoiceSectionListResult { + readonly nextLink?: string; + readonly value?: InvoiceSection[]; +} + +// @public +export interface InvoiceSectionProperties { + displayName?: string; + readonly provisioningState?: ProvisioningState; + reasonCode?: InvoiceSectionStateReasonCode; + state?: InvoiceSectionState; + readonly systemId?: string; + tags?: { + [propertyName: string]: string; + }; + targetCloud?: string; +} + +// @public +export interface InvoiceSections { + beginCreateOrUpdate(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, parameters: InvoiceSection, options?: InvoiceSectionsCreateOrUpdateOptionalParams): Promise, InvoiceSectionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, parameters: InvoiceSection, options?: InvoiceSectionsCreateOrUpdateOptionalParams): Promise; + beginDelete(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: InvoiceSectionsDeleteOptionalParams): Promise, InvoiceSectionsDeleteResponse>>; + beginDeleteAndWait(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: InvoiceSectionsDeleteOptionalParams): Promise; + get(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: InvoiceSectionsGetOptionalParams): Promise; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: InvoiceSectionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + validateDeleteEligibility(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: InvoiceSectionsValidateDeleteEligibilityOptionalParams): Promise; +} + +// @public +export interface InvoiceSectionsCreateOrUpdateHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface InvoiceSectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type InvoiceSectionsCreateOrUpdateResponse = InvoiceSection; + +// @public +export interface InvoiceSectionsDeleteHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface InvoiceSectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type InvoiceSectionsDeleteResponse = InvoiceSectionsDeleteHeaders; + +// @public +export interface InvoiceSectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InvoiceSectionsGetResponse = InvoiceSection; + +// @public +export interface InvoiceSectionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InvoiceSectionsListByBillingProfileNextResponse = InvoiceSectionListResult; + +// @public +export interface InvoiceSectionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + includeDeleted?: boolean; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type InvoiceSectionsListByBillingProfileResponse = InvoiceSectionListResult; + +// @public +export type InvoiceSectionState = string; + +// @public +export type InvoiceSectionStateReasonCode = string; + +// @public +export interface InvoiceSectionsValidateDeleteEligibilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InvoiceSectionsValidateDeleteEligibilityResponse = DeleteInvoiceSectionEligibilityResult; + +// @public +export interface InvoiceSectionWithCreateSubPermission { + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + readonly billingProfileSpendingLimit?: SpendingLimit; + readonly billingProfileStatus?: BillingProfileStatus; + readonly billingProfileStatusReasonCode?: BillingProfileStatusReasonCode; + readonly billingProfileSystemId?: string; + readonly enabledAzurePlans?: AzurePlan[]; + readonly invoiceSectionDisplayName?: string; + readonly invoiceSectionId?: string; + readonly invoiceSectionSystemId?: string; +} + +// @public +export interface InvoiceSectionWithCreateSubPermissionListResult { + readonly nextLink?: string; + readonly value?: InvoiceSectionWithCreateSubPermission[]; +} + +// @public +export interface InvoicesGetByBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InvoicesGetByBillingAccountResponse = Invoice; + +// @public +export interface InvoicesGetByBillingSubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InvoicesGetByBillingSubscriptionResponse = Invoice; + +// @public +export interface InvoicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InvoicesGetResponse = Invoice; + +// @public +export interface InvoicesListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InvoicesListByBillingAccountNextResponse = InvoiceListResult; + +// @public +export interface InvoicesListByBillingAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + periodEndDate?: Date; + periodStartDate?: Date; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type InvoicesListByBillingAccountResponse = InvoiceListResult; + +// @public +export interface InvoicesListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InvoicesListByBillingProfileNextResponse = InvoiceListResult; + +// @public +export interface InvoicesListByBillingProfileOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + periodEndDate?: Date; + periodStartDate?: Date; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type InvoicesListByBillingProfileResponse = InvoiceListResult; + +// @public +export interface InvoicesListByBillingSubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type InvoicesListByBillingSubscriptionNextResponse = InvoiceListResult; + +// @public +export interface InvoicesListByBillingSubscriptionOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + periodEndDate?: Date; + periodStartDate?: Date; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type InvoicesListByBillingSubscriptionResponse = InvoiceListResult; + +// @public +export type InvoiceStatus = string; + +// @public +export type InvoiceType = string; + +// @public +export enum KnownAcceptanceMode { + ClickToAccept = "ClickToAccept", + ESignEmbedded = "ESignEmbedded", + ESignOffline = "ESignOffline", + Implicit = "Implicit", + Offline = "Offline", + Other = "Other", + PhysicalSign = "PhysicalSign" +} + +// @public +export enum KnownAccessDecision { + Allowed = "Allowed", + NotAllowed = "NotAllowed", + Other = "Other" +} + +// @public +export enum KnownAccountStatus { + Active = "Active", + Deleted = "Deleted", + Disabled = "Disabled", + Expired = "Expired", + Extended = "Extended", + New = "New", + Other = "Other", + Pending = "Pending", + Terminated = "Terminated", + Transferred = "Transferred", + UnderReview = "UnderReview" +} + +// @public +export enum KnownAccountSubType { + Enterprise = "Enterprise", + Individual = "Individual", + None = "None", + Other = "Other", + Professional = "Professional" +} + +// @public +export enum KnownAccountType { + Business = "Business", + ClassicPartner = "ClassicPartner", + Enterprise = "Enterprise", + Individual = "Individual", + Internal = "Internal", + Other = "Other", + Partner = "Partner", + Reseller = "Reseller", + Tenant = "Tenant" +} + +// @public +export enum KnownAddressValidationStatus { + Invalid = "Invalid", + Other = "Other", + Valid = "Valid" +} + +// @public +export enum KnownAgreementType { + EnterpriseAgreement = "EnterpriseAgreement", + MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", + MicrosoftOnlineServicesProgram = "MicrosoftOnlineServicesProgram", + MicrosoftPartnerAgreement = "MicrosoftPartnerAgreement", + Other = "Other" +} + +// @public +export enum KnownAppliedScopeType { + ManagementGroup = "ManagementGroup", + Shared = "Shared", + Single = "Single" +} + +// @public +export enum KnownAutoRenew { + Off = "Off", + On = "On" +} + +// @public +export enum KnownBillingAccountStatusReasonCode { + Expired = "Expired", + ManuallyTerminated = "ManuallyTerminated", + Other = "Other", + TerminateProcessing = "TerminateProcessing", + Transferred = "Transferred", + UnusualActivity = "UnusualActivity" +} + +// @public +export enum KnownBillingManagementTenantState { + Active = "Active", + NotAllowed = "NotAllowed", + Other = "Other", + Revoked = "Revoked" +} + +// @public +export enum KnownBillingPlan { + P1M = "P1M" +} + +// @public +export enum KnownBillingProfileStatus { + Active = "Active", + Deleted = "Deleted", + Disabled = "Disabled", + Other = "Other", + UnderReview = "UnderReview", + Warned = "Warned" +} + +// @public +export enum KnownBillingProfileStatusReasonCode { + Other = "Other", + PastDue = "PastDue", + SpendingLimitExpired = "SpendingLimitExpired", + SpendingLimitReached = "SpendingLimitReached", + UnusualActivity = "UnusualActivity" +} + +// @public +export enum KnownBillingRelationshipType { + CSPCustomer = "CSPCustomer", + CSPPartner = "CSPPartner", + Direct = "Direct", + IndirectCustomer = "IndirectCustomer", + IndirectPartner = "IndirectPartner", + Other = "Other" +} + +// @public +export enum KnownBillingRequestStatus { + Approved = "Approved", + Cancelled = "Cancelled", + Completed = "Completed", + Declined = "Declined", + Expired = "Expired", + Other = "Other", + Pending = "Pending" +} + +// @public +export enum KnownBillingRequestType { + InvoiceAccess = "InvoiceAccess", + Other = "Other", + ProvisioningAccess = "ProvisioningAccess", + RoleAssignment = "RoleAssignment", + UpdateBillingPolicy = "UpdateBillingPolicy" +} + +// @public +export enum KnownBillingSubscriptionOperationStatus { + LockedForUpdate = "LockedForUpdate", + None = "None", + Other = "Other" +} + +// @public +export enum KnownBillingSubscriptionStatus { + Active = "Active", + AutoRenew = "AutoRenew", + Cancelled = "Cancelled", + Deleted = "Deleted", + Disabled = "Disabled", + Expired = "Expired", + Expiring = "Expiring", + Failed = "Failed", + Other = "Other", + Suspended = "Suspended", + Unknown = "Unknown", + Warned = "Warned" +} + +// @public +export enum KnownCancellation { + Allowed = "Allowed", + NotAllowed = "NotAllowed" +} + +// @public +export enum KnownCancellationReason { + Compromise = "Compromise", + Dispute = "Dispute", + Other = "Other" +} + +// @public +export enum KnownCategory { + AffiliatePurchaseTerms = "AffiliatePurchaseTerms", + IndirectForGovernmentAgreement = "IndirectForGovernmentAgreement", + MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", + MicrosoftPartnerAgreement = "MicrosoftPartnerAgreement", + Other = "Other", + UKCloudComputeFramework = "UKCloudComputeFramework" +} + +// @public +export enum KnownCommitmentGrain { + Hourly = "Hourly" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownCreditType { + AzureCreditOffer = "AzureCreditOffer", + AzureFreeCredit = "AzureFreeCredit", + Other = "Other", + Refund = "Refund", + ServiceInterruption = "ServiceInterruption" +} + +// @public +export enum KnownCustomerStatus { + Active = "Active", + Deleted = "Deleted", + Disabled = "Disabled", + Other = "Other", + Pending = "Pending", + UnderReview = "UnderReview", + Warned = "Warned" +} + +// @public +export enum KnownDeleteBillingProfileEligibilityCode { + ActiveBillingSubscriptions = "ActiveBillingSubscriptions", + ActiveCreditCard = "ActiveCreditCard", + ActiveCredits = "ActiveCredits", + LastBillingProfile = "LastBillingProfile", + None = "None", + NotSupported = "NotSupported", + OutstandingCharges = "OutstandingCharges", + PendingCharges = "PendingCharges", + ReservedInstances = "ReservedInstances" +} + +// @public +export enum KnownDeleteBillingProfileEligibilityStatus { + Allowed = "Allowed", + NotAllowed = "NotAllowed" +} + +// @public +export enum KnownDeleteInvoiceSectionEligibilityCode { + ActiveAzurePlans = "ActiveAzurePlans", + ActiveBillingSubscriptions = "ActiveBillingSubscriptions", + LastInvoiceSection = "LastInvoiceSection", + Other = "Other", + ReservedInstances = "ReservedInstances" +} + +// @public +export enum KnownDeleteInvoiceSectionEligibilityStatus { + Allowed = "Allowed", + NotAllowed = "NotAllowed" +} + +// @public +export enum KnownDocumentSource { + DRS = "DRS", + ENF = "ENF", + Other = "Other" +} + +// @public +export enum KnownEligibleProductType { + AzureReservation = "AzureReservation", + DevTestAzureSubscription = "DevTestAzureSubscription", + StandardAzureSubscription = "StandardAzureSubscription" +} + +// @public +export enum KnownEnrollmentAccountOwnerViewCharges { + Allowed = "Allowed", + Disabled = "Disabled", + NotAllowed = "NotAllowed", + Other = "Other" +} + +// @public +export enum KnownEnrollmentAuthLevelState { + MicrosoftAccountOnly = "MicrosoftAccountOnly", + MixedAccount = "MixedAccount", + OrganizationalAccountCrossTenant = "OrganizationalAccountCrossTenant", + OrganizationalAccountOnly = "OrganizationalAccountOnly", + Other = "Other" +} + +// @public +export enum KnownEnrollmentDepartmentAdminViewCharges { + Allowed = "Allowed", + Disabled = "Disabled", + NotAllowed = "NotAllowed", + Other = "Other" +} + +// @public +export enum KnownExtendedTermOption { + OptedIn = "Opted-In", + OptedOut = "Opted-Out", + Other = "Other" +} + +// @public +export enum KnownFailedPaymentReason { + BankDeclined = "BankDeclined", + CardExpired = "CardExpired", + IncorrectCardDetails = "IncorrectCardDetails", + Other = "Other" +} + +// @public +export enum KnownInitiatorCustomerType { + EA = "EA", + Partner = "Partner" +} + +// @public +export enum KnownInstanceFlexibility { + Off = "Off", + On = "On" +} + +// @public +export enum KnownInvoiceDocumentType { + CreditNote = "CreditNote", + Invoice = "Invoice", + Other = "Other", + Summary = "Summary", + TaxReceipt = "TaxReceipt", + Transactions = "Transactions", + VoidNote = "VoidNote" +} + +// @public +export enum KnownInvoiceSectionLabelManagementPolicy { + Allowed = "Allowed", + NotAllowed = "NotAllowed", + Other = "Other" +} + +// @public +export enum KnownInvoiceSectionState { + Active = "Active", + Deleted = "Deleted", + Disabled = "Disabled", + Other = "Other", + Restricted = "Restricted", + UnderReview = "UnderReview", + Warned = "Warned" +} + +// @public +export enum KnownInvoiceSectionStateReasonCode { + Other = "Other", + PastDue = "PastDue", + SpendingLimitExpired = "SpendingLimitExpired", + SpendingLimitReached = "SpendingLimitReached", + UnusualActivity = "UnusualActivity" +} + +// @public +export enum KnownInvoiceStatus { + Due = "Due", + Locked = "Locked", + Other = "Other", + OverDue = "OverDue", + Paid = "Paid", + Void = "Void" +} + +// @public +export enum KnownInvoiceType { + AzureMarketplace = "AzureMarketplace", + AzureServices = "AzureServices", + AzureSupport = "AzureSupport", + Other = "Other" +} + +// @public +export enum KnownMarketplacePurchasesPolicy { + AllAllowed = "AllAllowed", + Disabled = "Disabled", + NotAllowed = "NotAllowed", + OnlyFreeAllowed = "OnlyFreeAllowed", + Other = "Other" +} + +// @public +export enum KnownMarkupStatus { + Disabled = "Disabled", + Locked = "Locked", + Other = "Other", + Preview = "Preview", + Published = "Published" +} + +// @public +export enum KnownMoveValidationErrorCode { + BillingAccountInactive = "BillingAccountInactive", + DestinationBillingProfileInactive = "DestinationBillingProfileInactive", + DestinationBillingProfileNotFound = "DestinationBillingProfileNotFound", + DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue", + DestinationInvoiceSectionInactive = "DestinationInvoiceSectionInactive", + DestinationInvoiceSectionNotFound = "DestinationInvoiceSectionNotFound", + InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination", + InsufficientPermissionOnSource = "InsufficientPermissionOnSource", + InvalidDestination = "InvalidDestination", + InvalidSource = "InvalidSource", + MarketplaceNotEnabledOnDestination = "MarketplaceNotEnabledOnDestination", + Other = "Other", + ProductInactive = "ProductInactive", + ProductNotFound = "ProductNotFound", + ProductTypeNotSupported = "ProductTypeNotSupported", + SourceBillingProfilePastDue = "SourceBillingProfilePastDue", + SourceInvoiceSectionInactive = "SourceInvoiceSectionInactive" +} + +// @public +export enum KnownPaymentMethodFamily { + CheckWire = "CheckWire", + CreditCard = "CreditCard", + Credits = "Credits", + DirectDebit = "DirectDebit", + EWallet = "EWallet", + None = "None", + Other = "Other", + TaskOrder = "TaskOrder" +} + +// @public +export enum KnownPaymentMethodStatus { + Active = "active", + Inactive = "inactive" +} + +// @public +export enum KnownPaymentStatus { + Cancelled = "Cancelled", + Completed = "Completed", + Failed = "Failed", + Pending = "Pending", + Scheduled = "Scheduled", + Succeeded = "Succeeded" +} + +// @public +export enum KnownPaymentTermsEligibilityCode { + BillingAccountNotFound = "BillingAccountNotFound", + InactiveBillingAccount = "InactiveBillingAccount", + IneligibleBillingAccountStatus = "IneligibleBillingAccountStatus", + InvalidBillingAccountType = "InvalidBillingAccountType", + InvalidDateFormat = "InvalidDateFormat", + InvalidDateRange = "InvalidDateRange", + InvalidTerms = "InvalidTerms", + NullOrEmptyPaymentTerms = "NullOrEmptyPaymentTerms", + Other = "Other", + OverlappingPaymentTerms = "OverlappingPaymentTerms" +} + +// @public +export enum KnownPaymentTermsEligibilityStatus { + Invalid = "Invalid", + Other = "Other", + Valid = "Valid" +} + +// @public +export enum KnownPolicyType { + Other = "Other", + SystemControlled = "SystemControlled", + UserControlled = "UserControlled" +} + +// @public +export enum KnownPrincipalType { + DirectoryRole = "DirectoryRole", + Everyone = "Everyone", + Group = "Group", + None = "None", + ServicePrincipal = "ServicePrincipal", + Unknown = "Unknown", + User = "User" +} + +// @public +export enum KnownProductStatus { + Active = "Active", + AutoRenew = "AutoRenew", + Canceled = "Canceled", + Deleted = "Deleted", + Disabled = "Disabled", + Expired = "Expired", + Expiring = "Expiring", + Other = "Other", + PastDue = "PastDue", + Suspended = "Suspended" +} + +// @public +export enum KnownProductTransferStatus { + Completed = "Completed", + Failed = "Failed", + InProgress = "InProgress", + NotStarted = "NotStarted" +} + +// @public +export enum KnownProductType { + AzureReservation = "AzureReservation", + AzureSubscription = "AzureSubscription", + Department = "Department", + Saas = "SAAS", + SavingsPlan = "SavingsPlan" +} + +// @public +export enum KnownProvisioningState { + Canceled = "Canceled", + ConfirmedBilling = "ConfirmedBilling", + Created = "Created", + Creating = "Creating", + Expired = "Expired", + Failed = "Failed", + New = "New", + Pending = "Pending", + PendingBilling = "PendingBilling", + Provisioning = "Provisioning", + Succeeded = "Succeeded" +} + +// @public +export enum KnownProvisioningTenantState { + Active = "Active", + BillingRequestDeclined = "BillingRequestDeclined", + BillingRequestExpired = "BillingRequestExpired", + NotRequested = "NotRequested", + Other = "Other", + Pending = "Pending", + Revoked = "Revoked" +} + +// @public +export enum KnownRefundReasonCode { + AccidentalConversion = "AccidentalConversion", + AccidentalPurchase = "AccidentalPurchase", + ForgotToCancel = "ForgotToCancel", + Other = "Other", + UnclearDocumentation = "UnclearDocumentation", + UnclearPricing = "UnclearPricing" +} + +// @public +export enum KnownRefundStatus { + Approved = "Approved", + Cancelled = "Cancelled", + Completed = "Completed", + Declined = "Declined", + Expired = "Expired", + Other = "Other", + Pending = "Pending" +} + +// @public +export enum KnownReservationBillingPlan { + Monthly = "Monthly", + Upfront = "Upfront" +} + +// @public +export enum KnownReservationPurchasesPolicy { + Allowed = "Allowed", + Disabled = "Disabled", + NotAllowed = "NotAllowed", + Other = "Other" +} + +// @public +export enum KnownReservationStatusCode { + Active = "Active", + CapacityError = "CapacityError", + CapacityRestricted = "CapacityRestricted", + CreditLineCheckFailed = "CreditLineCheckFailed", + Exchanged = "Exchanged", + Expired = "Expired", + Merged = "Merged", + NoBenefit = "NoBenefit", + NoBenefitDueToSubscriptionDeletion = "NoBenefitDueToSubscriptionDeletion", + NoBenefitDueToSubscriptionTransfer = "NoBenefitDueToSubscriptionTransfer", + None = "None", + PaymentInstrumentError = "PaymentInstrumentError", + Pending = "Pending", + Processing = "Processing", + PurchaseError = "PurchaseError", + RiskCheckFailed = "RiskCheckFailed", + Split = "Split", + Succeeded = "Succeeded", + UnknownError = "UnknownError", + Warning = "Warning" +} + +// @public +export enum KnownSavingsPlanPurchasesPolicy { + Allowed = "Allowed", + Disabled = "Disabled", + NotAllowed = "NotAllowed", + Other = "Other" +} + +// @public +export enum KnownSavingsPlanTerm { + P1Y = "P1Y", + P3Y = "P3Y", + P5Y = "P5Y" +} + +// @public +export enum KnownServiceDefinedResourceName { + Default = "default" +} + +// @public +export enum KnownSpecialTaxationType { + InvoiceLevel = "InvoiceLevel", + SubtotalLevel = "SubtotalLevel" +} + +// @public +export enum KnownSpendingLimit { + Off = "Off", + On = "On" +} + +// @public +export enum KnownSpendingLimitStatus { + Active = "Active", + Expired = "Expired", + LimitReached = "LimitReached", + LimitRemoved = "LimitRemoved", + None = "None", + Other = "Other" +} + +// @public +export enum KnownSpendingLimitType { + AcademicSponsorship = "AcademicSponsorship", + AzureConsumptionCredit = "AzureConsumptionCredit", + AzureForStudents = "AzureForStudents", + AzureForStudentsStarter = "AzureForStudentsStarter", + AzurePassSponsorship = "AzurePassSponsorship", + FreeAccount = "FreeAccount", + MpnSponsorship = "MpnSponsorship", + Msdn = "MSDN", + None = "None", + NonProfitSponsorship = "NonProfitSponsorship", + Other = "Other", + Sandbox = "Sandbox", + Sponsorship = "Sponsorship", + StartupSponsorship = "StartupSponsorship", + VisualStudio = "VisualStudio" +} + +// @public +export enum KnownSubscriptionBillingType { + Benefit = "Benefit", + Free = "Free", + None = "None", + Paid = "Paid", + PrePaid = "PrePaid" +} + +// @public +export enum KnownSubscriptionEnrollmentAccountStatus { + Active = "Active", + Cancelled = "Cancelled", + Deleted = "Deleted", + Expired = "Expired", + Inactive = "Inactive", + TransferredOut = "TransferredOut", + Transferring = "Transferring" +} + +// @public +export enum KnownSubscriptionStatusReason { + Cancelled = "Cancelled", + Expired = "Expired", + None = "None", + Other = "Other", + PastDue = "PastDue", + PolicyViolation = "PolicyViolation", + SpendingLimitReached = "SpendingLimitReached", + SuspiciousActivity = "SuspiciousActivity", + Transferred = "Transferred" +} + +// @public +export enum KnownSubscriptionTransferValidationErrorCode { + AccountIsLocked = "AccountIsLocked", + AssetHasCap = "AssetHasCap", + AssetNotActive = "AssetNotActive", + BillingAccountInactive = "BillingAccountInactive", + BillingProfilePastDue = "BillingProfilePastDue", + CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed", + DestinationBillingProfileInactive = "DestinationBillingProfileInactive", + DestinationBillingProfileNotFound = "DestinationBillingProfileNotFound", + DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue", + DestinationInvoiceSectionInactive = "DestinationInvoiceSectionInactive", + DestinationInvoiceSectionNotFound = "DestinationInvoiceSectionNotFound", + InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination", + InsufficientPermissionOnSource = "InsufficientPermissionOnSource", + InvalidDestination = "InvalidDestination", + InvalidSource = "InvalidSource", + InvoiceSectionIsRestricted = "InvoiceSectionIsRestricted", + MarketplaceNotEnabledOnDestination = "MarketplaceNotEnabledOnDestination", + NoActiveAzurePlan = "NoActiveAzurePlan", + None = "None", + Other = "Other", + ProductInactive = "ProductInactive", + ProductNotFound = "ProductNotFound", + ProductTypeNotSupported = "ProductTypeNotSupported", + SourceBillingProfilePastDue = "SourceBillingProfilePastDue", + SourceInvoiceSectionInactive = "SourceInvoiceSectionInactive", + SubscriptionHasReservations = "SubscriptionHasReservations", + SubscriptionNotActive = "SubscriptionNotActive", + SubscriptionTypeNotSupported = "SubscriptionTypeNotSupported" +} + +// @public +export enum KnownSubscriptionWorkloadType { + DevTest = "DevTest", + Internal = "Internal", + None = "None", + Production = "Production" +} + +// @public +export enum KnownSupportedAccountType { + Enterprise = "Enterprise", + Individual = "Individual", + None = "None", + Partner = "Partner" +} + +// @public +export enum KnownSupportLevel { + Developer = "Developer", + Other = "Other", + ProDirect = "Pro-Direct", + Standard = "Standard" +} + +// @public +export enum KnownTaxIdentifierStatus { + Invalid = "Invalid", + Other = "Other", + Valid = "Valid" +} + +// @public +export enum KnownTaxIdentifierType { + BrazilCcmId = "BrazilCcmId", + BrazilCnpjId = "BrazilCnpjId", + BrazilCpfId = "BrazilCpfId", + CanadianFederalExempt = "CanadianFederalExempt", + CanadianProvinceExempt = "CanadianProvinceExempt", + ExternalTaxation = "ExternalTaxation", + IndiaFederalServiceTaxId = "IndiaFederalServiceTaxId", + IndiaFederalTanId = "IndiaFederalTanId", + IndiaPanId = "IndiaPanId", + IndiaStateCstId = "IndiaStateCstId", + IndiaStateGstINId = "IndiaStateGstINId", + IndiaStateVatId = "IndiaStateVatId", + IntlExempt = "IntlExempt", + LoveCode = "LoveCode", + MobileBarCode = "MobileBarCode", + NationalIdentificationNumber = "NationalIdentificationNumber", + Other = "Other", + PublicSectorId = "PublicSectorId", + USExempt = "USExempt", + VatId = "VatId" +} + +// @public +export enum KnownTransactionKind { + All = "All", + Other = "Other", + Reservation = "Reservation" +} + +// @public +export enum KnownTransactionType { + Billed = "Billed", + Other = "Other", + Unbilled = "Unbilled" +} + +// @public +export enum KnownTransferStatus { + Canceled = "Canceled", + Completed = "Completed", + CompletedWithErrors = "CompletedWithErrors", + Declined = "Declined", + Expired = "Expired", + Failed = "Failed", + InProgress = "InProgress", + Pending = "Pending" +} + +// @public +export enum KnownViewChargesPolicy { + Allowed = "Allowed", + NotAllowed = "NotAllowed", + Other = "Other" +} + +// @public +export type MarketplacePurchasesPolicy = string; + +// @public +export type MarkupStatus = string; + +// @public +export interface MoveBillingSubscriptionEligibilityResult { + errorDetails?: MoveBillingSubscriptionErrorDetails; + readonly isMoveEligible?: boolean; +} + +// @public +export interface MoveBillingSubscriptionErrorDetails { + code?: SubscriptionTransferValidationErrorCode; + details?: string; + message?: string; +} + +// @public +export interface MoveBillingSubscriptionRequest { + destinationEnrollmentAccountId?: string; + destinationInvoiceSectionId?: string; +} + +// @public +export interface MoveProductEligibilityResult { + errorDetails?: MoveProductEligibilityResultErrorDetails; + isMoveEligible?: boolean; +} + +// @public +export interface MoveProductEligibilityResultErrorDetails extends MoveProductErrorDetails { +} + +// @public +export interface MoveProductErrorDetails { + readonly code?: MoveValidationErrorCode; + readonly details?: string; + readonly message?: string; +} + +// @public +export interface MoveProductRequest { + destinationInvoiceSectionId: string; +} + +// @public +export type MoveValidationErrorCode = string; + +// @public +export interface NextBillingCycleDetails { + readonly billingFrequency?: string; +} + +// @public +export interface Operation { + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface Participant { + readonly email?: string; + readonly status?: string; + readonly statusDate?: Date; +} + +// @public +export interface PartnerInitiateTransferRequest { + recipientEmailId?: string; + resellerId?: string; +} + +// @public +export interface PartnerTransferDetails extends ProxyResourceWithTags { + readonly canceledBy?: string; + readonly detailedTransferStatus?: DetailedTransferStatus[]; + readonly expirationTime?: Date; + readonly initiatorCustomerType?: InitiatorCustomerType; + readonly initiatorEmailId?: string; + readonly recipientEmailId?: string; + readonly resellerId?: string; + readonly resellerName?: string; + readonly transferStatus?: TransferStatus; +} + +// @public +export interface PartnerTransferDetailsListResult { + readonly nextLink?: string; + readonly value?: PartnerTransferDetails[]; +} + +// @public +export interface PartnerTransfers { + cancel(billingAccountName: string, billingProfileName: string, customerName: string, transferName: string, options?: PartnerTransfersCancelOptionalParams): Promise; + get(billingAccountName: string, billingProfileName: string, customerName: string, transferName: string, options?: PartnerTransfersGetOptionalParams): Promise; + initiate(billingAccountName: string, billingProfileName: string, customerName: string, transferName: string, parameters: PartnerInitiateTransferRequest, options?: PartnerTransfersInitiateOptionalParams): Promise; + list(billingAccountName: string, billingProfileName: string, customerName: string, options?: PartnerTransfersListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PartnerTransfersCancelOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PartnerTransfersCancelResponse = PartnerTransferDetails; + +// @public +export interface PartnerTransfersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PartnerTransfersGetResponse = PartnerTransferDetails; + +// @public +export interface PartnerTransfersInitiateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PartnerTransfersInitiateResponse = PartnerTransferDetails; + +// @public +export interface PartnerTransfersListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PartnerTransfersListNextResponse = PartnerTransferDetailsListResult; + +// @public +export interface PartnerTransfersListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PartnerTransfersListResponse = PartnerTransferDetailsListResult; + +// @public +export interface Patch { + appliedScopeProperties?: ReservationAppliedScopeProperties; + appliedScopeType?: AppliedScopeType; + displayName?: string; + instanceFlexibility?: InstanceFlexibility; + purchaseProperties?: ReservationPurchaseRequest; + renew?: boolean; + reviewDateTime?: Date; + sku?: ReservationSkuProperty; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface Payment { + amount?: PaymentAmount; + readonly date?: Date; + readonly paymentMethodFamily?: PaymentMethodFamily; + readonly paymentMethodId?: string; + readonly paymentMethodType?: string; + readonly paymentType?: string; +} + +// @public +export interface PaymentAmount extends Amount { +} + +// @public +export interface PaymentDetail { + billingCurrencyTotal?: Price; + dueDate?: Date; + readonly extendedStatusInfo?: ExtendedStatusInfo; + paymentDate?: Date; + pricingCurrencyTotal?: Price; + status?: PaymentStatus; +} + +// @public +export interface PaymentMethod extends ProxyResourceWithTags { + readonly accountHolderName?: string; + readonly displayName?: string; + readonly expiration?: string; + family?: PaymentMethodFamily; + readonly idPropertiesId?: string; + readonly lastFourDigits?: string; + logos?: PaymentMethodLogo[]; + readonly paymentMethodType?: string; + status?: PaymentMethodStatus; +} + +// @public +export type PaymentMethodFamily = string; + +// @public +export interface PaymentMethodLink extends ProxyResourceWithTags { + readonly accountHolderName?: string; + readonly displayName?: string; + readonly expiration?: string; + readonly family?: PaymentMethodFamily; + readonly lastFourDigits?: string; + readonly logos?: PaymentMethodLogo[]; + paymentMethod?: PaymentMethodProperties; + paymentMethodId?: string; + readonly paymentMethodType?: string; + readonly status?: PaymentMethodStatus; +} + +// @public +export interface PaymentMethodLinksListResult { + readonly nextLink?: string; + readonly value?: PaymentMethodLink[]; +} + +// @public +export interface PaymentMethodLogo { + readonly mimeType?: string; + readonly url?: string; +} + +// @public +export interface PaymentMethodProperties { + readonly accountHolderName?: string; + readonly displayName?: string; + readonly expiration?: string; + family?: PaymentMethodFamily; + readonly id?: string; + readonly lastFourDigits?: string; + logos?: PaymentMethodLogo[]; + readonly paymentMethodType?: string; + status?: PaymentMethodStatus; +} + +// @public +export interface PaymentMethods { + deleteByUser(paymentMethodName: string, options?: PaymentMethodsDeleteByUserOptionalParams): Promise; + getByBillingAccount(billingAccountName: string, paymentMethodName: string, options?: PaymentMethodsGetByBillingAccountOptionalParams): Promise; + getByBillingProfile(billingAccountName: string, billingProfileName: string, paymentMethodName: string, options?: PaymentMethodsGetByBillingProfileOptionalParams): Promise; + getByUser(paymentMethodName: string, options?: PaymentMethodsGetByUserOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: PaymentMethodsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: PaymentMethodsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByUser(options?: PaymentMethodsListByUserOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PaymentMethodsDeleteByUserOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PaymentMethodsGetByBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PaymentMethodsGetByBillingAccountResponse = PaymentMethod; + +// @public +export interface PaymentMethodsGetByBillingProfileOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PaymentMethodsGetByBillingProfileResponse = PaymentMethodLink; + +// @public +export interface PaymentMethodsGetByUserOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PaymentMethodsGetByUserResponse = PaymentMethod; + +// @public +export interface PaymentMethodsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PaymentMethodsListByBillingAccountNextResponse = PaymentMethodsListResult; + +// @public +export interface PaymentMethodsListByBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PaymentMethodsListByBillingAccountResponse = PaymentMethodsListResult; + +// @public +export interface PaymentMethodsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PaymentMethodsListByBillingProfileNextResponse = PaymentMethodLinksListResult; + +// @public +export interface PaymentMethodsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PaymentMethodsListByBillingProfileResponse = PaymentMethodLinksListResult; + +// @public +export interface PaymentMethodsListByUserNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PaymentMethodsListByUserNextResponse = PaymentMethodsListResult; + +// @public +export interface PaymentMethodsListByUserOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PaymentMethodsListByUserResponse = PaymentMethodsListResult; + +// @public +export interface PaymentMethodsListResult { + readonly nextLink?: string; + readonly value?: PaymentMethod[]; +} + +// @public +export type PaymentMethodStatus = string; + +// @public +export interface PaymentOnAccount { + amount?: PaymentOnAccountAmount; + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + readonly date?: Date; + readonly invoiceId?: string; + readonly invoiceName?: string; + readonly paymentMethodType?: PaymentMethodFamily; +} + +// @public +export interface PaymentOnAccountAmount extends Amount { +} + +// @public +export type PaymentStatus = string; + +// @public +export interface PaymentTerm { + endDate?: Date; + readonly isDefault?: boolean; + startDate?: Date; + term?: string; +} + +// @public +export type PaymentTermsEligibilityCode = string; + +// @public +export interface PaymentTermsEligibilityDetail { + code?: PaymentTermsEligibilityCode; + message?: string; +} + +// @public +export interface PaymentTermsEligibilityResult { + eligibilityDetails?: PaymentTermsEligibilityDetail[]; + eligibilityStatus?: PaymentTermsEligibilityStatus; +} + +// @public +export type PaymentTermsEligibilityStatus = string; + +// @public +export interface Policies { + beginCreateOrUpdateByBillingAccount(billingAccountName: string, parameters: BillingAccountPolicy, options?: PoliciesCreateOrUpdateByBillingAccountOptionalParams): Promise, PoliciesCreateOrUpdateByBillingAccountResponse>>; + beginCreateOrUpdateByBillingAccountAndWait(billingAccountName: string, parameters: BillingAccountPolicy, options?: PoliciesCreateOrUpdateByBillingAccountOptionalParams): Promise; + beginCreateOrUpdateByBillingProfile(billingAccountName: string, billingProfileName: string, parameters: BillingProfilePolicy, options?: PoliciesCreateOrUpdateByBillingProfileOptionalParams): Promise, PoliciesCreateOrUpdateByBillingProfileResponse>>; + beginCreateOrUpdateByBillingProfileAndWait(billingAccountName: string, billingProfileName: string, parameters: BillingProfilePolicy, options?: PoliciesCreateOrUpdateByBillingProfileOptionalParams): Promise; + beginCreateOrUpdateByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, parameters: CustomerPolicy, options?: PoliciesCreateOrUpdateByCustomerOptionalParams): Promise, PoliciesCreateOrUpdateByCustomerResponse>>; + beginCreateOrUpdateByCustomerAndWait(billingAccountName: string, billingProfileName: string, customerName: string, parameters: CustomerPolicy, options?: PoliciesCreateOrUpdateByCustomerOptionalParams): Promise; + beginCreateOrUpdateByCustomerAtBillingAccount(billingAccountName: string, customerName: string, parameters: CustomerPolicy, options?: PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams): Promise, PoliciesCreateOrUpdateByCustomerAtBillingAccountResponse>>; + beginCreateOrUpdateByCustomerAtBillingAccountAndWait(billingAccountName: string, customerName: string, parameters: CustomerPolicy, options?: PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams): Promise; + getByBillingAccount(billingAccountName: string, options?: PoliciesGetByBillingAccountOptionalParams): Promise; + getByBillingProfile(billingAccountName: string, billingProfileName: string, options?: PoliciesGetByBillingProfileOptionalParams): Promise; + getByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, policyName: ServiceDefinedResourceName, options?: PoliciesGetByCustomerOptionalParams): Promise; + getByCustomerAtBillingAccount(billingAccountName: string, customerName: string, options?: PoliciesGetByCustomerAtBillingAccountOptionalParams): Promise; + getBySubscription(options?: PoliciesGetBySubscriptionOptionalParams): Promise; +} + +// @public +export interface PoliciesCreateOrUpdateByBillingAccountHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface PoliciesCreateOrUpdateByBillingAccountOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PoliciesCreateOrUpdateByBillingAccountResponse = BillingAccountPolicy; + +// @public +export interface PoliciesCreateOrUpdateByBillingProfileHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface PoliciesCreateOrUpdateByBillingProfileOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PoliciesCreateOrUpdateByBillingProfileResponse = BillingProfilePolicy; + +// @public +export interface PoliciesCreateOrUpdateByCustomerAtBillingAccountHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PoliciesCreateOrUpdateByCustomerAtBillingAccountResponse = CustomerPolicy; + +// @public +export interface PoliciesCreateOrUpdateByCustomerHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface PoliciesCreateOrUpdateByCustomerOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PoliciesCreateOrUpdateByCustomerResponse = CustomerPolicy; + +// @public +export interface PoliciesGetByBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PoliciesGetByBillingAccountResponse = BillingAccountPolicy; + +// @public +export interface PoliciesGetByBillingProfileOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PoliciesGetByBillingProfileResponse = BillingProfilePolicy; + +// @public +export interface PoliciesGetByCustomerAtBillingAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PoliciesGetByCustomerAtBillingAccountResponse = CustomerPolicy; + +// @public +export interface PoliciesGetByCustomerOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PoliciesGetByCustomerResponse = CustomerPolicy; + +// @public +export interface PoliciesGetBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PoliciesGetBySubscriptionResponse = SubscriptionPolicy; + +// @public +export interface PolicySummary { + name?: string; + policyType?: PolicyType; + scope?: string; + value?: string; +} + +// @public +export type PolicyType = string; + +// @public +export interface Price { + // (undocumented) + amount?: number; + currencyCode?: string; +} + +// @public +export interface Principal { + objectId?: string; + tenantId?: string; + upn?: string; +} + +// @public +export type PrincipalType = string; + +// @public +export interface Product extends ProxyResourceWithTags { + properties?: ProductProperties; +} + +// @public +export interface ProductDetails { + productId?: string; + productType?: ProductType; +} + +// @public +export interface ProductListResult { + readonly nextLink?: string; + readonly value?: Product[]; +} + +// @public +export interface ProductPatch extends ProxyResourceWithTags { + properties?: ProductProperties; +} + +// @public +export interface ProductProperties { + autoRenew?: AutoRenew; + readonly availabilityId?: string; + readonly billingFrequency?: string; + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + readonly customerDisplayName?: string; + readonly customerId?: string; + readonly displayName?: string; + readonly endDate?: string; + readonly invoiceSectionDisplayName?: string; + readonly invoiceSectionId?: string; + lastCharge?: ProductPropertiesLastCharge; + readonly lastChargeDate?: string; + readonly productType?: string; + readonly productTypeId?: string; + readonly purchaseDate?: string; + readonly quantity?: number; + reseller?: ProductPropertiesReseller; + readonly skuDescription?: string; + readonly skuId?: string; + readonly status?: ProductStatus; + readonly tenantId?: string; +} + +// @public +export interface ProductPropertiesLastCharge extends Amount { +} + +// @public +export interface ProductPropertiesReseller extends Reseller { +} + +// @public +export interface Products { + beginMove(billingAccountName: string, productName: string, parameters: MoveProductRequest, options?: ProductsMoveOptionalParams): Promise, ProductsMoveResponse>>; + beginMoveAndWait(billingAccountName: string, productName: string, parameters: MoveProductRequest, options?: ProductsMoveOptionalParams): Promise; + get(billingAccountName: string, productName: string, options?: ProductsGetOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: ProductsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: ProductsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByCustomer(billingAccountName: string, customerName: string, options?: ProductsListByCustomerOptionalParams): PagedAsyncIterableIterator; + listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: ProductsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; + update(billingAccountName: string, productName: string, parameters: ProductPatch, options?: ProductsUpdateOptionalParams): Promise; + validateMoveEligibility(billingAccountName: string, productName: string, parameters: MoveProductRequest, options?: ProductsValidateMoveEligibilityOptionalParams): Promise; +} + +// @public +export interface ProductsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProductsGetResponse = Product; + +// @public +export interface ProductsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProductsListByBillingAccountNextResponse = ProductListResult; + +// @public +export interface ProductsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type ProductsListByBillingAccountResponse = ProductListResult; + +// @public +export interface ProductsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProductsListByBillingProfileNextResponse = ProductListResult; + +// @public +export interface ProductsListByBillingProfileOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type ProductsListByBillingProfileResponse = ProductListResult; + +// @public +export interface ProductsListByCustomerNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProductsListByCustomerNextResponse = ProductListResult; + +// @public +export interface ProductsListByCustomerOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type ProductsListByCustomerResponse = ProductListResult; + +// @public +export interface ProductsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProductsListByInvoiceSectionNextResponse = ProductListResult; + +// @public +export interface ProductsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; +} + +// @public +export type ProductsListByInvoiceSectionResponse = ProductListResult; + +// @public +export interface ProductsMoveHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface ProductsMoveOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ProductsMoveResponse = Product; + +// @public +export type ProductStatus = string; + +// @public +export interface ProductsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProductsUpdateResponse = Product; + +// @public +export interface ProductsValidateMoveEligibilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProductsValidateMoveEligibilityResponse = MoveProductEligibilityResult; + +// @public +export type ProductTransferStatus = string; + +// @public +export type ProductType = string; + +// @public +export type ProvisioningState = string; + +// @public +export type ProvisioningTenantState = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface ProxyResourceWithTags extends ProxyResource { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface PurchaseRequest { + appliedScopeProperties?: AppliedScopeProperties; + appliedScopeType?: AppliedScopeType; + billingPlan?: BillingPlan; + billingScopeId?: string; + commitment?: Commitment; + displayName?: string; + renew?: boolean; + sku?: Sku; + term?: SavingsPlanTerm; +} + +// @public +export interface RebillDetails { + readonly creditNoteDocumentId?: string; + readonly invoiceDocumentId?: string; + readonly rebillDetails?: RebillDetails; +} + +// @public +export interface RecipientTransferDetails extends ProxyResourceWithTags { + readonly allowedProductType?: EligibleProductType[]; + readonly canceledBy?: string; + readonly customerTenantId?: string; + readonly detailedTransferStatus?: DetailedTransferStatus[]; + readonly expirationTime?: Date; + readonly initiatorCustomerType?: InitiatorCustomerType; + readonly initiatorEmailId?: string; + readonly recipientEmailId?: string; + readonly resellerId?: string; + readonly resellerName?: string; + readonly supportedAccounts?: SupportedAccountType[]; + readonly transferStatus?: TransferStatus; +} + +// @public +export interface RecipientTransferDetailsListResult { + readonly nextLink?: string; + readonly value?: RecipientTransferDetails[]; +} + +// @public +export interface RecipientTransfers { + accept(transferName: string, parameters: AcceptTransferRequest, options?: RecipientTransfersAcceptOptionalParams): Promise; + decline(transferName: string, options?: RecipientTransfersDeclineOptionalParams): Promise; + get(transferName: string, options?: RecipientTransfersGetOptionalParams): Promise; + list(options?: RecipientTransfersListOptionalParams): PagedAsyncIterableIterator; + validate(transferName: string, parameters: AcceptTransferRequest, options?: RecipientTransfersValidateOptionalParams): Promise; +} + +// @public +export interface RecipientTransfersAcceptOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RecipientTransfersAcceptResponse = RecipientTransferDetails; + +// @public +export interface RecipientTransfersDeclineOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RecipientTransfersDeclineResponse = RecipientTransferDetails; + +// @public +export interface RecipientTransfersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RecipientTransfersGetResponse = RecipientTransferDetails; + +// @public +export interface RecipientTransfersListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RecipientTransfersListNextResponse = RecipientTransferDetailsListResult; + +// @public +export interface RecipientTransfersListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RecipientTransfersListResponse = RecipientTransferDetailsListResult; + +// @public +export interface RecipientTransfersValidateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RecipientTransfersValidateResponse = ValidateTransferListResponse; + +// @public +export interface RefundDetailsSummary { + amountRefunded?: RefundDetailsSummaryAmountRefunded; + amountRequested?: RefundDetailsSummaryAmountRequested; + readonly approvedOn?: Date; + readonly completedOn?: Date; + readonly rebillInvoiceId?: string; + readonly refundOperationId?: string; + readonly refundReason?: RefundReasonCode; + readonly refundStatus?: RefundStatus; + readonly requestedOn?: Date; + readonly transactionCount?: number; +} + +// @public +export interface RefundDetailsSummaryAmountRefunded extends Amount { +} + +// @public +export interface RefundDetailsSummaryAmountRequested extends Amount { +} + +// @public +export type RefundReasonCode = string; + +// @public +export type RefundStatus = string; + +// @public +export interface RefundTransactionDetails { + amountRefunded?: RefundTransactionDetailsAmountRefunded; + amountRequested?: RefundTransactionDetailsAmountRequested; + refundOperationId?: string; +} + +// @public +export interface RefundTransactionDetailsAmountRefunded extends Amount { +} + +// @public +export interface RefundTransactionDetailsAmountRequested extends Amount { +} + +// @public +export interface RegistrationNumber { + id?: string; + readonly required?: boolean; + readonly type?: string[]; +} + +// @public +export interface RenewalTermDetails { + readonly billingFrequency?: string; + readonly productId?: string; + readonly productTypeId?: string; + quantity?: number; + readonly skuId?: string; + readonly termDuration?: string; + readonly termEndDate?: Date; +} + +// @public +export interface RenewProperties { + purchaseProperties?: PurchaseRequest; +} + +// @public +export interface RenewPropertiesResponse { + billingCurrencyTotal?: Price; + pricingCurrencyTotal?: Price; + purchaseProperties?: ReservationPurchaseRequest; +} + +// @public +export interface Reseller { + readonly description?: string; + readonly resellerId?: string; +} + +// @public +export interface Reservation extends ProxyResource { + aggregates?: ReservationUtilizationAggregates[]; + appliedScopeProperties?: ReservationAppliedScopeProperties; + appliedScopes?: string[]; + readonly appliedScopeType?: string; + archived?: boolean; + benefitStartTime?: Date; + billingPlan?: ReservationBillingPlan; + readonly billingScopeId?: string; + capabilities?: string; + readonly displayName?: string; + readonly displayProvisioningState?: string; + readonly effectiveDateTime?: Date; + // (undocumented) + etag?: number; + readonly expiryDate?: string; + expiryDateTime?: Date; + extendedStatusInfo?: ReservationExtendedStatusInfo; + instanceFlexibility?: InstanceFlexibility; + readonly lastUpdatedDateTime?: Date; + location?: string; + mergeProperties?: ReservationMergeProperties; + productCode?: string; + readonly provisioningState?: string; + readonly provisioningSubState?: string; + purchaseDate?: Date; + purchaseDateTime?: Date; + readonly quantity?: number; + readonly renew?: boolean; + renewDestination?: string; + renewProperties?: RenewPropertiesResponse; + readonly renewSource?: string; + readonly reservedResourceType?: string; + reviewDateTime?: Date; + sku?: ReservationSkuProperty; + readonly skuDescription?: string; + splitProperties?: ReservationSplitProperties; + swapProperties?: ReservationSwapProperties; + tags?: { + [propertyName: string]: string; + }; + readonly term?: string; + readonly trend?: string; + readonly userFriendlyAppliedScopeType?: string; + readonly userFriendlyRenewState?: string; +} + +// @public +export interface ReservationAppliedScopeProperties { + displayName?: string; + managementGroupId?: string; + resourceGroupId?: string; + subscriptionId?: string; + tenantId?: string; +} + +// @public +export type ReservationBillingPlan = string; + +// @public +export interface ReservationExtendedStatusInfo { + message?: string; + properties?: ExtendedStatusDefinitionProperties; + statusCode?: ReservationStatusCode; +} + +// @public +export interface ReservationList { + nextLink?: string; + // (undocumented) + value?: Reservation[]; +} + +// @public +export interface ReservationMergeProperties { + mergeDestination?: string; + mergeSources?: string[]; +} + +// @public +export interface ReservationOrder extends ProxyResource { + benefitStartTime?: Date; + billingAccountId?: string; + billingPlan?: ReservationBillingPlan; + billingProfileId?: string; + createdDateTime?: Date; + customerId?: string; + displayName?: string; + enrollmentId?: string; + // (undocumented) + etag?: number; + expiryDate?: Date; + expiryDateTime?: Date; + extendedStatusInfo?: ReservationExtendedStatusInfo; + originalQuantity?: number; + planInformation?: ReservationOrderBillingPlanInformation; + productCode?: string; + readonly provisioningState?: string; + requestDateTime?: Date; + // (undocumented) + reservations?: Reservation[]; + reviewDateTime?: Date; + tags?: { + [propertyName: string]: string; + }; + readonly term?: string; +} + +// @public +export interface ReservationOrderBillingPlanInformation { + nextPaymentDueDate?: Date; + pricingCurrencyTotal?: Price; + startDate?: Date; + // (undocumented) + transactions?: ReservationPaymentDetail[]; +} + +// @public +export interface ReservationOrderList { + nextLink?: string; + // (undocumented) + value?: ReservationOrder[]; +} + +// @public +export interface ReservationOrders { + getByBillingAccount(billingAccountName: string, reservationOrderId: string, options?: ReservationOrdersGetByBillingAccountOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: ReservationOrdersListByBillingAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ReservationOrdersGetByBillingAccountOptionalParams extends coreClient.OperationOptions { + expand?: string; +} + +// @public +export type ReservationOrdersGetByBillingAccountResponse = ReservationOrder; + +// @public +export interface ReservationOrdersListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReservationOrdersListByBillingAccountNextResponse = ReservationOrderList; + +// @public +export interface ReservationOrdersListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; + orderBy?: string; + skiptoken?: number; +} // @public -export interface InvoicesListByBillingAccountOptionalParams extends coreClient.OperationOptions { -} +export type ReservationOrdersListByBillingAccountResponse = ReservationOrderList; // @public -export type InvoicesListByBillingAccountResponse = InvoiceListResult; +export interface ReservationPaymentDetail { + billingAccount?: string; + billingCurrencyTotal?: Price; + dueDate?: Date; + extendedStatusInfo?: ReservationExtendedStatusInfo; + paymentDate?: Date; + pricingCurrencyTotal?: Price; + status?: PaymentStatus; +} // @public -export interface InvoicesListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { +export interface ReservationPurchaseRequest { + appliedScopeProperties?: ReservationAppliedScopeProperties; + appliedScopes?: string[]; + appliedScopeType?: AppliedScopeType; + billingPlan?: ReservationBillingPlan; + readonly billingScopeId?: string; + displayName?: string; + instanceFlexibilityPropertiesInstanceFlexibility?: InstanceFlexibility; + instanceFlexibilityPropertiesReservedResourcePropertiesInstanceFlexibility?: InstanceFlexibility; + location?: string; + quantity?: number; + renew?: boolean; + readonly reservedResourceType?: string; + reviewDateTime?: Date; + sku?: SkuName; + readonly term?: string; } // @public -export type InvoicesListByBillingProfileNextResponse = InvoiceListResult; +export type ReservationPurchasesPolicy = string; // @public -export interface InvoicesListByBillingProfileOptionalParams extends coreClient.OperationOptions { +export interface Reservations { + beginUpdateByBillingAccount(billingAccountName: string, reservationOrderId: string, reservationId: string, body: Patch, options?: ReservationsUpdateByBillingAccountOptionalParams): Promise, ReservationsUpdateByBillingAccountResponse>>; + beginUpdateByBillingAccountAndWait(billingAccountName: string, reservationOrderId: string, reservationId: string, body: Patch, options?: ReservationsUpdateByBillingAccountOptionalParams): Promise; + getByReservationOrder(billingAccountName: string, reservationOrderId: string, reservationId: string, options?: ReservationsGetByReservationOrderOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: ReservationsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: ReservationsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByReservationOrder(billingAccountName: string, reservationOrderId: string, options?: ReservationsListByReservationOrderOptionalParams): PagedAsyncIterableIterator; } // @public -export type InvoicesListByBillingProfileResponse = InvoiceListResult; +export interface ReservationsGetByReservationOrderOptionalParams extends coreClient.OperationOptions { + expand?: string; +} // @public -export interface InvoicesListByBillingSubscriptionNextOptionalParams extends coreClient.OperationOptions { -} +export type ReservationsGetByReservationOrderResponse = Reservation; // @public -export type InvoicesListByBillingSubscriptionNextResponse = InvoiceListResult; +export interface ReservationSkuProperty { + readonly name?: string; +} // @public -export interface InvoicesListByBillingSubscriptionOptionalParams extends coreClient.OperationOptions { +export interface ReservationsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export type InvoicesListByBillingSubscriptionResponse = InvoiceListResult; +export type ReservationsListByBillingAccountNextResponse = ReservationsListResult; // @public -export type InvoiceStatus = string; +export interface ReservationsListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; + orderBy?: string; + refreshSummary?: string; + selectedState?: string; + skiptoken?: number; + take?: number; +} // @public -export type InvoiceType = string; +export type ReservationsListByBillingAccountResponse = ReservationsListResult; // @public -export enum KnownAcceptanceMode { - ClickToAccept = "ClickToAccept", - ESignEmbedded = "ESignEmbedded", - ESignOffline = "ESignOffline" +export interface ReservationsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownAccountStatus { - Active = "Active", - Deleted = "Deleted", - Disabled = "Disabled", - Expired = "Expired", - Extended = "Extended", - Terminated = "Terminated", - Transferred = "Transferred" -} +export type ReservationsListByBillingProfileNextResponse = ReservationsListResult; // @public -export enum KnownAccountType { - Enterprise = "Enterprise", - Individual = "Individual", - Partner = "Partner" +export interface ReservationsListByBillingProfileOptionalParams extends coreClient.OperationOptions { + filter?: string; + orderBy?: string; + refreshSummary?: string; + selectedState?: string; + skiptoken?: number; + take?: number; } // @public -export enum KnownAddressValidationStatus { - Invalid = "Invalid", - Valid = "Valid" -} +export type ReservationsListByBillingProfileResponse = ReservationsListResult; // @public -export enum KnownAgreementType { - EnterpriseAgreement = "EnterpriseAgreement", - MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", - MicrosoftOnlineServicesProgram = "MicrosoftOnlineServicesProgram", - MicrosoftPartnerAgreement = "MicrosoftPartnerAgreement" +export interface ReservationsListByReservationOrderNextOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownAutoRenew { - Off = "Off", - On = "On" -} +export type ReservationsListByReservationOrderNextResponse = ReservationList; // @public -export enum KnownBillingFrequency { - Monthly = "Monthly", - OneTime = "OneTime", - UsageBased = "UsageBased" +export interface ReservationsListByReservationOrderOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownBillingProfileSpendingLimit { - Off = "Off", - On = "On" -} +export type ReservationsListByReservationOrderResponse = ReservationList; // @public -export enum KnownBillingProfileStatus { - Active = "Active", - Disabled = "Disabled", - Warned = "Warned" +export interface ReservationsListResult { + readonly nextLink?: string; + summary?: ReservationSummary; + readonly value?: Reservation[]; } // @public -export enum KnownBillingProfileStatusReasonCode { - PastDue = "PastDue", - SpendingLimitExpired = "SpendingLimitExpired", - SpendingLimitReached = "SpendingLimitReached" +export interface ReservationSplitProperties { + splitDestinations?: string[]; + splitSource?: string; } // @public -export enum KnownBillingRelationshipType { - CSPPartner = "CSPPartner", - Direct = "Direct", - IndirectCustomer = "IndirectCustomer", - IndirectPartner = "IndirectPartner" -} +export type ReservationStatusCode = string; // @public -export enum KnownBillingSubscriptionStatusType { - Abandoned = "Abandoned", - Active = "Active", - Deleted = "Deleted", - Inactive = "Inactive", - Warning = "Warning" +export interface ReservationSummary { + readonly cancelledCount?: number; + readonly expiredCount?: number; + readonly expiringCount?: number; + readonly failedCount?: number; + readonly noBenefitCount?: number; + readonly pendingCount?: number; + readonly processingCount?: number; + readonly succeededCount?: number; + readonly warningCount?: number; } // @public -export enum KnownCategory { - AffiliatePurchaseTerms = "AffiliatePurchaseTerms", - MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", - Other = "Other" +export interface ReservationsUpdateByBillingAccountHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; } // @public -export enum KnownDocumentSource { - DRS = "DRS", - ENF = "ENF" +export interface ReservationsUpdateByBillingAccountOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export enum KnownDocumentType { - CreditNote = "CreditNote", - Invoice = "Invoice", - TaxReceipt = "TaxReceipt", - VoidNote = "VoidNote" -} +export type ReservationsUpdateByBillingAccountResponse = Reservation; // @public -export enum KnownInvoiceDocumentType { - CreditNote = "CreditNote", - Invoice = "Invoice" +export interface ReservationSwapProperties { + swapDestination?: string; + swapSource?: string; } // @public -export enum KnownInvoiceSectionState { - Active = "Active", - Restricted = "Restricted" +export interface ReservationUtilizationAggregates { + readonly grain?: number; + readonly grainUnit?: string; + readonly value?: number; + readonly valueUnit?: string; } // @public -export enum KnownInvoiceStatus { - Due = "Due", - OverDue = "OverDue", - Paid = "Paid", - Void = "Void" +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; } // @public -export enum KnownInvoiceType { - AzureMarketplace = "AzureMarketplace", - AzureService = "AzureService", - AzureSupport = "AzureSupport" +export interface SavingsPlanModel extends ProxyResourceWithTags { + appliedScopeProperties?: AppliedScopeProperties; + appliedScopeType?: AppliedScopeType; + readonly benefitStartTime?: Date; + readonly billingAccountId?: string; + billingPlan?: BillingPlan; + readonly billingProfileId?: string; + billingScopeId?: string; + commitment?: Commitment; + readonly customerId?: string; + displayName?: string; + readonly displayProvisioningState?: string; + readonly effectiveDateTime?: Date; + readonly expiryDateTime?: Date; + readonly extendedStatusInfo?: ExtendedStatusInfo; + productCode?: string; + provisioningState?: ProvisioningState; + readonly purchaseDateTime?: Date; + renew?: boolean; + renewDestination?: string; + renewProperties?: RenewProperties; + renewSource?: string; + sku: Sku; + term?: SavingsPlanTerm; + readonly userFriendlyAppliedScopeType?: string; + readonly utilization?: Utilization; } // @public -export enum KnownMarketplacePurchasesPolicy { - AllAllowed = "AllAllowed", - NotAllowed = "NotAllowed", - OnlyFreeAllowed = "OnlyFreeAllowed" +export interface SavingsPlanModelList { + nextLink?: string; + // (undocumented) + value?: SavingsPlanModel[]; } // @public -export enum KnownPaymentMethodFamily { - CheckWire = "CheckWire", - CreditCard = "CreditCard", - Credits = "Credits", - None = "None" +export interface SavingsPlanModelListResult { + nextLink?: string; + summary?: SavingsPlanSummaryCount; + // (undocumented) + value?: SavingsPlanModel[]; } // @public -export enum KnownProductStatusType { - Active = "Active", - AutoRenew = "AutoRenew", - Cancelled = "Cancelled", - Disabled = "Disabled", - Expired = "Expired", - Expiring = "Expiring", - Inactive = "Inactive", - PastDue = "PastDue" +export interface SavingsPlanOrderModel extends ProxyResourceWithTags { + readonly benefitStartTime?: Date; + readonly billingAccountId?: string; + billingPlan?: BillingPlan; + readonly billingProfileId?: string; + billingScopeId?: string; + readonly customerId?: string; + displayName?: string; + readonly expiryDateTime?: Date; + readonly extendedStatusInfo?: ExtendedStatusInfo; + planInformation?: BillingPlanInformation; + productCode?: string; + readonly provisioningState?: string; + // (undocumented) + savingsPlans?: string[]; + sku: Sku; + term?: SavingsPlanTerm; } // @public -export enum KnownProductTransferValidationErrorCode { - CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed", - DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue", - InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination", - InsufficientPermissionOnSource = "InsufficientPermissionOnSource", - InvalidSource = "InvalidSource", - NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket", - OneTimePurchaseProductTransferNotAllowed = "OneTimePurchaseProductTransferNotAllowed", - ProductNotActive = "ProductNotActive", - ProductTypeNotSupported = "ProductTypeNotSupported" +export interface SavingsPlanOrderModelList { + nextLink?: string; + // (undocumented) + value?: SavingsPlanOrderModel[]; } // @public -export enum KnownReservationPurchasesPolicy { - Allowed = "Allowed", - NotAllowed = "NotAllowed" +export interface SavingsPlanOrders { + getByBillingAccount(billingAccountName: string, savingsPlanOrderId: string, options?: SavingsPlanOrdersGetByBillingAccountOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: SavingsPlanOrdersListByBillingAccountOptionalParams): PagedAsyncIterableIterator; } // @public -export enum KnownReservationType { - Purchase = "Purchase", - UsageCharge = "Usage Charge" +export interface SavingsPlanOrdersGetByBillingAccountOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public -export enum KnownSpendingLimit { - Off = "Off", - On = "On" -} +export type SavingsPlanOrdersGetByBillingAccountResponse = SavingsPlanOrderModel; // @public -export enum KnownSpendingLimitForBillingProfile { - Off = "Off", - On = "On" +export interface SavingsPlanOrdersListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export enum KnownStatusReasonCode { - PastDue = "PastDue", - SpendingLimitExpired = "SpendingLimitExpired", - SpendingLimitReached = "SpendingLimitReached" -} +export type SavingsPlanOrdersListByBillingAccountNextResponse = SavingsPlanOrderModelList; // @public -export enum KnownStatusReasonCodeForBillingProfile { - PastDue = "PastDue", - SpendingLimitExpired = "SpendingLimitExpired", - SpendingLimitReached = "SpendingLimitReached" +export interface SavingsPlanOrdersListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; + orderBy?: string; + skiptoken?: number; } // @public -export enum KnownSubscriptionTransferValidationErrorCode { - BillingAccountInactive = "BillingAccountInactive", - CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed", - DestinationBillingProfileInactive = "DestinationBillingProfileInactive", - DestinationBillingProfileNotFound = "DestinationBillingProfileNotFound", - DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue", - DestinationInvoiceSectionInactive = "DestinationInvoiceSectionInactive", - DestinationInvoiceSectionNotFound = "DestinationInvoiceSectionNotFound", - InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination", - InsufficientPermissionOnSource = "InsufficientPermissionOnSource", - InvalidDestination = "InvalidDestination", - InvalidSource = "InvalidSource", - MarketplaceNotEnabledOnDestination = "MarketplaceNotEnabledOnDestination", - NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket", - ProductInactive = "ProductInactive", - ProductNotFound = "ProductNotFound", - ProductTypeNotSupported = "ProductTypeNotSupported", - SourceBillingProfilePastDue = "SourceBillingProfilePastDue", - SourceInvoiceSectionInactive = "SourceInvoiceSectionInactive", - SubscriptionNotActive = "SubscriptionNotActive", - SubscriptionTypeNotSupported = "SubscriptionTypeNotSupported" -} +export type SavingsPlanOrdersListByBillingAccountResponse = SavingsPlanOrderModelList; // @public -export enum KnownTargetCloud { - USGov = "USGov", - USNat = "USNat", - USSec = "USSec" -} +export type SavingsPlanPurchasesPolicy = string; // @public -export enum KnownTransactionTypeKind { - All = "all", - Reservation = "reservation" +export interface SavingsPlans { + beginUpdateByBillingAccount(billingAccountName: string, savingsPlanOrderId: string, savingsPlanId: string, body: SavingsPlanUpdateRequest, options?: SavingsPlansUpdateByBillingAccountOptionalParams): Promise, SavingsPlansUpdateByBillingAccountResponse>>; + beginUpdateByBillingAccountAndWait(billingAccountName: string, savingsPlanOrderId: string, savingsPlanId: string, body: SavingsPlanUpdateRequest, options?: SavingsPlansUpdateByBillingAccountOptionalParams): Promise; + getByBillingAccount(billingAccountName: string, savingsPlanOrderId: string, savingsPlanId: string, options?: SavingsPlansGetByBillingAccountOptionalParams): Promise; + listByBillingAccount(billingAccountName: string, options?: SavingsPlansListByBillingAccountOptionalParams): PagedAsyncIterableIterator; + listBySavingsPlanOrder(billingAccountName: string, savingsPlanOrderId: string, options?: SavingsPlansListBySavingsPlanOrderOptionalParams): PagedAsyncIterableIterator; + validateUpdateByBillingAccount(billingAccountName: string, savingsPlanOrderId: string, savingsPlanId: string, body: SavingsPlanUpdateValidateRequest, options?: SavingsPlansValidateUpdateByBillingAccountOptionalParams): Promise; } // @public -export enum KnownViewCharges { - Allowed = "Allowed", - NotAllowed = "NotAllowed" +export interface SavingsPlansGetByBillingAccountOptionalParams extends coreClient.OperationOptions { + expand?: string; } // @public -export enum KnownViewChargesPolicy { - Allowed = "Allowed", - NotAllowed = "NotAllowed" +export type SavingsPlansGetByBillingAccountResponse = SavingsPlanModel; + +// @public +export interface SavingsPlansListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { } // @public -export type MarketplacePurchasesPolicy = string; +export type SavingsPlansListByBillingAccountNextResponse = SavingsPlanModelListResult; // @public -export interface Operation { - display?: OperationDisplay; - readonly isDataAction?: boolean; - readonly name?: string; +export interface SavingsPlansListByBillingAccountOptionalParams extends coreClient.OperationOptions { + filter?: string; + orderBy?: string; + refreshSummary?: string; + selectedState?: string; + skiptoken?: number; + take?: number; } // @public -export interface OperationDisplay { - readonly description?: string; - readonly operation?: string; - readonly provider?: string; - readonly resource?: string; -} +export type SavingsPlansListByBillingAccountResponse = SavingsPlanModelListResult; // @public -export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; +export interface SavingsPlansListBySavingsPlanOrderNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; -} +export type SavingsPlansListBySavingsPlanOrderNextResponse = SavingsPlanModelList; // @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +export interface SavingsPlansListBySavingsPlanOrderOptionalParams extends coreClient.OperationOptions { } // @public -export type OperationsListNextResponse = OperationListResult; +export type SavingsPlansListBySavingsPlanOrderResponse = SavingsPlanModelList; // @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { +export interface SavingsPlanSummaryCount { + readonly cancelledCount?: number; + readonly expiredCount?: number; + readonly expiringCount?: number; + readonly failedCount?: number; + readonly noBenefitCount?: number; + readonly pendingCount?: number; + readonly processingCount?: number; + readonly succeededCount?: number; + readonly warningCount?: number; } // @public -export type OperationsListResponse = OperationListResult; +export interface SavingsPlansUpdateByBillingAccountHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; +} // @public -export interface Participants { - readonly email?: string; - readonly status?: string; - readonly statusDate?: Date; +export interface SavingsPlansUpdateByBillingAccountOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type PaymentMethodFamily = string; +export type SavingsPlansUpdateByBillingAccountResponse = SavingsPlanModel; // @public -export interface PaymentProperties { - readonly amount?: Amount; - readonly date?: Date; - paymentMethodFamily?: PaymentMethodFamily; - readonly paymentMethodType?: string; - readonly paymentType?: string; +export interface SavingsPlansValidateUpdateByBillingAccountOptionalParams extends coreClient.OperationOptions { } // @public -export interface Policies { - getByBillingProfile(billingAccountName: string, billingProfileName: string, options?: PoliciesGetByBillingProfileOptionalParams): Promise; - getByCustomer(billingAccountName: string, customerName: string, options?: PoliciesGetByCustomerOptionalParams): Promise; - update(billingAccountName: string, billingProfileName: string, parameters: Policy, options?: PoliciesUpdateOptionalParams): Promise; - updateCustomer(billingAccountName: string, customerName: string, parameters: CustomerPolicy, options?: PoliciesUpdateCustomerOptionalParams): Promise; -} +export type SavingsPlansValidateUpdateByBillingAccountResponse = SavingsPlanValidateResponse; // @public -export interface PoliciesGetByBillingProfileOptionalParams extends coreClient.OperationOptions { +export type SavingsPlanTerm = string; + +// @public +export interface SavingsPlanUpdateRequest { + properties?: SavingsPlanUpdateRequestProperties; + sku?: Sku; + tags?: { + [propertyName: string]: string; + }; } // @public -export type PoliciesGetByBillingProfileResponse = Policy; +export interface SavingsPlanUpdateRequestProperties { + appliedScopeProperties?: AppliedScopeProperties; + appliedScopeType?: AppliedScopeType; + displayName?: string; + renew?: boolean; + renewProperties?: RenewProperties; +} // @public -export interface PoliciesGetByCustomerOptionalParams extends coreClient.OperationOptions { +export interface SavingsPlanUpdateValidateRequest { + benefits?: SavingsPlanUpdateRequestProperties[]; } // @public -export type PoliciesGetByCustomerResponse = CustomerPolicy; +export interface SavingsPlanValidateResponse { + // (undocumented) + benefits?: SavingsPlanValidResponseProperty[]; + nextLink?: string; +} // @public -export interface PoliciesUpdateCustomerOptionalParams extends coreClient.OperationOptions { +export interface SavingsPlanValidResponseProperty { + reason?: string; + reasonCode?: string; + valid?: boolean; } // @public -export type PoliciesUpdateCustomerResponse = CustomerPolicy; +export type ServiceDefinedResourceName = string; // @public -export interface PoliciesUpdateOptionalParams extends coreClient.OperationOptions { +export interface Sku { + name?: string; } // @public -export type PoliciesUpdateResponse = Policy; +export interface SkuName { + // (undocumented) + name?: string; +} // @public -export interface Policy extends Resource { - marketplacePurchases?: MarketplacePurchasesPolicy; - reservationPurchases?: ReservationPurchasesPolicy; - viewCharges?: ViewChargesPolicy; -} +export type SpecialTaxationType = string; // @public -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 endDate?: Date; - 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 reseller?: Reseller; - readonly skuDescription?: string; - readonly skuId?: string; - status?: ProductStatusType; - readonly tenantId?: string; -} +export type SpendingLimit = string; // @public -export interface Products { - get(billingAccountName: string, productName: string, options?: ProductsGetOptionalParams): Promise; - listByBillingAccount(billingAccountName: string, options?: ProductsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; - listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: ProductsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; - listByCustomer(billingAccountName: string, customerName: string, options?: ProductsListByCustomerOptionalParams): PagedAsyncIterableIterator; - listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: ProductsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; - move(billingAccountName: string, productName: string, parameters: TransferProductRequestProperties, options?: ProductsMoveOptionalParams): Promise; - update(billingAccountName: string, productName: string, parameters: Product, options?: ProductsUpdateOptionalParams): Promise; - validateMove(billingAccountName: string, productName: string, parameters: TransferProductRequestProperties, options?: ProductsValidateMoveOptionalParams): Promise; +export interface SpendingLimitDetails { + amount?: number; + currency?: string; + endDate?: Date; + startDate?: Date; + status?: SpendingLimitStatus; + type?: SpendingLimitType; } // @public -export interface ProductsGetOptionalParams extends coreClient.OperationOptions { -} +export type SpendingLimitStatus = string; // @public -export type ProductsGetResponse = Product; +export type SpendingLimitType = string; // @public -export interface ProductsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { - filter?: string; -} +export type SubscriptionBillingType = string; // @public -export type ProductsListByBillingAccountNextResponse = ProductsListResult; +export type SubscriptionEnrollmentAccountStatus = string; // @public -export interface ProductsListByBillingAccountOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface SubscriptionEnrollmentDetails { + departmentDisplayName?: string; + departmentId?: string; + enrollmentAccountDisplayName?: string; + enrollmentAccountId?: string; + enrollmentAccountStatus?: string; } // @public -export type ProductsListByBillingAccountResponse = ProductsListResult; +export interface SubscriptionPolicy extends ProxyResourceWithTags { + properties?: SubscriptionPolicyProperties; +} // @public -export interface ProductsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface SubscriptionPolicyProperties { + policies?: PolicySummary[]; + readonly provisioningState?: ProvisioningState; } // @public -export type ProductsListByBillingProfileNextResponse = ProductsListResult; +export type SubscriptionStatusReason = string; // @public -export interface ProductsListByBillingProfileOptionalParams extends coreClient.OperationOptions { - filter?: string; -} +export type SubscriptionTransferValidationErrorCode = string; // @public -export type ProductsListByBillingProfileResponse = ProductsListResult; +export type SubscriptionWorkloadType = string; // @public -export interface ProductsListByCustomerNextOptionalParams extends coreClient.OperationOptions { -} +export type SupportedAccountType = string; // @public -export type ProductsListByCustomerNextResponse = ProductsListResult; +export type SupportLevel = string; // @public -export interface ProductsListByCustomerOptionalParams extends coreClient.OperationOptions { +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; } // @public -export type ProductsListByCustomerResponse = ProductsListResult; +export interface SystemOverrides { + readonly cancellation?: Cancellation; + readonly cancellationAllowedEndDate?: Date; +} // @public -export interface ProductsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { - filter?: string; +export interface TaxIdentifier { + country?: string; + id?: string; + scope?: string; + status?: TaxIdentifierStatus; + type?: TaxIdentifierType; } // @public -export type ProductsListByInvoiceSectionNextResponse = ProductsListResult; +export type TaxIdentifierStatus = string; // @public -export interface ProductsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { - filter?: string; +export type TaxIdentifierType = string; + +// @public +export interface Transaction extends ProxyResourceWithTags { + properties?: TransactionProperties; } // @public -export type ProductsListByInvoiceSectionResponse = ProductsListResult; +export type TransactionKind = string; // @public -export interface ProductsListResult { +export interface TransactionListResult { readonly nextLink?: string; - readonly totalCount?: number; - readonly value?: Product[]; + readonly value?: Transaction[]; } // @public -export interface ProductsMoveHeaders { - location?: string; - retryAfter?: number; +export interface TransactionProperties { + azureCreditApplied?: TransactionPropertiesAzureCreditApplied; + azurePlan?: string; + billingCurrency?: string; + billingProfileDisplayName?: any; + billingProfileId?: string; + consumptionCommitmentDecremented?: TransactionPropertiesConsumptionCommitmentDecremented; + creditType?: CreditType; + customerDisplayName?: string; + customerId?: string; + date?: Date; + discount?: number; + effectivePrice?: TransactionPropertiesEffectivePrice; + exchangeRate?: number; + invoice?: string; + invoiceId?: string; + invoiceSectionDisplayName?: string; + invoiceSectionId?: string; + isThirdParty?: boolean; + kind?: TransactionKind; + marketPrice?: TransactionPropertiesMarketPrice; + partNumber?: string; + pricingCurrency?: string; + productDescription?: string; + productFamily?: string; + productType?: string; + productTypeId?: string; + quantity?: number; + reasonCode?: string; + refundTransactionDetails?: TransactionPropertiesRefundTransactionDetails; + servicePeriodEndDate?: Date; + servicePeriodStartDate?: Date; + specialTaxationType?: SpecialTaxationType; + subTotal?: TransactionPropertiesSubTotal; + tax?: TransactionPropertiesTax; + transactionAmount?: TransactionPropertiesTransactionAmount; + transactionType?: string; + unitOfMeasure?: string; + units?: number; + unitType?: string; } // @public -export interface ProductsMoveOptionalParams extends coreClient.OperationOptions { +export interface TransactionPropertiesAzureCreditApplied extends Amount { } // @public -export type ProductsMoveResponse = Product; +export interface TransactionPropertiesConsumptionCommitmentDecremented extends Amount { +} // @public -export type ProductStatusType = string; +export interface TransactionPropertiesEffectivePrice extends Amount { +} // @public -export interface ProductsUpdateOptionalParams extends coreClient.OperationOptions { +export interface TransactionPropertiesMarketPrice extends Amount { } // @public -export type ProductsUpdateResponse = Product; +export interface TransactionPropertiesRefundTransactionDetails extends RefundTransactionDetails { +} // @public -export interface ProductsValidateMoveOptionalParams extends coreClient.OperationOptions { +export interface TransactionPropertiesSubTotal extends Amount { } // @public -export type ProductsValidateMoveResponse = ValidateProductTransferEligibilityResult; +export interface TransactionPropertiesTax extends Amount { +} // @public -export type ProductTransferValidationErrorCode = string; +export interface TransactionPropertiesTransactionAmount extends Amount { +} // @public -export interface RebillDetails { - readonly creditNoteDocumentId?: string; - readonly invoiceDocumentId?: string; - readonly rebillDetails?: { - [propertyName: string]: RebillDetails; - }; +export interface Transactions { + beginTransactionsDownloadByInvoice(billingAccountName: string, invoiceName: string, options?: TransactionsTransactionsDownloadByInvoiceOptionalParams): Promise, TransactionsTransactionsDownloadByInvoiceResponse>>; + beginTransactionsDownloadByInvoiceAndWait(billingAccountName: string, invoiceName: string, options?: TransactionsTransactionsDownloadByInvoiceOptionalParams): Promise; + getTransactionSummaryByInvoice(billingAccountName: string, invoiceName: string, options?: TransactionsGetTransactionSummaryByInvoiceOptionalParams): Promise; + listByBillingProfile(billingAccountName: string, billingProfileName: string, periodStartDate: Date, periodEndDate: Date, typeParam: TransactionType, options?: TransactionsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByCustomer(billingAccountName: string, billingProfileName: string, customerName: string, periodStartDate: Date, periodEndDate: Date, typeParam: TransactionType, options?: TransactionsListByCustomerOptionalParams): PagedAsyncIterableIterator; + listByInvoice(billingAccountName: string, invoiceName: string, options?: TransactionsListByInvoiceOptionalParams): PagedAsyncIterableIterator; + listByInvoiceSection(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, periodStartDate: Date, periodEndDate: Date, typeParam: TransactionType, options?: TransactionsListByInvoiceSectionOptionalParams): PagedAsyncIterableIterator; } // @public -export interface Reseller { - readonly description?: string; - readonly resellerId?: string; +export interface TransactionsGetTransactionSummaryByInvoiceOptionalParams extends coreClient.OperationOptions { + filter?: string; + search?: string; } // @public -export interface Reservation { - appliedScopes?: string[]; - readonly appliedScopeType?: string; - readonly displayName?: string; - readonly displayProvisioningState?: string; - readonly effectiveDateTime?: string; - readonly expiryDate?: string; - readonly id?: string; - readonly location?: string; - readonly name?: string; - readonly provisioningState?: string; - readonly provisioningSubState?: string; - readonly quantity?: number; - readonly renew?: boolean; - readonly renewSource?: string; - readonly reservedResourceType?: string; - sku?: ReservationSkuProperty; - readonly skuDescription?: string; - readonly term?: string; - readonly type?: string; - readonly userFriendlyAppliedScopeType?: string; - readonly userFriendlyRenewState?: string; - readonly utilization?: ReservationPropertyUtilization; -} +export type TransactionsGetTransactionSummaryByInvoiceResponse = TransactionSummary; // @public -export interface ReservationPropertyUtilization { - aggregates?: ReservationUtilizationAggregates[]; - readonly trend?: string; +export interface TransactionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { } // @public -export type ReservationPurchasesPolicy = string; +export type TransactionsListByBillingProfileNextResponse = TransactionListResult; // @public -export interface Reservations { - listByBillingAccount(billingAccountName: string, options?: ReservationsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; - listByBillingProfile(billingAccountName: string, billingProfileName: string, options?: ReservationsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; +export interface TransactionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export interface ReservationSkuProperty { - readonly name?: string; -} +export type TransactionsListByBillingProfileResponse = TransactionListResult; // @public -export interface ReservationsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - orderby?: string; - refreshSummary?: string; - selectedState?: string; +export interface TransactionsListByCustomerNextOptionalParams extends coreClient.OperationOptions { } // @public -export type ReservationsListByBillingAccountNextResponse = ReservationsListResult; +export type TransactionsListByCustomerNextResponse = TransactionListResult; // @public -export interface ReservationsListByBillingAccountOptionalParams extends coreClient.OperationOptions { +export interface TransactionsListByCustomerOptionalParams extends coreClient.OperationOptions { + count?: boolean; filter?: string; - orderby?: string; - refreshSummary?: string; - selectedState?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export type ReservationsListByBillingAccountResponse = ReservationsListResult; +export type TransactionsListByCustomerResponse = TransactionListResult; // @public -export interface ReservationsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - orderby?: string; - refreshSummary?: string; - selectedState?: string; +export interface TransactionsListByInvoiceNextOptionalParams extends coreClient.OperationOptions { } // @public -export type ReservationsListByBillingProfileNextResponse = ReservationsListResult; +export type TransactionsListByInvoiceNextResponse = TransactionListResult; // @public -export interface ReservationsListByBillingProfileOptionalParams extends coreClient.OperationOptions { +export interface TransactionsListByInvoiceOptionalParams extends coreClient.OperationOptions { + count?: boolean; filter?: string; - orderby?: string; - refreshSummary?: string; - selectedState?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export type ReservationsListByBillingProfileResponse = ReservationsListResult; +export type TransactionsListByInvoiceResponse = TransactionListResult; // @public -export interface ReservationsListResult { - readonly nextLink?: string; - summary?: ReservationSummary; - readonly value?: Reservation[]; +export interface TransactionsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface ReservationSummary { - readonly cancelledCount?: number; - readonly expiredCount?: number; - readonly expiringCount?: number; - readonly failedCount?: number; - readonly pendingCount?: number; - readonly succeededCount?: number; +export type TransactionsListByInvoiceSectionNextResponse = TransactionListResult; + +// @public +export interface TransactionsListByInvoiceSectionOptionalParams extends coreClient.OperationOptions { + count?: boolean; + filter?: string; + orderBy?: string; + search?: string; + skip?: number; + top?: number; } // @public -export type ReservationType = string; +export type TransactionsListByInvoiceSectionResponse = TransactionListResult; // @public -export interface ReservationUtilizationAggregates { - readonly grain?: number; - readonly grainUnit?: string; - readonly value?: number; - readonly valueUnit?: string; +export interface TransactionsTransactionsDownloadByInvoiceHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; } // @public -export interface Resource { - readonly id?: string; - readonly name?: string; - readonly type?: string; +export interface TransactionsTransactionsDownloadByInvoiceOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type SpendingLimit = string; +export type TransactionsTransactionsDownloadByInvoiceResponse = DocumentDownloadResult; // @public -export type SpendingLimitForBillingProfile = string; +export interface TransactionSummary { + readonly azureCreditApplied?: number; + readonly billingCurrency?: string; + readonly consumptionCommitmentDecremented?: number; + readonly subTotal?: number; + readonly tax?: number; + readonly total?: number; +} // @public -export type StatusReasonCode = string; +export type TransactionType = string; // @public -export type StatusReasonCodeForBillingProfile = string; +export interface TransferDetails extends ProxyResourceWithTags { + readonly canceledBy?: string; + readonly detailedTransferStatus?: DetailedTransferStatus[]; + readonly expirationTime?: Date; + readonly initiatorEmailId?: string; + readonly recipientEmailId?: string; + readonly transferStatus?: TransferStatus; +} // @public -export type SubscriptionTransferValidationErrorCode = string; +export interface TransferDetailsListResult { + readonly nextLink?: string; + readonly value?: TransferDetails[]; +} // @public -export type TargetCloud = string; +export interface TransferError { + readonly code?: string; + readonly message?: string; +} // @public -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 productType?: string; - readonly productTypeId?: string; - readonly quantity?: number; - readonly servicePeriodEndDate?: Date; - readonly servicePeriodStartDate?: Date; - readonly subscriptionId?: string; - readonly subscriptionName?: string; - readonly subTotal?: Amount; - readonly tax?: Amount; - readonly transactionAmount?: Amount; - transactionType?: ReservationType; - readonly unitOfMeasure?: string; - readonly units?: number; - readonly unitType?: string; +export interface TransferItemQueryParameter { + state?: string; } // @public -export interface TransactionListResult { - readonly nextLink?: string; - readonly totalCount?: number; - readonly value?: Transaction[]; +export interface Transfers { + cancel(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, transferName: string, options?: TransfersCancelOptionalParams): Promise; + get(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, transferName: string, options?: TransfersGetOptionalParams): Promise; + initiate(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, transferName: string, parameters: InitiateTransferRequest, options?: TransfersInitiateOptionalParams): Promise; + list(billingAccountName: string, billingProfileName: string, invoiceSectionName: string, options?: TransfersListOptionalParams): PagedAsyncIterableIterator; } // @public -export interface Transactions { - listByInvoice(billingAccountName: string, invoiceName: string, options?: TransactionsListByInvoiceOptionalParams): PagedAsyncIterableIterator; +export interface TransfersCancelOptionalParams extends coreClient.OperationOptions { } // @public -export interface TransactionsListByInvoiceNextOptionalParams extends coreClient.OperationOptions { +export type TransfersCancelResponse = TransferDetails; + +// @public +export interface TransfersGetOptionalParams extends coreClient.OperationOptions { } // @public -export type TransactionsListByInvoiceNextResponse = TransactionListResult; +export type TransfersGetResponse = TransferDetails; // @public -export interface TransactionsListByInvoiceOptionalParams extends coreClient.OperationOptions { +export interface TransfersInitiateOptionalParams extends coreClient.OperationOptions { } // @public -export type TransactionsListByInvoiceResponse = TransactionListResult; +export type TransfersInitiateResponse = TransferDetails; + +// @public +export interface TransfersListNextOptionalParams extends coreClient.OperationOptions { +} // @public -export type TransactionTypeKind = string; +export type TransfersListNextResponse = TransferDetailsListResult; // @public -export interface TransferBillingSubscriptionRequestProperties { - destinationInvoiceSectionId: string; +export interface TransfersListOptionalParams extends coreClient.OperationOptions { } // @public -export interface TransferProductRequestProperties { - destinationInvoiceSectionId?: string; -} +export type TransfersListResponse = TransferDetailsListResult; + +// @public +export type TransferStatus = string; // @public -export interface ValidateAddressResponse { - status?: AddressValidationStatus; - suggestedAddresses?: AddressDetails[]; - validationMessage?: string; +export interface TransitionDetails { + readonly anniversaryDay?: number; + readonly transitionDate?: Date; } // @public -export interface ValidateProductTransferEligibilityError { - code?: ProductTransferValidationErrorCode; - details?: string; - message?: string; +export interface Utilization { + aggregates?: UtilizationAggregates[]; + readonly trend?: string; } // @public -export interface ValidateProductTransferEligibilityResult { - errorDetails?: ValidateProductTransferEligibilityError; - readonly isMoveEligible?: boolean; +export interface UtilizationAggregates { + readonly grain?: number; + readonly grainUnit?: string; + readonly value?: number; + readonly valueUnit?: string; } // @public -export interface ValidateSubscriptionTransferEligibilityError { - code?: SubscriptionTransferValidationErrorCode; - details?: string; - message?: string; +export interface ValidateTransferListResponse { + readonly value?: ValidateTransferResponse[]; } // @public -export interface ValidateSubscriptionTransferEligibilityResult { - errorDetails?: ValidateSubscriptionTransferEligibilityError; - readonly isMoveEligible?: boolean; +export interface ValidateTransferResponse { + readonly productId?: string; + results?: ValidationResultProperties[]; + readonly status?: string; } // @public -export type ViewCharges = string; +export interface ValidationResultProperties { + readonly code?: string; + readonly level?: string; + readonly message?: string; +} // @public export type ViewChargesPolicy = string; diff --git a/sdk/billing/arm-billing/samples-dev/addressValidateSample.ts b/sdk/billing/arm-billing/samples-dev/addressValidateSample.ts index 40559ca6b5be..a7fcdaee3ade 100644 --- a/sdk/billing/arm-billing/samples-dev/addressValidateSample.ts +++ b/sdk/billing/arm-billing/samples-dev/addressValidateSample.ts @@ -10,49 +10,53 @@ // Licensed under the MIT License. import { AddressDetails, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. * * @summary Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressInvalid.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateInvalid.json */ -async function addressInvalid() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const address: AddressDetails = { +async function addressValidateInvalid() { + const parameters: AddressDetails = { addressLine1: "1 Test", city: "bellevue", country: "us", postalCode: "12345", - region: "wa" + region: "wa", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.address.validate(address); + const client = new BillingManagementClient(credential); + const result = await client.address.validate(parameters); console.log(result); } -addressInvalid().catch(console.error); - /** * This sample demonstrates how to Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. * * @summary Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressValid.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateValid.json */ -async function addressValid() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const address: AddressDetails = { - addressLine1: "1 Test Address", +async function addressValidateValid() { + const parameters: AddressDetails = { + addressLine1: "1 Test", city: "bellevue", country: "us", postalCode: "12345", - region: "wa" + region: "wa", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.address.validate(address); + const client = new BillingManagementClient(credential); + const result = await client.address.validate(parameters); console.log(result); } -addressValid().catch(console.error); +async function main() { + addressValidateInvalid(); + addressValidateValid(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/agreementsGetSample.ts b/sdk/billing/arm-billing/samples-dev/agreementsGetSample.ts index adce5f1a5ee4..4bc72afb1a3f 100644 --- a/sdk/billing/arm-billing/samples-dev/agreementsGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/agreementsGetSample.ts @@ -10,21 +10,28 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an agreement by ID. * * @summary Gets an agreement by ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementByName.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementByName.json */ async function agreementByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const agreementName = "{agreementName}"; + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const agreementName = "ABC123"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.agreements.get(billingAccountName, agreementName); console.log(result); } -agreementByName().catch(console.error); +async function main() { + agreementByName(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/agreementsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/agreementsListByBillingAccountSample.ts index 2a65d902201a..8c2616a5d341 100644 --- a/sdk/billing/arm-billing/samples-dev/agreementsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/agreementsListByBillingAccountSample.ts @@ -8,27 +8,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; +import { + AgreementsListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the agreements for a billing account. * * @summary Lists the agreements for a billing account. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementsListByBillingAccount.json */ async function agreementsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const expand = "Participants"; + const options: AgreementsListByBillingAccountOptionalParams = { expand }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.agreements.listByBillingAccount( - billingAccountName + billingAccountName, + options, )) { resArray.push(item); } console.log(resArray); } -agreementsListByBillingAccount().catch(console.error); +async function main() { + agreementsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/associatedTenantsCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/associatedTenantsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..5e472e7264ca --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/associatedTenantsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AssociatedTenant, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update an associated tenant for the billing account. + * + * @summary Create or update an associated tenant for the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsCreateOrUpdate.json + */ +async function associatedTenantsCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const associatedTenantName = "11111111-1111-1111-1111-111111111111"; + const parameters: AssociatedTenant = { + properties: { + billingManagementState: "Active", + displayName: "Contoso Finance", + provisioningManagementState: "Pending", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.associatedTenants.beginCreateOrUpdateAndWait( + billingAccountName, + associatedTenantName, + parameters, + ); + console.log(result); +} + +async function main() { + associatedTenantsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/associatedTenantsDeleteSample.ts b/sdk/billing/arm-billing/samples-dev/associatedTenantsDeleteSample.ts new file mode 100644 index 000000000000..7ea79852d50e --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/associatedTenantsDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes an associated tenant for a billing account. + * + * @summary Deletes an associated tenant for a billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsDelete.json + */ +async function associatedTenantsDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const associatedTenantName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.associatedTenants.beginDeleteAndWait( + billingAccountName, + associatedTenantName, + ); + console.log(result); +} + +async function main() { + associatedTenantsDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/associatedTenantsGetSample.ts b/sdk/billing/arm-billing/samples-dev/associatedTenantsGetSample.ts new file mode 100644 index 000000000000..ba8048a2b301 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/associatedTenantsGetSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets an associated tenant by ID. + * + * @summary Gets an associated tenant by ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsGet.json + */ +async function associatedTenantsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const associatedTenantName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.associatedTenants.get( + billingAccountName, + associatedTenantName, + ); + console.log(result); +} + +async function main() { + associatedTenantsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/associatedTenantsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/associatedTenantsListByBillingAccountSample.ts new file mode 100644 index 000000000000..ea933921e919 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/associatedTenantsListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the associated tenants that can collaborate with the billing account on commerce activities like viewing and downloading invoices, managing payments, making purchases, and managing or provisioning licenses. + * + * @summary Lists the associated tenants that can collaborate with the billing account on commerce activities like viewing and downloading invoices, managing payments, making purchases, and managing or provisioning licenses. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsListByBillingAccount.json + */ +async function associatedTenantsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.associatedTenants.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + associatedTenantsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/availableBalancesGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/availableBalancesGetByBillingAccountSample.ts new file mode 100644 index 000000000000..06bd9aa2fc58 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/availableBalancesGetByBillingAccountSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The Available Credit or Payment on Account Balance for a billing account. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Online Services Program. + * + * @summary The Available Credit or Payment on Account Balance for a billing account. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Online Services Program. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingAccount.json + */ +async function availableBalanceGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.availableBalances.getByBillingAccount(billingAccountName); + console.log(result); +} + +async function main() { + availableBalanceGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/availableBalancesGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/availableBalancesGetByBillingProfileSample.ts new file mode 100644 index 000000000000..86b75a1c3b96 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/availableBalancesGetByBillingProfileSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingProfile.json + */ +async function availableBalanceGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.availableBalances.getByBillingProfile( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + availableBalanceGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/availableBalancesGetSample.ts b/sdk/billing/arm-billing/samples-dev/availableBalancesGetSample.ts deleted file mode 100644 index 6918777ee0d5..000000000000 --- a/sdk/billing/arm-billing/samples-dev/availableBalancesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json - */ -async function availableBalanceByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.availableBalances.get( - billingAccountName, - billingProfileName - ); - console.log(result); -} - -availableBalanceByBillingProfile().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingAccountsAddPaymentTermsSample.ts b/sdk/billing/arm-billing/samples-dev/billingAccountsAddPaymentTermsSample.ts new file mode 100644 index 000000000000..04d666172963 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingAccountsAddPaymentTermsSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PaymentTerm, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action. + * + * @summary Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsAdd.json + */ +async function paymentTermsAdd() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: PaymentTerm[] = [ + { + endDate: new Date("2023-01-25T22:39:34.2606750Z"), + startDate: new Date("2023-01-05T22:39:34.2606750Z"), + term: "net10", + }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginAddPaymentTermsAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + paymentTermsAdd(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingAccountsCancelPaymentTermsSample.ts b/sdk/billing/arm-billing/samples-dev/billingAccountsCancelPaymentTermsSample.ts new file mode 100644 index 000000000000..44cf645955ba --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingAccountsCancelPaymentTermsSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action. + * + * @summary Cancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsCancel.json + */ +async function paymentTermsCancel() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: Date = new Date("2023-01-05T22:39:34.2606750Z"); + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginCancelPaymentTermsAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + paymentTermsCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingAccountsConfirmTransitionSample.ts b/sdk/billing/arm-billing/samples-dev/billingAccountsConfirmTransitionSample.ts new file mode 100644 index 000000000000..90ae8eeaf536 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingAccountsConfirmTransitionSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. + * + * @summary Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsConfirmTransition.json + */ +async function billingAccountsConfirmTransition() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingAccounts.confirmTransition(billingAccountName); + console.log(result); +} + +async function main() { + billingAccountsConfirmTransition(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingAccountsGetSample.ts b/sdk/billing/arm-billing/samples-dev/billingAccountsGetSample.ts index e30b6cbd58d0..049f8ea3eda2 100644 --- a/sdk/billing/arm-billing/samples-dev/billingAccountsGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingAccountsGetSample.ts @@ -8,44 +8,107 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { - BillingAccountsGetOptionalParams, - BillingManagementClient -} from "@azure/arm-billing"; +import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithExpandForPONumber.json + */ +async function billingAccountWithExpandForPoNumber() { + const billingAccountName = "8608480"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} /** * This sample demonstrates how to Gets a billing account by its ID. * * @summary Gets a billing account by its ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountWithExpand.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithRegistrationNumberWithDefaultType.json */ -async function billingAccountWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const expand = "soldTo,billingProfiles,billingProfiles/invoiceSections"; - const options: BillingAccountsGetOptionalParams = { expand }; +async function billingAccountWithRegistrationNumberWithDefaultType() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingAccounts.get(billingAccountName, options); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); console.log(result); } -billingAccountWithExpand().catch(console.error); +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithRegistrationNumberWithType.json + */ +async function billingAccountWithRegistrationNumberWithType() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} /** * This sample demonstrates how to Gets a billing account by its ID. * * @summary Gets a billing account by its ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGet.json */ -async function billingAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingAccountsGet() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingAccounts.get(billingAccountName); console.log(result); } -billingAccounts().catch(console.error); +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGetEA.json + */ +async function billingAccountsGetEa() { + const billingAccountName = "6575495"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGetWithExpand.json + */ +async function billingAccountsGetWithExpand() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +async function main() { + billingAccountWithExpandForPoNumber(); + billingAccountWithRegistrationNumberWithDefaultType(); + billingAccountWithRegistrationNumberWithType(); + billingAccountsGet(); + billingAccountsGetEa(); + billingAccountsGetWithExpand(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts b/sdk/billing/arm-billing/samples-dev/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts index 880d33491f59..e74124e19809 100644 --- a/sdk/billing/arm-billing/samples-dev/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListWithCreateSubPermission.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsWithCreateSubscriptionPermissionList.json */ -async function invoiceSectionsListWithCreateSubPermission() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function invoiceSectionsWithCreateSubscriptionPermissionList() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingAccounts.listInvoiceSectionsByCreateSubscriptionPermission( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionsListWithCreateSubPermission().catch(console.error); +async function main() { + invoiceSectionsWithCreateSubscriptionPermissionList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingAccountsListSample.ts b/sdk/billing/arm-billing/samples-dev/billingAccountsListSample.ts index 764719e4784e..e68b46daed1a 100644 --- a/sdk/billing/arm-billing/samples-dev/billingAccountsListSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingAccountsListSample.ts @@ -10,20 +10,22 @@ // Licensed under the MIT License. import { BillingAccountsListOptionalParams, - BillingManagementClient + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the billing accounts that a user has access to. * * @summary Lists the billing accounts that a user has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountForLegacyAccountDetails.json */ -async function billingAccountsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; +async function billingAccountForLegacyAccountDetails() { const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingAccounts.list()) { resArray.push(item); @@ -31,41 +33,33 @@ async function billingAccountsList() { console.log(resArray); } -billingAccountsList().catch(console.error); - /** * This sample demonstrates how to Lists the billing accounts that a user has access to. * * @summary Lists the billing accounts that a user has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpand.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsList.json */ -async function billingAccountsListWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "soldTo,billingProfiles,billingProfiles/invoiceSections"; - const options: BillingAccountsListOptionalParams = { expand }; +async function billingAccountsList() { const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingAccounts.list(options)) { + for await (let item of client.billingAccounts.list()) { resArray.push(item); } console.log(resArray); } -billingAccountsListWithExpand().catch(console.error); - /** * This sample demonstrates how to Lists the billing accounts that a user has access to. * * @summary Lists the billing accounts that a user has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpandForEnrollmentDetails.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsListWithExpandForPONumber.json */ -async function billingAccountsListWithExpandForEnrollmentDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "enrollmentDetails,departments,enrollmentAccounts"; +async function billingAccountsListWithExpandForPoNumber() { + const expand = "soldTo,enrollmentDetails/poNumber"; const options: BillingAccountsListOptionalParams = { expand }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingAccounts.list(options)) { resArray.push(item); @@ -73,4 +67,10 @@ async function billingAccountsListWithExpandForEnrollmentDetails() { console.log(resArray); } -billingAccountsListWithExpandForEnrollmentDetails().catch(console.error); +async function main() { + billingAccountForLegacyAccountDetails(); + billingAccountsList(); + billingAccountsListWithExpandForPoNumber(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingAccountsUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/billingAccountsUpdateSample.ts index e21553695cb6..7eecd8edd93a 100644 --- a/sdk/billing/arm-billing/samples-dev/billingAccountsUpdateSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingAccountsUpdateSample.ts @@ -9,40 +9,68 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - BillingAccountUpdateRequest, - BillingManagementClient + BillingAccountPatch, + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * + * @summary Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountUpdateWithPONumber.json + */ +async function billingAccountUpdateWithPoNumber() { + const billingAccountName = "6575495"; + const parameters: BillingAccountPatch = { + properties: { enrollmentDetails: { poNumber: "poNumber123" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginUpdateAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} /** - * This sample demonstrates how to Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * This sample demonstrates how to Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. * - * @summary Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.json + * @summary Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsUpdate.json */ -async function updateBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const parameters: BillingAccountUpdateRequest = { - displayName: "Test Account", - soldTo: { - addressLine1: "Test Address 1", - city: "Redmond", - companyName: "Contoso", - country: "US", - firstName: "Test", - lastName: "User", - postalCode: "12345", - region: "WA" - } +async function billingAccountsUpdate() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: BillingAccountPatch = { + properties: { + displayName: "Test Account", + soldTo: { + addressLine1: "1 Microsoft Way", + city: "Redmond", + companyName: "Contoso", + country: "US", + postalCode: "98052-8300", + region: "WA", + }, + }, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingAccounts.beginUpdateAndWait( billingAccountName, - parameters + parameters, ); console.log(result); } -updateBillingAccount().catch(console.error); +async function main() { + billingAccountUpdateWithPoNumber(); + billingAccountsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingAccountsValidatePaymentTermsSample.ts b/sdk/billing/arm-billing/samples-dev/billingAccountsValidatePaymentTermsSample.ts new file mode 100644 index 000000000000..3cbf3ca9be37 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingAccountsValidatePaymentTermsSample.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PaymentTerm, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * + * @summary Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermInvalid.json + */ +async function paymentTermInvalid() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: PaymentTerm[] = [ + { + endDate: new Date("2023-01-25T22:39:34.2606750Z"), + startDate: new Date("2023-02-05T22:39:34.2606750Z"), + term: "net10", + }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.validatePaymentTerms( + billingAccountName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * + * @summary Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermValid.json + */ +async function paymentTermValid() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: PaymentTerm[] = [ + { + endDate: new Date("2023-01-25T22:39:34.2606750Z"), + startDate: new Date("2023-01-05T22:39:34.2606750Z"), + term: "net10", + }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.validatePaymentTerms( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + paymentTermInvalid(); + paymentTermValid(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPeriodsGetSample.ts b/sdk/billing/arm-billing/samples-dev/billingPeriodsGetSample.ts deleted file mode 100644 index eabc4475bf66..000000000000 --- a/sdk/billing/arm-billing/samples-dev/billingPeriodsGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @summary Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json - */ -async function billingPeriodsGet() { - const subscriptionId = "subid"; - const billingPeriodName = "201702-1"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingPeriods.get(billingPeriodName); - console.log(result); -} - -billingPeriodsGet().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPeriodsListSample.ts b/sdk/billing/arm-billing/samples-dev/billingPeriodsListSample.ts deleted file mode 100644 index d65aa789d2c2..000000000000 --- a/sdk/billing/arm-billing/samples-dev/billingPeriodsListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the available billing periods for a subscription in reverse chronological order. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @summary Lists the available billing periods for a subscription in reverse chronological order. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json - */ -async function billingPeriodsList() { - const subscriptionId = "subid"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingPeriods.list()) { - resArray.push(item); - } - console.log(resArray); -} - -billingPeriodsList().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByBillingAccountSample.ts new file mode 100644 index 000000000000..511a516950bc --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByBillingAccountSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a billing account. + * + * @summary Provides a list of check access response objects for a billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingAccount.json + */ +async function checkAccessByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByBillingAccount( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByBillingProfileSample.ts new file mode 100644 index 000000000000..dd697f0a896b --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByBillingProfileSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a billing profile. + * + * @summary Provides a list of check access response objects for a billing profile. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingProfile.json + */ +async function checkAccessByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByBillingProfile( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByCustomerSample.ts new file mode 100644 index 000000000000..5c4935a3b925 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByCustomerSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a customer. + * + * @summary Provides a list of check access response objects for a customer. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByCustomer.json + */ +async function checkAccessByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByCustomer( + billingAccountName, + billingProfileName, + customerName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByDepartmentSample.ts new file mode 100644 index 000000000000..269641df9f54 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByDepartmentSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a department. + * + * @summary Provides a list of check access response objects for a department. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByDepartment.json + */ +async function checkAccessByDepartment() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const departmentName = "12345"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByDepartment( + billingAccountName, + departmentName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..945abfc76c12 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByEnrollmentAccountSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for an enrollment account. + * + * @summary Provides a list of check access response objects for an enrollment account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByEnrollmentAccount.json + */ +async function checkAccessByEnrollmentAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const enrollmentAccountName = "123456"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByInvoiceSectionSample.ts new file mode 100644 index 000000000000..c4b87d49819f --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsCheckAccessByInvoiceSectionSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for an invoice section. + * + * @summary Provides a list of check access response objects for an invoice section. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByInvoiceSection.json + */ +async function checkAccessByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "Q7GV-UUVA-PJA-TGB"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByBillingAccountSample.ts index 7c4af9d13da8..f414fe38902f 100644 --- a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByBillingAccountSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the billing permissions the caller has on a billing account. * * @summary Lists the billing permissions the caller has on a billing account. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountPermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingAccount.json */ -async function billingAccountPermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingPermissionsListByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingPermissions.listByBillingAccount( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -billingAccountPermissionsList().catch(console.error); +async function main() { + billingPermissionsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByBillingProfileSample.ts index d7e1896ff12b..fc8b76061da2 100644 --- a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the billing permissions the caller has on a billing profile. * * @summary Lists the billing permissions the caller has on a billing profile. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilePermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingProfile.json */ -async function billingProfilePermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingPermissionsListByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingPermissions.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingProfilePermissionsList().catch(console.error); +async function main() { + billingPermissionsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByCustomerAtBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByCustomerAtBillingAccountSample.ts new file mode 100644 index 000000000000..857fef954195 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByCustomerAtBillingAccountSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billing permissions the caller has for a customer at billing account level. + * + * @summary Lists the billing permissions the caller has for a customer at billing account level. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomerAtBillingAccount.json + */ +async function billingPermissionsListByCustomerAtBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingPermissions.listByCustomerAtBillingAccount( + billingAccountName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingPermissionsListByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByCustomerSample.ts index 408366edc7a8..7268ce0ea0cf 100644 --- a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByCustomerSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByCustomerSample.ts @@ -10,27 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the billing permissions the caller has for a customer. * * @summary Lists the billing permissions the caller has for a customer. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomer.json */ -async function billingProfilePermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; +async function billingPermissionsListByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingPermissions.listByCustomer( billingAccountName, - customerName + billingProfileName, + customerName, )) { resArray.push(item); } console.log(resArray); } -billingProfilePermissionsList().catch(console.error); +async function main() { + billingPermissionsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByDepartmentSample.ts new file mode 100644 index 000000000000..6920bc8cdda4 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByDepartmentSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billing permissions the caller has for a department. + * + * @summary Lists the billing permissions the caller has for a department. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByDepartment.json + */ +async function billingPermissionsListByDepartment() { + const billingAccountName = "6100092"; + const departmentName = "123456"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingPermissions.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingPermissionsListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..5fc496625281 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billing permissions the caller has for an enrollment account. + * + * @summary Lists the billing permissions the caller has for an enrollment account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByEnrollmentAccount.json + */ +async function billingPermissionsListByEnrollmentAccount() { + const billingAccountName = "6100092"; + const enrollmentAccountName = "123456"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingPermissions.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingPermissionsListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByInvoiceSectionsSample.ts b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByInvoiceSectionSample.ts similarity index 53% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByInvoiceSectionsSample.ts rename to sdk/billing/arm-billing/samples-dev/billingPermissionsListByInvoiceSectionSample.ts index 38ae8df41b00..1ea4ca78c93c 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByInvoiceSectionsSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingPermissionsListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the billing permissions the caller has on an invoice section. + * This sample demonstrates how to Lists the billing permissions the caller has for an invoice section. * - * @summary Lists the billing permissions the caller has on an invoice section. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json + * @summary Lists the billing permissions the caller has for an invoice section. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByInvoiceSection.json */ -async function invoiceSectionPermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function billingPermissionsListByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "XXXX-XXXX-XXX-XXX"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingPermissions.listByInvoiceSections( + for await (let item of client.billingPermissions.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionPermissionsList().catch(console.error); +async function main() { + billingPermissionsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingProfilesCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/billingProfilesCreateOrUpdateSample.ts index 57f95ff7785b..9bdaca39956e 100644 --- a/sdk/billing/arm-billing/samples-dev/billingProfilesCreateOrUpdateSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingProfilesCreateOrUpdateSample.ts @@ -10,40 +10,70 @@ // Licensed under the MIT License. import { BillingProfile, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * This sample demonstrates how to Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. * - * @summary Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.json + * @summary Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesCreateOrUpdate.json */ -async function createBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingProfilesCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const parameters: BillingProfile = { - billTo: { - addressLine1: "Test Address 1", - city: "Redmond", - country: "US", - firstName: "Test", - lastName: "User", - postalCode: "12345", - region: "WA" + properties: { + billTo: { + addressLine1: "Test Address1", + addressLine2: "Test Address2", + addressLine3: "Test Address3", + city: "City", + companyName: "Contoso", + country: "US", + email: "abc@contoso.com", + firstName: "Test", + isValidAddress: true, + lastName: "User", + phoneNumber: "000-000-0000", + postalCode: "00000", + region: "WA", + }, + displayName: "Billing Profile 1", + enabledAzurePlans: [{ skuId: "0001" }, { skuId: "0002" }], + invoiceEmailOptIn: true, + poNumber: "ABC12345", + shipTo: { + addressLine1: "Test Address1", + addressLine2: "Test Address2", + addressLine3: "Test Address3", + city: "City", + companyName: "Contoso", + country: "US", + email: "abc@contoso.com", + firstName: "Test", + isValidAddress: true, + lastName: "User", + phoneNumber: "000-000-0000", + postalCode: "00000", + region: "WA", + }, }, - displayName: "Finance", - enabledAzurePlans: [{ skuId: "0001" }, { skuId: "0002" }], - invoiceEmailOptIn: true, - poNumber: "ABC12345" }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingProfiles.beginCreateOrUpdateAndWait( billingAccountName, billingProfileName, - parameters + parameters, ); console.log(result); } -createBillingProfile().catch(console.error); +async function main() { + billingProfilesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingProfilesDeleteSample.ts b/sdk/billing/arm-billing/samples-dev/billingProfilesDeleteSample.ts new file mode 100644 index 000000000000..9c4bc74377e1 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingProfilesDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Deletes a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesDelete.json + */ +async function billingProfilesDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.beginDeleteAndWait( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + billingProfilesDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingProfilesGetSample.ts b/sdk/billing/arm-billing/samples-dev/billingProfilesGetSample.ts index 03c4167088f7..5629bbecf259 100644 --- a/sdk/billing/arm-billing/samples-dev/billingProfilesGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingProfilesGetSample.ts @@ -8,53 +8,33 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { - BillingProfilesGetOptionalParams, - BillingManagementClient -} from "@azure/arm-billing"; +import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; -/** - * This sample demonstrates how to Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json - */ -async function billingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingProfiles.get( - billingAccountName, - billingProfileName - ); - console.log(result); -} - -billingProfile().catch(console.error); +dotenv.config(); /** - * This sample demonstrates how to Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * This sample demonstrates how to Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. * - * @summary Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileWithExpand.json + * @summary Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesGet.json */ -async function billingProfileWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const expand = "invoiceSections"; - const options: BillingProfilesGetOptionalParams = { expand }; +async function billingProfilesGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingProfiles.get( billingAccountName, billingProfileName, - options ); console.log(result); } -billingProfileWithExpand().catch(console.error); +async function main() { + billingProfilesGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingProfilesListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingProfilesListByBillingAccountSample.ts index b2db43b5a34c..bff24c0728d3 100644 --- a/sdk/billing/arm-billing/samples-dev/billingProfilesListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingProfilesListByBillingAccountSample.ts @@ -8,55 +8,34 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { - BillingProfilesListByBillingAccountOptionalParams, - BillingManagementClient -} from "@azure/arm-billing"; +import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * This sample demonstrates how to Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. * - * @summary Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json + * @summary Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesListByBillingAccount.json */ async function billingProfilesListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingProfiles.listByBillingAccount( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -billingProfilesListByBillingAccount().catch(console.error); - -/** - * This sample demonstrates how to Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListWithExpand.json - */ -async function billingProfilesListWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const expand = "invoiceSections"; - const options: BillingProfilesListByBillingAccountOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingProfiles.listByBillingAccount( - billingAccountName, - options - )) { - resArray.push(item); - } - console.log(resArray); +async function main() { + billingProfilesListByBillingAccount(); } -billingProfilesListWithExpand().catch(console.error); +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingProfilesValidateDeleteEligibilitySample.ts b/sdk/billing/arm-billing/samples-dev/billingProfilesValidateDeleteEligibilitySample.ts new file mode 100644 index 000000000000..d12626474c0f --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingProfilesValidateDeleteEligibilitySample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilityFailure.json + */ +async function billingProfilesValidateDeleteEligibilityFailure() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.validateDeleteEligibility( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilitySuccess.json + */ +async function billingProfilesValidateDeleteEligibilitySuccess() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.validateDeleteEligibility( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + billingProfilesValidateDeleteEligibilityFailure(); + billingProfilesValidateDeleteEligibilitySuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPropertyGetSample.ts b/sdk/billing/arm-billing/samples-dev/billingPropertyGetSample.ts index 8dc937bc98e7..1540619ac4c1 100644 --- a/sdk/billing/arm-billing/samples-dev/billingPropertyGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingPropertyGetSample.ts @@ -10,19 +10,62 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Get the billing properties for a subscription. This operation is not supported for billing accounts with agreement type Enterprise Agreement. + * This sample demonstrates how to Gets the billing properties for a subscription * - * @summary Get the billing properties for a subscription. This operation is not supported for billing accounts with agreement type Enterprise Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json + * @summary Gets the billing properties for a subscription + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMCA.json */ -async function billingProperty() { - const subscriptionId = "{subscriptionId}"; +async function billingPropertyGetMca() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); const client = new BillingManagementClient(credential, subscriptionId); const result = await client.billingPropertyOperations.get(); console.log(result); } -billingProperty().catch(console.error); +/** + * This sample demonstrates how to Gets the billing properties for a subscription + * + * @summary Gets the billing properties for a subscription + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMOSP.json + */ +async function billingPropertyGetMosp() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.get(); + console.log(result); +} + +/** + * This sample demonstrates how to Gets the billing properties for a subscription + * + * @summary Gets the billing properties for a subscription + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMPA.json + */ +async function billingPropertyGetMpa() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.get(); + console.log(result); +} + +async function main() { + billingPropertyGetMca(); + billingPropertyGetMosp(); + billingPropertyGetMpa(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPropertyUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/billingPropertyUpdateSample.ts index 16d701c70b78..b2e3c9543954 100644 --- a/sdk/billing/arm-billing/samples-dev/billingPropertyUpdateSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingPropertyUpdateSample.ts @@ -10,20 +10,61 @@ // Licensed under the MIT License. import { BillingProperty, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * + * @summary Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchCostCenter.json + */ +async function billingPropertyPatchCostCenter() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const parameters: BillingProperty = { properties: { costCenter: "1010" } }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.update(parameters); + console.log(result); +} /** - * This sample demonstrates how to Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * This sample demonstrates how to Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. * - * @summary Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.json + * @summary Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchSubscriptionServiceUsageAddress.json */ -async function updateBillingProperty() { - const subscriptionId = "{subscriptionId}"; - const parameters: BillingProperty = { costCenter: "1010" }; +async function billingPropertyPatchSubscriptionServiceUsageAddress() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const parameters: BillingProperty = { + properties: { + subscriptionServiceUsageAddress: { + addressLine1: "Address line 1", + addressLine2: "Address line 2", + city: "City", + country: "US", + firstName: "Jenny", + lastName: "Doe", + middleName: "Ann", + postalCode: "12345", + region: "State", + }, + }, + }; const credential = new DefaultAzureCredential(); const client = new BillingManagementClient(credential, subscriptionId); const result = await client.billingPropertyOperations.update(parameters); console.log(result); } -updateBillingProperty().catch(console.error); +async function main() { + billingPropertyPatchCostCenter(); + billingPropertyPatchSubscriptionServiceUsageAddress(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRequestsCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/billingRequestsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..22228cc29fad --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRequestsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingRequest, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update a billing request. + * + * @summary Create or update a billing request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsCreateOrUpdate.json + */ +async function billingRequestsCreateOrUpdate() { + const billingRequestName = "00000000-0000-0000-0000-000000000000"; + const parameters: BillingRequest = { + properties: { + type: "RoleAssignment", + additionalInformation: { roleId: "40000000-aaaa-bbbb-cccc-200000000006" }, + decisionReason: "New team member", + requestScope: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx", + status: "Pending", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRequests.beginCreateOrUpdateAndWait( + billingRequestName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRequestsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRequestsGetSample.ts b/sdk/billing/arm-billing/samples-dev/billingRequestsGetSample.ts new file mode 100644 index 000000000000..99ded34a0a2c --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRequestsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a billing request by its ID. + * + * @summary Gets a billing request by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsGet.json + */ +async function billingRequestsGet() { + const billingRequestName = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRequests.get(billingRequestName); + console.log(result); +} + +async function main() { + billingRequestsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRequestsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRequestsListByBillingAccountSample.ts new file mode 100644 index 000000000000..f63f81c5b96f --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRequestsListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the billing account. + * + * @summary The list of billing requests submitted for the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingAccount.json + */ +async function billingRequestsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRequestsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingRequestsListByBillingProfileSample.ts new file mode 100644 index 000000000000..22a3392c7e15 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRequestsListByBillingProfileSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the billing profile. + * + * @summary The list of billing requests submitted for the billing profile. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingProfile.json + */ +async function billingRequestsListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRequestsListByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingRequestsListByCustomerSample.ts new file mode 100644 index 000000000000..71757effb9cb --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRequestsListByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the customer. + * + * @summary The list of billing requests submitted for the customer. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByCustomer.json + */ +async function billingRequestsListByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRequestsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingRequestsListByInvoiceSectionSample.ts new file mode 100644 index 000000000000..d8de94919baf --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRequestsListByInvoiceSectionSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the invoice section. + * + * @summary The list of billing requests submitted for the invoice section. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByInvoiceSection.json + */ +async function billingRequestsListByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRequestsListByUserSample.ts b/sdk/billing/arm-billing/samples-dev/billingRequestsListByUserSample.ts new file mode 100644 index 000000000000..73cad45676ea --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRequestsListByUserSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRequestsListByUserOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted by a user. + * + * @summary The list of billing requests submitted by a user. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUser.json + */ +async function billingRequestsListByUser() { + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByUser()) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to The list of billing requests submitted by a user. + * + * @summary The list of billing requests submitted by a user. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUserWithFilter.json + */ +async function billingRequestsListByUserWithFilter() { + const filter = "properties/status eq 'Approved'"; + const options: BillingRequestsListByUserOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByUser(options)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByUser(); + billingRequestsListByUserWithFilter(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByBillingAccountSample.ts new file mode 100644 index 000000000000..e976e8220c45 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByBillingAccountSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignmentProperties, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingAccount.json + */ +async function billingRoleAssignmentCreateByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const parameters: BillingRoleAssignmentProperties = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateByBillingAccountAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByBillingProfileSample.ts new file mode 100644 index 000000000000..a2220c7af760 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByBillingProfileSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignmentProperties, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingProfile.json + */ +async function billingRoleAssignmentCreateByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const parameters: BillingRoleAssignmentProperties = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateByBillingProfileAndWait( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByCustomerSample.ts new file mode 100644 index 000000000000..dffe25ba06b0 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByCustomerSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignmentProperties, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByCustomer.json + */ +async function billingRoleAssignmentCreateByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const parameters: BillingRoleAssignmentProperties = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfileName/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateByCustomerAndWait( + billingAccountName, + billingProfileName, + customerName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByInvoiceSectionSample.ts new file mode 100644 index 000000000000..a0b063085006 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateByInvoiceSectionSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignmentProperties, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByInvoiceSection.json + */ +async function billingRoleAssignmentCreateByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const parameters: BillingRoleAssignmentProperties = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateByInvoiceSectionAndWait( + billingAccountName, + billingProfileName, + invoiceSectionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..3cdec0ef4268 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignment, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByBillingAccount.json + */ +async function billingRoleAssignmentCreateOrUpdateByBillingAccount() { + const billingAccountName = "7898901"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const parameters: BillingRoleAssignment = { + properties: { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/7898901/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db", + userEmailAddress: "john@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName, + billingRoleAssignmentName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateOrUpdateByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts new file mode 100644 index 000000000000..da024f8caa60 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignment, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByDepartment.json + */ +async function billingRoleAssignmentCreateOrUpdateByDepartment() { + const billingAccountName = "7898901"; + const departmentName = "12345"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const parameters: BillingRoleAssignment = { + properties: { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/7898901/departments/12345/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db", + userEmailAddress: "john@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateOrUpdateByDepartmentAndWait( + billingAccountName, + departmentName, + billingRoleAssignmentName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateOrUpdateByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..a1c4ea22baf2 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignment, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByEnrollmentAccount.json + */ +async function billingRoleAssignmentCreateOrUpdateByEnrollmentAccount() { + const billingAccountName = "7898901"; + const enrollmentAccountName = "123456"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const parameters: BillingRoleAssignment = { + properties: { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/123456/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db", + userEmailAddress: "john@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateOrUpdateByEnrollmentAccountAndWait( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateOrUpdateByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByBillingAccountSample.ts index 65e400154da8..5eba27cbaf4d 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByBillingAccountSample.ts @@ -10,24 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Deletes a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json + * @summary Deletes a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingAccount.json */ -async function billingAccountRoleAssignmentDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; +async function billingRoleAssignmentDeleteByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.deleteByBillingAccount( billingAccountName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -billingAccountRoleAssignmentDelete().catch(console.error); +async function main() { + billingRoleAssignmentDeleteByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByBillingProfileSample.ts index bc9f4a251bf6..002fe77e54aa 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByBillingProfileSample.ts @@ -10,26 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Deletes a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @summary Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json + * @summary Deletes a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingProfile.json */ -async function billingProfileRoleAssignmentDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; +async function billingRoleAssignmentDeleteByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.deleteByBillingProfile( billingAccountName, billingProfileName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -billingProfileRoleAssignmentDelete().catch(console.error); +async function main() { + billingRoleAssignmentDeleteByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByCustomerSample.ts new file mode 100644 index 000000000000..72e0db2af976 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByCustomer.json + */ +async function billingRoleAssignmentDeleteByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const billingRoleAssignmentName = + "30000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByCustomer( + billingAccountName, + billingProfileName, + customerName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByDepartmentSample.ts new file mode 100644 index 000000000000..3caf755bdc87 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByDepartmentSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Deletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByDepartment.json + */ +async function billingRoleAssignmentDeleteByDepartment() { + const billingAccountName = "8608480"; + const departmentName = "123456"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByDepartment( + billingAccountName, + departmentName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..4733265f550d --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Deletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByEnrollmentAccount.json + */ +async function billingRoleAssignmentDeleteByEnrollmentAccount() { + const billingAccountName = "8608480"; + const enrollmentAccountName = "123456"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts index 7cf6465dbb09..5b74decf0e4f 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts @@ -10,28 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * This sample demonstrates how to Deletes a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. * - * @summary Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json + * @summary Deletes a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByInvoiceSection.json */ -async function invoiceSectionRoleAssignmentDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; +async function billingRoleAssignmentDeleteByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.deleteByInvoiceSection( billingAccountName, billingProfileName, invoiceSectionName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -invoiceSectionRoleAssignmentDelete().catch(console.error); +async function main() { + billingRoleAssignmentDeleteByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByBillingAccountSample.ts index 57ee39d9b111..18e79133fee2 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByBillingAccountSample.ts @@ -10,24 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json + * @summary Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingAccount.json */ -async function billingAccountRoleAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentId}"; +async function billingRoleAssignmentGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.getByBillingAccount( billingAccountName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -billingAccountRoleAssignment().catch(console.error); +async function main() { + billingRoleAssignmentGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByBillingProfileSample.ts index 7934b433f796..9bd564bad462 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByBillingProfileSample.ts @@ -10,26 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignment.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingProfile.json */ -async function billingProfileRoleAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; +async function billingRoleAssignmentGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.getByBillingProfile( billingAccountName, billingProfileName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -billingProfileRoleAssignment().catch(console.error); +async function main() { + billingRoleAssignmentGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByCustomerSample.ts new file mode 100644 index 000000000000..38125293f9c2 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByCustomer.json + */ +async function billingRoleAssignmentGetByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const billingRoleAssignmentName = + "30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.getByCustomer( + billingAccountName, + billingProfileName, + customerName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentGetByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByDepartmentSample.ts new file mode 100644 index 000000000000..e1ae159003d9 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByDepartmentSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByDepartment.json + */ +async function billingRoleAssignmentGetByDepartment() { + const billingAccountName = "7898901"; + const departmentName = "225314"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.getByDepartment( + billingAccountName, + departmentName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentGetByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..65e5802f4e17 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByEnrollmentAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByEnrollmentAccount.json + */ +async function billingRoleAssignmentGetByEnrollmentAccount() { + const billingAccountName = "7898901"; + const enrollmentAccountName = "225314"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.getByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentGetByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByInvoiceSectionSample.ts index 83a803616be1..d9fb09ae6ca6 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsGetByInvoiceSectionSample.ts @@ -10,28 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignment.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByInvoiceSection.json */ -async function invoiceSectionRoleAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; +async function billingRoleAssignmentGetByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.getByInvoiceSection( billingAccountName, billingProfileName, invoiceSectionName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -invoiceSectionRoleAssignment().catch(console.error); +async function main() { + billingRoleAssignmentGetByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByBillingAccountSample.ts index b0dc5ff4cc65..38869fac24fc 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByBillingAccountSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json + * @summary Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingAccount.json */ -async function billingAccountRoleAssignmentList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingRoleAssignmentListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingRoleAssignments.listByBillingAccount( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -billingAccountRoleAssignmentList().catch(console.error); +async function main() { + billingRoleAssignmentListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByBillingProfileSample.ts index 43ff4f59546f..8b29f2474507 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @summary Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json + * @summary Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingProfile.json */ -async function billingProfileRoleAssignmentList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingRoleAssignmentListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingRoleAssignments.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingProfileRoleAssignmentList().catch(console.error); +async function main() { + billingRoleAssignmentListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByCustomerSample.ts new file mode 100644 index 000000000000..20008cc4835e --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByCustomer.json + */ +async function billingRoleAssignmentListByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleAssignments.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleAssignmentListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByDepartmentSample.ts new file mode 100644 index 000000000000..cfacc23f2f9e --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByDepartmentSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement. + * + * @summary Lists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByDepartment.json + */ +async function billingRoleAssignmentListByDepartment() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const departmentName = "12345"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleAssignments.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleAssignmentListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..4ddcf093ed9c --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement. + * + * @summary Lists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByEnrollmentAccount.json + */ +async function billingRoleAssignmentListByEnrollmentAccount() { + const billingAccountName = "6100092"; + const enrollmentAccountName = "123456"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleAssignments.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleAssignmentListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByInvoiceSectionSample.ts index 90cb75cf10c2..2f565c8d3843 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByInvoiceSection.json */ -async function invoiceSectionRoleAssignmentList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function billingRoleAssignmentListByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingRoleAssignments.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionRoleAssignmentList().catch(console.error); +async function main() { + billingRoleAssignmentListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByBillingAccountSample.ts new file mode 100644 index 000000000000..40576790479a --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByBillingAccountSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Lists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingAccount.json + */ +async function resolveBillingRoleAssignmentByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginResolveByBillingAccountAndWait( + billingAccountName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByBillingProfileSample.ts new file mode 100644 index 000000000000..ac33a1a8ad9c --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByBillingProfileSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on an billing profile while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Lists the role assignments for the caller on an billing profile while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingProfile.json + */ +async function resolveBillingRoleAssignmentByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginResolveByBillingProfileAndWait( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByCustomerSample.ts new file mode 100644 index 000000000000..591db02a6e34 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByCustomerSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByCustomer.json + */ +async function resolveBillingRoleAssignmentByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginResolveByCustomerAndWait( + billingAccountName, + billingProfileName, + customerName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByInvoiceSectionSample.ts new file mode 100644 index 000000000000..c09ea8111e78 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleAssignmentsResolveByInvoiceSectionSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on an invoice section while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists the role assignments for the caller on an invoice section while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByInvoiceSection.json + */ +async function resolveBillingRoleAssignmentByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginResolveByInvoiceSectionAndWait( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByBillingAccountSample.ts new file mode 100644 index 000000000000..fa03e7a78964 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingAccount.json + */ +async function billingRoleDefinitionGetByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const roleDefinitionName = "50000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleDefinitionOperations.getByBillingAccount( + billingAccountName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByBillingProfileSample.ts similarity index 56% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByBillingProfileSample.ts index a56808a90437..135693bd47a2 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByBillingProfileSample.ts @@ -10,26 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinition.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingProfile.json */ -async function billingProfileRoleDefinition() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const billingRoleDefinitionName = "{billingRoleDefinitionName}"; +async function billingRoleDefinitionGetByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const roleDefinitionName = "40000000-aaaa-bbbb-cccc-100000000000"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleDefinitions.getByBillingProfile( - billingAccountName, - billingProfileName, - billingRoleDefinitionName - ); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleDefinitionOperations.getByBillingProfile( + billingAccountName, + billingProfileName, + roleDefinitionName, + ); console.log(result); } -billingProfileRoleDefinition().catch(console.error); +async function main() { + billingRoleDefinitionGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByCustomerSample.ts new file mode 100644 index 000000000000..dc8a0d52f40f --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByCustomerSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the definition for a role on a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets the definition for a role on a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByCustomer.json + */ +async function billingRoleDefinitionGetByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const roleDefinitionName = "30000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByCustomer( + billingAccountName, + billingProfileName, + customerName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByDepartmentSample.ts new file mode 100644 index 000000000000..a7607aebe8b6 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByDepartmentSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the definition for a role on a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets the definition for a role on a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByDepartment.json + */ +async function billingRoleDefinitionGetByDepartment() { + const billingAccountName = "123456"; + const departmentName = "7368531"; + const roleDefinitionName = "50000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByDepartment( + billingAccountName, + departmentName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..b0097ae3075f --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the definition for a role on an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets the definition for a role on an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByEnrollmentAccount.json + */ +async function billingRoleDefinitionGetByEnrollmentAccount() { + const billingAccountName = "123456"; + const enrollmentAccountName = "4568789"; + const roleDefinitionName = "50000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleDefinitionOperations.getByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByInvoiceSectionSample.ts similarity index 52% rename from sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByInvoiceSectionSample.ts rename to sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByInvoiceSectionSample.ts index 0ea2696f3823..72c47b18fdba 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionGetByInvoiceSectionSample.ts @@ -10,28 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinition.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByInvoiceSection.json */ -async function invoiceSectionRoleDefinition() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; - const billingRoleDefinitionName = "{billingRoleDefinitionName}"; +async function billingRoleDefinitionGetByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const roleDefinitionName = "30000000-aaaa-bbbb-cccc-100000000000"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleDefinitions.getByInvoiceSection( - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleDefinitionName - ); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleDefinitionOperations.getByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + roleDefinitionName, + ); console.log(result); } -invoiceSectionRoleDefinition().catch(console.error); +async function main() { + billingRoleDefinitionGetByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByBillingAccountSample.ts similarity index 53% rename from sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsListByBillingAccountSample.ts rename to sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByBillingAccountSample.ts index 7f81f11cd3ba..fe658e921155 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByBillingAccountSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json + * @summary Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingAccount.json */ -async function billingAccountRoleDefinitionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingRoleDefinitionListByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingRoleDefinitions.listByBillingAccount( - billingAccountName + for await (let item of client.billingRoleDefinitionOperations.listByBillingAccount( + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -billingAccountRoleDefinitionsList().catch(console.error); +async function main() { + billingRoleDefinitionListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByBillingProfileSample.ts similarity index 52% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByBillingProfileSample.ts index 33ff2faa3864..14c624b4612d 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json + * @summary Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingProfile.json */ -async function billingProfileRoleDefinitionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingRoleDefinitionListByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingRoleDefinitions.listByBillingProfile( + for await (let item of client.billingRoleDefinitionOperations.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingProfileRoleDefinitionsList().catch(console.error); +async function main() { + billingRoleDefinitionListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByCustomerSample.ts new file mode 100644 index 000000000000..da7e25018add --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role definitions for a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the role definitions for a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByCustomer.json + */ +async function billingRoleDefinitionListByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleDefinitionOperations.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleDefinitionListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByDepartmentSample.ts new file mode 100644 index 000000000000..35bf36da212f --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByDepartmentSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List the definition for a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary List the definition for a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByDepartment.json + */ +async function billingRoleDefinitionListByDepartment() { + const billingAccountName = "123456"; + const departmentName = "7368531"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleDefinitionOperations.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleDefinitionListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..5142398e98b3 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List the definition for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary List the definition for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByEnrollmentAccount.json + */ +async function billingRoleDefinitionListByEnrollmentAccount() { + const billingAccountName = "123456"; + const enrollmentAccountName = "4568789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleDefinitionOperations.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleDefinitionListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByInvoiceSectionSample.ts similarity index 61% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByInvoiceSectionSample.ts rename to sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByInvoiceSectionSample.ts index 138b94613e25..f51a75c1efe6 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinitionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByInvoiceSection.json */ -async function invoiceSectionRoleDefinitionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function billingRoleDefinitionListByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingRoleDefinitions.listByInvoiceSection( + for await (let item of client.billingRoleDefinitionOperations.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionRoleDefinitionsList().catch(console.error); +async function main() { + billingRoleDefinitionListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByBillingAccountSample.ts deleted file mode 100644 index 815db5946fe3..000000000000 --- a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByBillingAccountSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json - */ -async function billingAccountRoleDefinition() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingRoleDefinitionName = "{billingRoleDefinitionName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleDefinitions.getByBillingAccount( - billingAccountName, - billingRoleDefinitionName - ); - console.log(result); -} - -billingAccountRoleDefinition().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..0a953558368b --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesCreateOrUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingSubscriptionAlias, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Creates or updates a billing subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * + * @summary Creates or updates a billing subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasCreateOrUpdate.json + */ +async function billingSubscriptionAliasCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const aliasName = "c356b7c7-7545-4686-b843-c1a49cf853fc"; + const parameters: BillingSubscriptionAlias = { + billingFrequency: "P1M", + displayName: "Subscription 3", + quantity: 1, + skuId: "0001", + termDuration: "P1M", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingSubscriptionsAliases.beginCreateOrUpdateAndWait( + billingAccountName, + aliasName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionAliasCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesGetSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesGetSample.ts new file mode 100644 index 000000000000..2766819c14c8 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesGetSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * + * @summary Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasGet.json + */ +async function billingSubscriptionAliasGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const aliasName = "c356b7c7-7545-4686-b843-c1a49cf853fc"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptionsAliases.get( + billingAccountName, + aliasName, + ); + console.log(result); +} + +async function main() { + billingSubscriptionAliasGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesListByBillingAccountSample.ts new file mode 100644 index 000000000000..fc0a67ce769e --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsAliasesListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the subscription aliases for a billing account. The operation is supported for seat based billing subscriptions. + * + * @summary Lists the subscription aliases for a billing account. The operation is supported for seat based billing subscriptions. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasList.json + */ +async function billingSubscriptionAliasList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptionsAliases.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionAliasList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsCancelSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsCancelSample.ts new file mode 100644 index 000000000000..c7d6ce2d4153 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsCancelSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CancelSubscriptionRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. + * + * @summary Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsCancel.json + */ +async function billingSubscriptionsCancel() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters: CancelSubscriptionRequest = { + cancellationReason: "Compromise", + customerId: "11111111-1111-1111-1111-111111111111", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginCancelAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsDeleteSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsDeleteSample.ts new file mode 100644 index 000000000000..cee2ff823efb --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsDelete.json + */ +async function billingSubscriptionsDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginDeleteAndWait( + billingAccountName, + billingSubscriptionName, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsGetByBillingProfileSample.ts new file mode 100644 index 000000000000..ffaf46aa3bb4 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsGetByBillingProfileSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionGetByBillingProfile.json + */ +async function billingSubscriptionGetByBillingProfile() { + const billingAccountName = "pcn.94077792"; + const billingProfileName = "6478903"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.getByBillingProfile( + billingAccountName, + billingProfileName, + billingSubscriptionName, + ); + console.log(result); +} + +async function main() { + billingSubscriptionGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsGetSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsGetSample.ts index 31ad688b8d7b..4943eddecc9f 100644 --- a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsGetSample.ts @@ -10,20 +10,31 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * This sample demonstrates how to Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. * - * @summary Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json + * @summary Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsGet.json */ -async function billingSubscription() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; +async function billingSubscriptionsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.get(billingAccountName); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.get( + billingAccountName, + billingSubscriptionName, + ); console.log(result); } -billingSubscription().catch(console.error); +async function main() { + billingSubscriptionsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByBillingAccountSample.ts index 17bb72d99bd2..000f29be1827 100644 --- a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByBillingAccountSample.ts @@ -8,27 +8,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; +import { + BillingSubscriptionsListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * This sample demonstrates how to Lists the subscriptions for a billing account. * - * @summary Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json + * @summary Lists the subscriptions for a billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingAccount.json */ async function billingSubscriptionsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const includeDeleted = false; + const includeTenantSubscriptions = false; + const options: BillingSubscriptionsListByBillingAccountOptionalParams = { + includeDeleted, + includeTenantSubscriptions, + }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingSubscriptions.listByBillingAccount( - billingAccountName + billingAccountName, + options, )) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByBillingAccount().catch(console.error); +async function main() { + billingSubscriptionsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByBillingProfileSample.ts index 20aeffecf48d..2b4654bda71e 100644 --- a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByBillingProfileSample.ts @@ -10,27 +10,56 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * + * @summary Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileEA.json + */ +async function billingSubscriptionsListByBillingProfileEa() { + const billingAccountName = "pcn.94077792"; + const billingProfileName = "6478903"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} /** * This sample demonstrates how to Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. * * @summary Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileMCA.json */ -async function billingSubscriptionsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingSubscriptionsListByBillingProfileMca() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingSubscriptions.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByBillingProfile().catch(console.error); +async function main() { + billingSubscriptionsListByBillingProfileEa(); + billingSubscriptionsListByBillingProfileMca(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByCustomerAtBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByCustomerAtBillingAccountSample.ts new file mode 100644 index 000000000000..7a131ffbf082 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByCustomerAtBillingAccountSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomerAtBillingAccount.json + */ +async function billingSubscriptionsListByCustomerAtBillingAccount() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const customerName = "Q7GV-UUVA-PJA-TGB"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByCustomerAtBillingAccount( + billingAccountName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionsListByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByCustomerSample.ts index 1abbb37b30b1..f4926c0831d5 100644 --- a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByCustomerSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByCustomerSample.ts @@ -10,27 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByCustomer.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomer.json */ async function billingSubscriptionsListByCustomer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const customerName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingSubscriptions.listByCustomer( billingAccountName, - customerName + billingProfileName, + customerName, )) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByCustomer().catch(console.error); +async function main() { + billingSubscriptionsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..21c2df37a518 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByEnrollmentAccount.json + */ +async function billingSubscriptionsListByEnrollmentAccount() { + const billingAccountName = "6564892"; + const enrollmentAccountName = "172988"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionsListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByInvoiceSectionSample.ts index 72fd7ecb4fa1..40cbce5287c5 100644 --- a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByInvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByInvoiceSection.json */ async function billingSubscriptionsListByInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const invoiceSectionName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingSubscriptions.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByInvoiceSection().catch(console.error); +async function main() { + billingSubscriptionsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsMergeSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsMergeSample.ts new file mode 100644 index 000000000000..968357285c2e --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsMergeSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingSubscriptionMergeRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Merges the billing subscription provided in the request with a target billing subscription. + * + * @summary Merges the billing subscription provided in the request with a target billing subscription. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsMerge.json + */ +async function billingSubscriptionsMerge() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters: BillingSubscriptionMergeRequest = { + quantity: 1, + targetBillingSubscriptionName: "22222222-2222-2222-2222-222222222222", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginMergeAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsMerge(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsMoveSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsMoveSample.ts index c51d13d42949..f6dfadef2312 100644 --- a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsMoveSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsMoveSample.ts @@ -9,31 +9,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - TransferBillingSubscriptionRequestProperties, - BillingManagementClient + MoveBillingSubscriptionRequest, + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * This sample demonstrates how to Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. * - * @summary Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.json + * @summary Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionMove.json */ -async function moveBillingSubscription() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters: TransferBillingSubscriptionRequestProperties = { +async function billingSubscriptionMove() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveBillingSubscriptionRequest = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingSubscriptions.beginMoveAndWait( billingAccountName, - parameters + billingSubscriptionName, + parameters, ); console.log(result); } -moveBillingSubscription().catch(console.error); +async function main() { + billingSubscriptionMove(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsSplitSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsSplitSample.ts new file mode 100644 index 000000000000..f4d322fa4a03 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsSplitSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingSubscriptionSplitRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. + * + * @summary Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsSplit.json + */ +async function billingSubscriptionsSplit() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters: BillingSubscriptionSplitRequest = { + billingFrequency: "P1M", + quantity: 1, + targetProductTypeId: "XYZ56789", + targetSkuId: "0001", + termDuration: "P1M", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginSplitAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsSplit(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsUpdateSample.ts index faa9718c3f8f..654632050a23 100644 --- a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsUpdateSample.ts +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsUpdateSample.ts @@ -9,28 +9,39 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - BillingSubscription, - BillingManagementClient + BillingSubscriptionPatch, + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * This sample demonstrates how to Updates the properties of a billing subscription. * - * @summary Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.json + * @summary Updates the properties of a billing subscription. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsUpdate.json */ -async function updateBillingProperty() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters: BillingSubscription = { costCenter: "ABC1234" }; +async function billingSubscriptionsUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters: BillingSubscriptionPatch = { + consumptionCostCenter: "ABC1234", + }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.update( + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginUpdateAndWait( billingAccountName, - parameters + billingSubscriptionName, + parameters, ); console.log(result); } -updateBillingProperty().catch(console.error); +async function main() { + billingSubscriptionsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsValidateMoveEligibilitySample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsValidateMoveEligibilitySample.ts new file mode 100644 index 000000000000..3d714036f537 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsValidateMoveEligibilitySample.ts @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MoveBillingSubscriptionRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveFailure.json + */ +async function billingSubscriptionValidateMoveFailure() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveBillingSubscriptionRequest = { + destinationInvoiceSectionId: + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.validateMoveEligibility( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveSuccess.json + */ +async function billingSubscriptionValidateMoveSuccess() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveBillingSubscriptionRequest = { + destinationInvoiceSectionId: + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.validateMoveEligibility( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionValidateMoveFailure(); + billingSubscriptionValidateMoveSuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsValidateMoveSample.ts b/sdk/billing/arm-billing/samples-dev/billingSubscriptionsValidateMoveSample.ts deleted file mode 100644 index 9ea6ed29d3fb..000000000000 --- a/sdk/billing/arm-billing/samples-dev/billingSubscriptionsValidateMoveSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TransferBillingSubscriptionRequestProperties, - BillingManagementClient -} from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.json - */ -async function subscriptionMoveValidateFailure() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters: TransferBillingSubscriptionRequestProperties = { - destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.validateMove( - billingAccountName, - parameters - ); - console.log(result); -} - -subscriptionMoveValidateFailure().catch(console.error); - -/** - * This sample demonstrates how to Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveSuccess.json - */ -async function subscriptionMoveValidateSuccess() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters: TransferBillingSubscriptionRequestProperties = { - destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.validateMove( - billingAccountName, - parameters - ); - console.log(result); -} - -subscriptionMoveValidateSuccess().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/customersGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/customersGetByBillingAccountSample.ts new file mode 100644 index 000000000000..7011606342f1 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/customersGetByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a customer by its ID at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a customer by its ID at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGetByBillingAccount.json + */ +async function customersGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.customers.getByBillingAccount( + billingAccountName, + customerName, + ); + console.log(result); +} + +async function main() { + customersGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/customersGetSample.ts b/sdk/billing/arm-billing/samples-dev/customersGetSample.ts index 3d930a72089a..a8a6457d1969 100644 --- a/sdk/billing/arm-billing/samples-dev/customersGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/customersGetSample.ts @@ -8,50 +8,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { - CustomersGetOptionalParams, - BillingManagementClient -} from "@azure/arm-billing"; +import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; -/** - * This sample demonstrates how to Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @summary Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json - */ -async function customer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.customers.get(billingAccountName, customerName); - console.log(result); -} - -customer().catch(console.error); +dotenv.config(); /** * This sample demonstrates how to Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerWithExpand.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGet.json */ -async function customerWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; - const expand = "enabledAzurePlans,resellers"; - const options: CustomersGetOptionalParams = { expand }; +async function customersGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.customers.get( billingAccountName, + billingProfileName, customerName, - options ); console.log(result); } -customerWithExpand().catch(console.error); +async function main() { + customersGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/customersListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/customersListByBillingAccountSample.ts index 7e8eccfa01e3..f786b59ac088 100644 --- a/sdk/billing/arm-billing/samples-dev/customersListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/customersListByBillingAccountSample.ts @@ -8,27 +8,61 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; +import { + CustomersListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingAccount.json */ async function customersListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.customers.listByBillingAccount( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -customersListByBillingAccount().catch(console.error); +/** + * This sample demonstrates how to Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingAccountWithExpand.json + */ +async function customersListByBillingAccountWithExpand() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const expand = "enabledAzurePlans,resellers"; + const options: CustomersListByBillingAccountOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.customers.listByBillingAccount( + billingAccountName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + customersListByBillingAccount(); + customersListByBillingAccountWithExpand(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/customersListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/customersListByBillingProfileSample.ts index 1aad2d13f556..dd6226261973 100644 --- a/sdk/billing/arm-billing/samples-dev/customersListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/customersListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingProfile.json */ async function customersListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.customers.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -customersListByBillingProfile().catch(console.error); +async function main() { + customersListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/departmentsGetSample.ts b/sdk/billing/arm-billing/samples-dev/departmentsGetSample.ts new file mode 100644 index 000000000000..5bfd9e7863c0 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/departmentsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a department by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a department by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentGet.json + */ +async function departmentGet() { + const billingAccountName = "456598"; + const departmentName = "164821"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.departments.get( + billingAccountName, + departmentName, + ); + console.log(result); +} + +async function main() { + departmentGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/departmentsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/departmentsListByBillingAccountSample.ts new file mode 100644 index 000000000000..7e762d2b4371 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/departmentsListByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentsListByBillingAccount.json + */ +async function departmentsListByBillingAccount() { + const billingAccountName = "456598"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.departments.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + departmentsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/enrollmentAccountsGetByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/enrollmentAccountsGetByDepartmentSample.ts new file mode 100644 index 000000000000..ec08f7a84c72 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/enrollmentAccountsGetByDepartmentSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets an enrollment account by department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets an enrollment account by department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountByDepartment.json + */ +async function enrollmentAccountByDepartment() { + const billingAccountName = "6564892"; + const departmentName = "164821"; + const enrollmentAccountName = "257698"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.enrollmentAccounts.getByDepartment( + billingAccountName, + departmentName, + enrollmentAccountName, + ); + console.log(result); +} + +async function main() { + enrollmentAccountByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/enrollmentAccountsGetSample.ts b/sdk/billing/arm-billing/samples-dev/enrollmentAccountsGetSample.ts index 45aa5b2a7c45..2ec371c37a7f 100644 --- a/sdk/billing/arm-billing/samples-dev/enrollmentAccountsGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/enrollmentAccountsGetSample.ts @@ -10,20 +10,30 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Gets a enrollment account by name. + * This sample demonstrates how to Gets an enrollment account by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. * - * @summary Gets a enrollment account by name. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json + * @summary Gets an enrollment account by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountGet.json */ -async function enrollmentAccountsGet() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const name = "e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"; +async function enrollmentAccountGet() { + const billingAccountName = "6564892"; + const enrollmentAccountName = "257698"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.enrollmentAccounts.get(name); + const client = new BillingManagementClient(credential); + const result = await client.enrollmentAccounts.get( + billingAccountName, + enrollmentAccountName, + ); console.log(result); } -enrollmentAccountsGet().catch(console.error); +async function main() { + enrollmentAccountGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/enrollmentAccountsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/enrollmentAccountsListByBillingAccountSample.ts new file mode 100644 index 000000000000..856e235a6b7e --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/enrollmentAccountsListByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the enrollment accounts for a billing account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the enrollment accounts for a billing account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByBillingAccount.json + */ +async function enrollmentAccountsListByBillingAccount() { + const billingAccountName = "6564892"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.enrollmentAccounts.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + enrollmentAccountsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/enrollmentAccountsListByDepartmentSample.ts b/sdk/billing/arm-billing/samples-dev/enrollmentAccountsListByDepartmentSample.ts new file mode 100644 index 000000000000..fc6655fb690c --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/enrollmentAccountsListByDepartmentSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the enrollment accounts for a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the enrollment accounts for a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByDepartment.json + */ +async function enrollmentAccountsListByDepartment() { + const billingAccountName = "6564892"; + const departmentName = "164821"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.enrollmentAccounts.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + enrollmentAccountsListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/instructionsGetSample.ts b/sdk/billing/arm-billing/samples-dev/instructionsGetSample.ts deleted file mode 100644 index 5847d40ae430..000000000000 --- a/sdk/billing/arm-billing/samples-dev/instructionsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @summary Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json - */ -async function instruction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const instructionName = "{instructionName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.instructions.get( - billingAccountName, - billingProfileName, - instructionName - ); - console.log(result); -} - -instruction().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/instructionsPutSample.ts b/sdk/billing/arm-billing/samples-dev/instructionsPutSample.ts deleted file mode 100644 index e1f493246d83..000000000000 --- a/sdk/billing/arm-billing/samples-dev/instructionsPutSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Instruction, BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates an instruction. These are custom billing instructions and are only applicable for certain customers. - * - * @summary Creates or updates an instruction. These are custom billing instructions and are only applicable for certain customers. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json - */ -async function putInstruction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const instructionName = "{instructionName}"; - const parameters: Instruction = { - amount: 5000, - endDate: new Date("2020-12-30T21:26:47.997Z"), - startDate: new Date("2019-12-30T21:26:47.997Z") - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.instructions.put( - billingAccountName, - billingProfileName, - instructionName, - parameters - ); - console.log(result); -} - -putInstruction().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoiceSectionsCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/invoiceSectionsCreateOrUpdateSample.ts index 3327dd820cc2..d653bb560d03 100644 --- a/sdk/billing/arm-billing/samples-dev/invoiceSectionsCreateOrUpdateSample.ts +++ b/sdk/billing/arm-billing/samples-dev/invoiceSectionsCreateOrUpdateSample.ts @@ -10,31 +10,40 @@ // Licensed under the MIT License. import { InvoiceSection, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsCreateOrUpdate.json */ -async function putInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function invoiceSectionsCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "invoice-section-1"; const parameters: InvoiceSection = { - displayName: "invoiceSection1", - labels: { costCategory: "Support", pcCode: "A123456" } + properties: { + displayName: "Invoice Section 1", + tags: { costCategory: "Support", pcCode: "A123456" }, + }, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.invoiceSections.beginCreateOrUpdateAndWait( billingAccountName, billingProfileName, invoiceSectionName, - parameters + parameters, ); console.log(result); } -putInvoiceSection().catch(console.error); +async function main() { + invoiceSectionsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoiceSectionsDeleteSample.ts b/sdk/billing/arm-billing/samples-dev/invoiceSectionsDeleteSample.ts new file mode 100644 index 000000000000..269822fd4345 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoiceSectionsDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Deletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsDelete.json + */ +async function invoiceSectionsDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoiceSections.beginDeleteAndWait( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +async function main() { + invoiceSectionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoiceSectionsGetSample.ts b/sdk/billing/arm-billing/samples-dev/invoiceSectionsGetSample.ts index bb44c01f8bfa..0a765bf9df24 100644 --- a/sdk/billing/arm-billing/samples-dev/invoiceSectionsGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/invoiceSectionsGetSample.ts @@ -10,26 +10,33 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsGet.json */ -async function invoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function invoiceSectionsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.invoiceSections.get( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, ); console.log(result); } -invoiceSection().catch(console.error); +async function main() { + invoiceSectionsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoiceSectionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/invoiceSectionsListByBillingProfileSample.ts index cafa192b3b8e..53dd633dda92 100644 --- a/sdk/billing/arm-billing/samples-dev/invoiceSectionsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/invoiceSectionsListByBillingProfileSample.ts @@ -8,29 +8,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; +import { + InvoiceSectionsListByBillingProfileOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsListByBillingProfile.json */ async function invoiceSectionsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const includeDeleted = true; + const options: InvoiceSectionsListByBillingProfileOptionalParams = { + includeDeleted, + }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.invoiceSections.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, + options, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionsListByBillingProfile().catch(console.error); +async function main() { + invoiceSectionsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoiceSectionsValidateDeleteEligibilitySample.ts b/sdk/billing/arm-billing/samples-dev/invoiceSectionsValidateDeleteEligibilitySample.ts new file mode 100644 index 000000000000..67ec027455ec --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoiceSectionsValidateDeleteEligibilitySample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilityFailure.json + */ +async function invoiceSectionsValidateDeleteEligibilityFailure() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoiceSections.validateDeleteEligibility( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilitySuccess.json + */ +async function invoiceSectionsValidateDeleteEligibilitySuccess() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoiceSections.validateDeleteEligibility( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +async function main() { + invoiceSectionsValidateDeleteEligibilityFailure(); + invoiceSectionsValidateDeleteEligibilitySuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesAmendSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesAmendSample.ts new file mode 100644 index 000000000000..6f4c95ae39d3 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoicesAmendSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesAmend.json + */ +async function invoicesAmend() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.beginAmendAndWait( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + invoicesAmend(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesDownloadBillingSubscriptionInvoiceSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesDownloadBillingSubscriptionInvoiceSample.ts deleted file mode 100644 index bf8be754eaa7..000000000000 --- a/sdk/billing/arm-billing/samples-dev/invoicesDownloadBillingSubscriptionInvoiceSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a URL to download an invoice. - * - * @summary Gets a URL to download an invoice. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json - */ -async function billingSubscriptionInvoiceDownload() { - const subscriptionId = "{subscriptionId}"; - const invoiceName = "{invoiceName}"; - const downloadToken = "DRS_12345"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadBillingSubscriptionInvoiceAndWait( - invoiceName, - downloadToken - ); - console.log(result); -} - -billingSubscriptionInvoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesDownloadByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesDownloadByBillingAccountSample.ts new file mode 100644 index 000000000000..a14bc79c0ecb --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoicesDownloadByBillingAccountSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InvoicesDownloadByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingAccount.json + */ +async function invoicesDownloadByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const documentName = "12345678"; + const options: InvoicesDownloadByBillingAccountOptionalParams = { + documentName, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.beginDownloadByBillingAccountAndWait( + billingAccountName, + invoiceName, + options, + ); + console.log(result); +} + +async function main() { + invoicesDownloadByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesDownloadByBillingSubscriptionSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesDownloadByBillingSubscriptionSample.ts new file mode 100644 index 000000000000..50a16c03739e --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoicesDownloadByBillingSubscriptionSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InvoicesDownloadByBillingSubscriptionOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingSubscription.json + */ +async function invoicesDownloadByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const invoiceName = "E123456789"; + const documentName = "12345678"; + const options: InvoicesDownloadByBillingSubscriptionOptionalParams = { + documentName, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = + await client.invoices.beginDownloadByBillingSubscriptionAndWait( + invoiceName, + options, + ); + console.log(result); +} + +async function main() { + invoicesDownloadByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesDownloadDocumentsByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesDownloadDocumentsByBillingAccountSample.ts new file mode 100644 index 000000000000..4f6db811d352 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoicesDownloadDocumentsByBillingAccountSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DocumentDownloadRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingAccount.json + */ +async function invoicesDownloadDocumentsByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: DocumentDownloadRequest[] = [ + { documentName: "12345678", invoiceName: "G123456789" }, + { documentName: "12345678", invoiceName: "G987654321" }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.invoices.beginDownloadDocumentsByBillingAccountAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + invoicesDownloadDocumentsByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesDownloadDocumentsByBillingSubscriptionSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesDownloadDocumentsByBillingSubscriptionSample.ts new file mode 100644 index 000000000000..9212dd3e78ad --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoicesDownloadDocumentsByBillingSubscriptionSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DocumentDownloadRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingSubscription.json + */ +async function invoicesDownloadDocumentsByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const parameters: DocumentDownloadRequest[] = [ + { documentName: "12345678", invoiceName: "E123456789" }, + { documentName: "12345678", invoiceName: "E987654321" }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = + await client.invoices.beginDownloadDocumentsByBillingSubscriptionAndWait( + parameters, + ); + console.log(result); +} + +async function main() { + invoicesDownloadDocumentsByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesDownloadInvoiceSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesDownloadInvoiceSample.ts deleted file mode 100644 index 1bf44bddc2a8..000000000000 --- a/sdk/billing/arm-billing/samples-dev/invoicesDownloadInvoiceSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json - */ -async function invoiceDownload() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const downloadToken = "DRS_12345"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadInvoiceAndWait( - billingAccountName, - invoiceName, - downloadToken - ); - console.log(result); -} - -invoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesDownloadMultipleBillingProfileInvoicesSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesDownloadMultipleBillingProfileInvoicesSample.ts deleted file mode 100644 index 058a862ed906..000000000000 --- a/sdk/billing/arm-billing/samples-dev/invoicesDownloadMultipleBillingProfileInvoicesSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json - */ -async function billingProfileInvoiceDownload() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const downloadUrls: string[] = [ - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01" - ]; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadMultipleBillingProfileInvoicesAndWait( - billingAccountName, - downloadUrls - ); - console.log(result); -} - -billingProfileInvoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts deleted file mode 100644 index bb40c77f86bf..000000000000 --- a/sdk/billing/arm-billing/samples-dev/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json - */ -async function billingSubscriptionInvoiceDownload() { - const subscriptionId = "{subscriptionId}"; - const downloadUrls: string[] = [ - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01" - ]; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadMultipleBillingSubscriptionInvoicesAndWait( - downloadUrls - ); - console.log(result); -} - -billingSubscriptionInvoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesDownloadSummaryByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesDownloadSummaryByBillingAccountSample.ts new file mode 100644 index 000000000000..5ec5766ceb07 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoicesDownloadSummaryByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadSummaryByBillingAccount.json + */ +async function invoicesDownloadSummaryByBillingAccount() { + const billingAccountName = "123456789"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.invoices.beginDownloadSummaryByBillingAccountAndWait( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + invoicesDownloadSummaryByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesGetByBillingAccountSample.ts new file mode 100644 index 000000000000..02cd7af9d246 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoicesGetByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for all billing account types. + * + * @summary Gets an invoice by billing account name and ID. The operation is supported for all billing account types. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingAccount.json + */ +async function invoicesGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.getByBillingAccount( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + invoicesGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesGetByBillingSubscriptionSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesGetByBillingSubscriptionSample.ts new file mode 100644 index 000000000000..0efc6d8cea72 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/invoicesGetByBillingSubscriptionSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingSubscription.json + */ +async function invoicesGetByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const invoiceName = "E123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.invoices.getByBillingSubscription(invoiceName); + console.log(result); +} + +async function main() { + invoicesGetByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesGetBySubscriptionAndInvoiceIdSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesGetBySubscriptionAndInvoiceIdSample.ts deleted file mode 100644 index 0d4c59bb8238..000000000000 --- a/sdk/billing/arm-billing/samples-dev/invoicesGetBySubscriptionAndInvoiceIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets an invoice by subscription ID and invoice ID. - * - * @summary Gets an invoice by subscription ID and invoice ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json - */ -async function billingSubscriptionsListByBillingAccount() { - const subscriptionId = "{subscriptionId}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.getBySubscriptionAndInvoiceId( - invoiceName - ); - console.log(result); -} - -billingSubscriptionsListByBillingAccount().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesGetSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesGetSample.ts index 2cc3812c5b89..8a843e70a749 100644 --- a/sdk/billing/arm-billing/samples-dev/invoicesGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/invoicesGetSample.ts @@ -10,75 +10,26 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json - */ -async function creditNote() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -creditNote().catch(console.error); +dotenv.config(); /** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Invoice.json + * @summary Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGet.json */ -async function invoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; +async function invoicesGet() { + const invoiceName = "G123456789"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); + const client = new BillingManagementClient(credential); + const result = await client.invoices.get(invoiceName); console.log(result); } -invoice().catch(console.error); - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceWithRebillDetails.json - */ -async function invoiceWithRebillDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -invoiceWithRebillDetails().catch(console.error); - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/VoidInvoice.json - */ -async function voidInvoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); +async function main() { + invoicesGet(); } -voidInvoice().catch(console.error); +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesListByBillingAccountSample.ts index 2cc8ce5be017..89705b58b9c3 100644 --- a/sdk/billing/arm-billing/samples-dev/invoicesListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/invoicesListByBillingAccountSample.ts @@ -8,57 +8,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; +import { + InvoicesListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the invoices for a billing account for a given start date and end date. The operation is supported for all billing account types. * - * @summary Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json + * @summary Lists the invoices for a billing account for a given start date and end date. The operation is supported for all billing account types. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingAccount.json */ -async function billingAccountInvoicesList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; +async function invoicesListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const periodStartDate = new Date("2023-01-01"); + const periodEndDate = new Date("2023-06-30"); + const options: InvoicesListByBillingAccountOptionalParams = { + periodStartDate, + periodEndDate, + }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.invoices.listByBillingAccount( billingAccountName, - periodStartDate, - periodEndDate + options, )) { resArray.push(item); } console.log(resArray); } -billingAccountInvoicesList().catch(console.error); - -/** - * This sample demonstrates how to Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesListWithRebillDetails.json - */ -async function billingAccountInvoicesListWithRebillDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingAccount( - billingAccountName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); +async function main() { + invoicesListByBillingAccount(); } -billingAccountInvoicesListWithRebillDetails().catch(console.error); +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesListByBillingProfileSample.ts index 5c91a385387d..55cf14bd8665 100644 --- a/sdk/billing/arm-billing/samples-dev/invoicesListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/invoicesListByBillingProfileSample.ts @@ -8,61 +8,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; +import { + InvoicesListByBillingProfileOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingProfile.json */ async function invoicesListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const periodStartDate = new Date("2023-01-01"); + const periodEndDate = new Date("2023-06-30"); + const options: InvoicesListByBillingProfileOptionalParams = { + periodStartDate, + periodEndDate, + }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.invoices.listByBillingProfile( billingAccountName, billingProfileName, - periodStartDate, - periodEndDate + options, )) { resArray.push(item); } console.log(resArray); } -invoicesListByBillingProfile().catch(console.error); - -/** - * This sample demonstrates how to Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfileWithRebillDetails.json - */ -async function invoicesListByBillingProfileWithRebillDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingProfile( - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); +async function main() { + invoicesListByBillingProfile(); } -invoicesListByBillingProfileWithRebillDetails().catch(console.error); +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesListByBillingSubscriptionSample.ts b/sdk/billing/arm-billing/samples-dev/invoicesListByBillingSubscriptionSample.ts index eb009799cb53..018cb26e46fa 100644 --- a/sdk/billing/arm-billing/samples-dev/invoicesListByBillingSubscriptionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/invoicesListByBillingSubscriptionSample.ts @@ -8,29 +8,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; +import { + InvoicesListByBillingSubscriptionOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the invoices for a subscription. + * This sample demonstrates how to Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @summary Lists the invoices for a subscription. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json + * @summary Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingSubscription.json */ -async function billingSubscriptionsListByBillingAccount() { - const subscriptionId = "{subscriptionId}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; +async function invoicesListByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const periodStartDate = new Date("2023-01-01"); + const periodEndDate = new Date("2023-06-30"); + const options: InvoicesListByBillingSubscriptionOptionalParams = { + periodStartDate, + periodEndDate, + }; const credential = new DefaultAzureCredential(); const client = new BillingManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.invoices.listByBillingSubscription( - periodStartDate, - periodEndDate - )) { + for await (let item of client.invoices.listByBillingSubscription(options)) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByBillingAccount().catch(console.error); +async function main() { + invoicesListByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/enrollmentAccountsListSample.ts b/sdk/billing/arm-billing/samples-dev/operationsListSample.ts similarity index 57% rename from sdk/billing/arm-billing/samples-dev/enrollmentAccountsListSample.ts rename to sdk/billing/arm-billing/samples-dev/operationsListSample.ts index 57fce163a92c..c790edee1579 100644 --- a/sdk/billing/arm-billing/samples-dev/enrollmentAccountsListSample.ts +++ b/sdk/billing/arm-billing/samples-dev/operationsListSample.ts @@ -10,22 +10,31 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the enrollment accounts the caller has access to. + * This sample demonstrates how to List of operations supported by provider. * - * @summary Lists the enrollment accounts the caller has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json + * @summary List of operations supported by provider. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/operationsList.json */ -async function enrollmentAccountsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; +async function operationsList() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new BillingManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.enrollmentAccounts.list()) { + for await (let item of client.operations.list()) { resArray.push(item); } console.log(resArray); } -enrollmentAccountsList().catch(console.error); +async function main() { + operationsList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/partnerTransfersCancelSample.ts b/sdk/billing/arm-billing/samples-dev/partnerTransfersCancelSample.ts new file mode 100644 index 000000000000..e7d14d81fff0 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/partnerTransfersCancelSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersCancel.json + */ +async function partnerTransferCancel() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.partnerTransfers.cancel( + billingAccountName, + billingProfileName, + customerName, + transferName, + ); + console.log(result); +} + +async function main() { + partnerTransferCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/partnerTransfersGetSample.ts b/sdk/billing/arm-billing/samples-dev/partnerTransfersGetSample.ts new file mode 100644 index 000000000000..d4eafd19627f --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/partnerTransfersGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersGet.json + */ +async function partnerTransferGet() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.partnerTransfers.get( + billingAccountName, + billingProfileName, + customerName, + transferName, + ); + console.log(result); +} + +async function main() { + partnerTransferGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/partnerTransfersInitiateSample.ts b/sdk/billing/arm-billing/samples-dev/partnerTransfersInitiateSample.ts new file mode 100644 index 000000000000..0e7a9600b2c3 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/partnerTransfersInitiateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PartnerInitiateTransferRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Sends a request to a user in a customer's billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Sends a request to a user in a customer's billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersInitiate.json + */ +async function initiatePartnerTransfer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const transferName = "aabb123"; + const parameters: PartnerInitiateTransferRequest = { + recipientEmailId: "user@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.partnerTransfers.initiate( + billingAccountName, + billingProfileName, + customerName, + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + initiatePartnerTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/partnerTransfersListSample.ts b/sdk/billing/arm-billing/samples-dev/partnerTransfersListSample.ts new file mode 100644 index 000000000000..1d57eb44299c --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/partnerTransfersListSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the transfer requests sent to a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the transfer requests sent to a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersList.json + */ +async function partnerTransfersList() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.partnerTransfers.list( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + partnerTransfersList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/paymentMethodsDeleteByUserSample.ts b/sdk/billing/arm-billing/samples-dev/paymentMethodsDeleteByUserSample.ts new file mode 100644 index 000000000000..4cc97666db08 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/paymentMethodsDeleteByUserSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a payment method owned by the caller. + * + * @summary Deletes a payment method owned by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsDeleteByUser.json + */ +async function deletePaymentMethodOwnedByUser() { + const paymentMethodName = "ABCDABCDABC0"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.deleteByUser(paymentMethodName); + console.log(result); +} + +async function main() { + deletePaymentMethodOwnedByUser(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/paymentMethodsGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/paymentMethodsGetByBillingAccountSample.ts new file mode 100644 index 000000000000..0575dff89d64 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/paymentMethodsGetByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingAccount.json + */ +async function paymentMethodGetAtBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const paymentMethodName = "21dd9edc-af71-4d62-80ce-37151d475326"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.getByBillingAccount( + billingAccountName, + paymentMethodName, + ); + console.log(result); +} + +async function main() { + paymentMethodGetAtBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/paymentMethodsGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/paymentMethodsGetByBillingProfileSample.ts new file mode 100644 index 000000000000..c8aadec228f9 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/paymentMethodsGetByBillingProfileSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingProfile.json + */ +async function paymentMethodsGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const billingProfileName = "ABC1-A1CD-AB1-BP1"; + const paymentMethodName = "ABCDABCDABC0"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.getByBillingProfile( + billingAccountName, + billingProfileName, + paymentMethodName, + ); + console.log(result); +} + +async function main() { + paymentMethodsGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/paymentMethodsGetByUserSample.ts b/sdk/billing/arm-billing/samples-dev/paymentMethodsGetByUserSample.ts new file mode 100644 index 000000000000..bf4cb0cdecf7 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/paymentMethodsGetByUserSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a payment method owned by the caller. + * + * @summary Gets a payment method owned by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByUser.json + */ +async function getPaymentMethodOwnedByUser() { + const paymentMethodName = "ABCDABCDABC0"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.getByUser(paymentMethodName); + console.log(result); +} + +async function main() { + getPaymentMethodOwnedByUser(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/paymentMethodsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/paymentMethodsListByBillingAccountSample.ts new file mode 100644 index 000000000000..5d1ca643e0c8 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/paymentMethodsListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the payment methods available for a billing account. Along with the payment methods owned by the caller, these payment methods can be attached to a billing profile to make payments. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists the payment methods available for a billing account. Along with the payment methods owned by the caller, these payment methods can be attached to a billing profile to make payments. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingAccount.json + */ +async function paymentMethodsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.paymentMethods.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + paymentMethodsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/paymentMethodsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/paymentMethodsListByBillingProfileSample.ts new file mode 100644 index 000000000000..9f35135d7b8f --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/paymentMethodsListByBillingProfileSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists payment methods attached to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists payment methods attached to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingProfile.json + */ +async function paymentMethodsListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const billingProfileName = "ABC1-A1CD-AB1-BP1"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.paymentMethods.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + paymentMethodsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingSubscriptionSample.ts b/sdk/billing/arm-billing/samples-dev/paymentMethodsListByUserSample.ts similarity index 50% rename from sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingSubscriptionSample.ts rename to sdk/billing/arm-billing/samples-dev/paymentMethodsListByUserSample.ts index eb009799cb53..e82bc7b4082d 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingSubscriptionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/paymentMethodsListByUserSample.ts @@ -10,27 +10,28 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the invoices for a subscription. + * This sample demonstrates how to Lists the payment methods owned by the caller. * - * @summary Lists the invoices for a subscription. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json + * @summary Lists the payment methods owned by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByUser.json */ -async function billingSubscriptionsListByBillingAccount() { - const subscriptionId = "{subscriptionId}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; +async function listPaymentMethodOwnedByUser() { const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.invoices.listByBillingSubscription( - periodStartDate, - periodEndDate - )) { + for await (let item of client.paymentMethods.listByUser()) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByBillingAccount().catch(console.error); +async function main() { + listPaymentMethodOwnedByUser(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..8b71e24a4ebb --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByBillingAccountSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingAccountPolicy, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update the policies for a billing account of Enterprise Agreement type. + * + * @summary Update the policies for a billing account of Enterprise Agreement type. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingAccount.json + */ +async function policiesPutByBillingAccount() { + const billingAccountName = "1234567"; + const parameters: BillingAccountPolicy = { + properties: { + enterpriseAgreementPolicies: { + authenticationType: "OrganizationalAccountOnly", + }, + marketplacePurchases: "AllAllowed", + reservationPurchases: "Allowed", + savingsPlanPurchases: "NotAllowed", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.policies.beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + policiesPutByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByBillingProfileSample.ts new file mode 100644 index 000000000000..27fb777d0fd8 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByBillingProfileSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingProfilePolicy, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingProfile.json + */ +async function policiesPutByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const parameters: BillingProfilePolicy = { + properties: { + invoiceSectionLabelManagement: "Allowed", + marketplacePurchases: "AllAllowed", + reservationPurchases: "Allowed", + savingsPlanPurchases: "Allowed", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.policies.beginCreateOrUpdateByBillingProfileAndWait( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + policiesPutByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts new file mode 100644 index 000000000000..6908e5bfad4b --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CustomerPolicy, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomerAtBillingAccount.json + */ +async function policiesPutByCustomerAtBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const parameters: CustomerPolicy = { properties: { viewCharges: "Allowed" } }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.policies.beginCreateOrUpdateByCustomerAtBillingAccountAndWait( + billingAccountName, + customerName, + parameters, + ); + console.log(result); +} + +async function main() { + policiesPutByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesUpdateCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByCustomerSample.ts similarity index 56% rename from sdk/billing/arm-billing/samples-dev/policiesUpdateCustomerSample.ts rename to sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByCustomerSample.ts index a58aa66243af..c6d3be5eca24 100644 --- a/sdk/billing/arm-billing/samples-dev/policiesUpdateCustomerSample.ts +++ b/sdk/billing/arm-billing/samples-dev/policiesCreateOrUpdateByCustomerSample.ts @@ -10,26 +10,35 @@ // Licensed under the MIT License. import { CustomerPolicy, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateCustomerPolicy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomer.json */ -async function updateCustomer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; - const parameters: CustomerPolicy = { viewCharges: "NotAllowed" }; +async function policiesPutByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const parameters: CustomerPolicy = { properties: { viewCharges: "Allowed" } }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.policies.updateCustomer( + const client = new BillingManagementClient(credential); + const result = await client.policies.beginCreateOrUpdateByCustomerAndWait( billingAccountName, + billingProfileName, customerName, - parameters + parameters, ); console.log(result); } -updateCustomer().catch(console.error); +async function main() { + policiesPutByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/policiesGetByBillingAccountSample.ts new file mode 100644 index 000000000000..2c2f5e573653 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/policiesGetByBillingAccountSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the policies for a billing account of Enterprise Agreement type. + * + * @summary Get the policies for a billing account of Enterprise Agreement type. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingAccount.json + */ +async function policiesGetByBillingAccount() { + const billingAccountName = "1234567"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.policies.getByBillingAccount(billingAccountName); + console.log(result); +} + +async function main() { + policiesGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/policiesGetByBillingProfileSample.ts index add4d27e7c67..14a0df488a9e 100644 --- a/sdk/billing/arm-billing/samples-dev/policiesGetByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/policiesGetByBillingProfileSample.ts @@ -10,24 +10,31 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Policy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingProfile.json */ -async function policyByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function policiesGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.policies.getByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, ); console.log(result); } -policyByBillingProfile().catch(console.error); +async function main() { + policiesGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesGetByCustomerAtBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/policiesGetByCustomerAtBillingAccountSample.ts new file mode 100644 index 000000000000..64847b524eba --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/policiesGetByCustomerAtBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomerAtBillingAccount.json + */ +async function policiesGetByCustomerAtBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.policies.getByCustomerAtBillingAccount( + billingAccountName, + customerName, + ); + console.log(result); +} + +async function main() { + policiesGetByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesGetByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/policiesGetByCustomerSample.ts index 401b469eb6e8..6f4e264e10b2 100644 --- a/sdk/billing/arm-billing/samples-dev/policiesGetByCustomerSample.ts +++ b/sdk/billing/arm-billing/samples-dev/policiesGetByCustomerSample.ts @@ -10,24 +10,35 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPolicy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomer.json */ -async function policyByCustomer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; +async function policiesGetByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const policyName = "default"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.policies.getByCustomer( billingAccountName, - customerName + billingProfileName, + customerName, + policyName, ); console.log(result); } -policyByCustomer().catch(console.error); +async function main() { + policiesGetByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesGetBySubscriptionSample.ts b/sdk/billing/arm-billing/samples-dev/policiesGetBySubscriptionSample.ts new file mode 100644 index 000000000000..0435f633437b --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/policiesGetBySubscriptionSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetBySubscription.json + */ +async function policiesGetBySubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.policies.getBySubscription(); + console.log(result); +} + +async function main() { + policiesGetBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/policiesUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/policiesUpdateSample.ts deleted file mode 100644 index da13f56f888d..000000000000 --- a/sdk/billing/arm-billing/samples-dev/policiesUpdateSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Policy, BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdatePolicy.json - */ -async function updatePolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const parameters: Policy = { - marketplacePurchases: "OnlyFreeAllowed", - reservationPurchases: "NotAllowed", - viewCharges: "Allowed" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.policies.update( - billingAccountName, - billingProfileName, - parameters - ); - console.log(result); -} - -updatePolicy().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/productsGetSample.ts b/sdk/billing/arm-billing/samples-dev/productsGetSample.ts index 6e6e8e6515e9..6c37643450b0 100644 --- a/sdk/billing/arm-billing/samples-dev/productsGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/productsGetSample.ts @@ -10,21 +10,28 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Product.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsGet.json */ -async function product() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; +async function productsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const productName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.products.get(billingAccountName, productName); console.log(result); } -product().catch(console.error); +async function main() { + productsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/productsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/productsListByBillingAccountSample.ts index 9ab120752cca..acfb1f1c54ff 100644 --- a/sdk/billing/arm-billing/samples-dev/productsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/productsListByBillingAccountSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. * * @summary Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingAccount.json */ async function productsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByBillingAccount( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -productsListByBillingAccount().catch(console.error); +async function main() { + productsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/productsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/productsListByBillingProfileSample.ts index f7a611730f1a..0bdd38a14d85 100644 --- a/sdk/billing/arm-billing/samples-dev/productsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/productsListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. * * @summary Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingProfile.json */ async function productsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -productsListByBillingProfile().catch(console.error); +async function main() { + productsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/productsListByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/productsListByCustomerSample.ts index 8563cc1696ee..7322e339dfdc 100644 --- a/sdk/billing/arm-billing/samples-dev/productsListByCustomerSample.ts +++ b/sdk/billing/arm-billing/samples-dev/productsListByCustomerSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByCustomer.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByCustomer.json */ -async function productsListByInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; +async function productsListByCustomer() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const customerName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByCustomer( billingAccountName, - customerName + customerName, )) { resArray.push(item); } console.log(resArray); } -productsListByInvoiceSection().catch(console.error); +async function main() { + productsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/productsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/productsListByInvoiceSectionSample.ts index 4dbfdc8ffdeb..7ed2b73a3e76 100644 --- a/sdk/billing/arm-billing/samples-dev/productsListByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples-dev/productsListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByInvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByInvoiceSection.json */ async function productsListByInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const invoiceSectionName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -productsListByInvoiceSection().catch(console.error); +async function main() { + productsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/productsMoveSample.ts b/sdk/billing/arm-billing/samples-dev/productsMoveSample.ts index a1077a70b099..fb37db5168d8 100644 --- a/sdk/billing/arm-billing/samples-dev/productsMoveSample.ts +++ b/sdk/billing/arm-billing/samples-dev/productsMoveSample.ts @@ -9,33 +9,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - TransferProductRequestProperties, - BillingManagementClient + MoveProductRequest, + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveProduct.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productMove.json */ -async function moveProduct() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; - const parameters: TransferProductRequestProperties = { +async function productMove() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const productName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveProductRequest = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.products.move( + const client = new BillingManagementClient(credential); + const result = await client.products.beginMoveAndWait( billingAccountName, productName, - parameters + parameters, ); console.log(result); } -moveProduct().catch(console.error); +async function main() { + productMove(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/productsUpdateSample.ts b/sdk/billing/arm-billing/samples-dev/productsUpdateSample.ts index 392b745b6936..6100ab1618ee 100644 --- a/sdk/billing/arm-billing/samples-dev/productsUpdateSample.ts +++ b/sdk/billing/arm-billing/samples-dev/productsUpdateSample.ts @@ -8,28 +8,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { Product, BillingManagementClient } from "@azure/arm-billing"; +import { ProductPatch, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateProduct.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsUpdate.json */ -async function updateBillingProperty() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; - const parameters: Product = { autoRenew: "Off" }; +async function productsUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const productName = "11111111-1111-1111-1111-111111111111"; + const parameters: ProductPatch = { properties: { autoRenew: "On" } }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.products.update( billingAccountName, productName, - parameters + parameters, ); console.log(result); } -updateBillingProperty().catch(console.error); +async function main() { + productsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/productsValidateMoveSample.ts b/sdk/billing/arm-billing/samples-dev/productsValidateMoveEligibilitySample.ts similarity index 54% rename from sdk/billing/arm-billing/samples/v4/typescript/src/productsValidateMoveSample.ts rename to sdk/billing/arm-billing/samples-dev/productsValidateMoveEligibilitySample.ts index a6730ebf35e0..0bf5bf566280 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/productsValidateMoveSample.ts +++ b/sdk/billing/arm-billing/samples-dev/productsValidateMoveEligibilitySample.ts @@ -9,59 +9,65 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - TransferProductRequestProperties, - BillingManagementClient + MoveProductRequest, + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveFailure.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveFailure.json */ -async function subscriptionMoveValidateFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; - const parameters: TransferProductRequestProperties = { +async function productValidateMoveFailure() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const productName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveProductRequest = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.products.validateMove( + const client = new BillingManagementClient(credential); + const result = await client.products.validateMoveEligibility( billingAccountName, productName, - parameters + parameters, ); console.log(result); } -subscriptionMoveValidateFailure().catch(console.error); - /** * This sample demonstrates how to Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveSuccess.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveSuccess.json */ -async function subscriptionMoveValidateSuccess() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; - const parameters: TransferProductRequestProperties = { +async function productValidateMoveSuccess() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const productName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveProductRequest = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.products.validateMove( + const client = new BillingManagementClient(credential); + const result = await client.products.validateMoveEligibility( billingAccountName, productName, - parameters + parameters, ); console.log(result); } -subscriptionMoveValidateSuccess().catch(console.error); +async function main() { + productValidateMoveFailure(); + productValidateMoveSuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/recipientTransfersAcceptSample.ts b/sdk/billing/arm-billing/samples-dev/recipientTransfersAcceptSample.ts new file mode 100644 index 000000000000..c5365f989b58 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/recipientTransfersAcceptSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AcceptTransferRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Accepts a transfer request. + * + * @summary Accepts a transfer request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersAccept.json + */ +async function acceptTransfer() { + const transferName = "aabb123"; + const parameters: AcceptTransferRequest = { + productDetails: [ + { productId: "subscriptionId", productType: "AzureSubscription" }, + { productId: "reservedInstanceId", productType: "AzureReservation" }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.accept( + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + acceptTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/enrollmentAccountsGetSample.ts b/sdk/billing/arm-billing/samples-dev/recipientTransfersDeclineSample.ts similarity index 51% rename from sdk/billing/arm-billing/samples/v4/typescript/src/enrollmentAccountsGetSample.ts rename to sdk/billing/arm-billing/samples-dev/recipientTransfersDeclineSample.ts index 45aa5b2a7c45..a6d3113a1c15 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/enrollmentAccountsGetSample.ts +++ b/sdk/billing/arm-billing/samples-dev/recipientTransfersDeclineSample.ts @@ -10,20 +10,26 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Gets a enrollment account by name. + * This sample demonstrates how to Declines a transfer request. * - * @summary Gets a enrollment account by name. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json + * @summary Declines a transfer request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersDecline.json */ -async function enrollmentAccountsGet() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const name = "e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"; +async function declineTransfer() { + const transferName = "aabb123"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.enrollmentAccounts.get(name); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.decline(transferName); console.log(result); } -enrollmentAccountsGet().catch(console.error); +async function main() { + declineTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/recipientTransfersGetSample.ts b/sdk/billing/arm-billing/samples-dev/recipientTransfersGetSample.ts new file mode 100644 index 000000000000..82fa1021eeb0 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/recipientTransfersGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a transfer request by ID. The caller must be the recipient of the transfer request. + * + * @summary Gets a transfer request by ID. The caller must be the recipient of the transfer request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersGet.json + */ +async function recipientTransferGet() { + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.get(transferName); + console.log(result); +} + +async function main() { + recipientTransferGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/recipientTransfersListSample.ts b/sdk/billing/arm-billing/samples-dev/recipientTransfersListSample.ts new file mode 100644 index 000000000000..ab50513a59aa --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/recipientTransfersListSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the transfer requests received by the caller. + * + * @summary Lists the transfer requests received by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersList.json + */ +async function recipientTransfersList() { + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.recipientTransfers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + recipientTransfersList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/recipientTransfersValidateSample.ts b/sdk/billing/arm-billing/samples-dev/recipientTransfersValidateSample.ts new file mode 100644 index 000000000000..d6bbefd90a7a --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/recipientTransfersValidateSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AcceptTransferRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates if a subscription or a reservation can be transferred. Use this operation to validate your subscriptions or reservation before using the accept transfer operation. + * + * @summary Validates if a subscription or a reservation can be transferred. Use this operation to validate your subscriptions or reservation before using the accept transfer operation. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersValidate.json + */ +async function validateTransfer() { + const transferName = "aabb123"; + const parameters: AcceptTransferRequest = { + productDetails: [ + { productId: "subscriptionId", productType: "AzureSubscription" }, + { productId: "reservedInstanceId", productType: "AzureReservation" }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.validate( + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + validateTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/reservationOrdersGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/reservationOrdersGetByBillingAccountSample.ts new file mode 100644 index 000000000000..4634d18fcf44 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/reservationOrdersGetByBillingAccountSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the details of the ReservationOrder in the billing account. + * + * @summary Get the details of the ReservationOrder in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccount.json + */ +async function reservationOrderGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservationOrders.getByBillingAccount( + billingAccountName, + reservationOrderId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get the details of the ReservationOrder in the billing account. + * + * @summary Get the details of the ReservationOrder in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccountWithExpandPlanInformation.json + */ +async function reservationOrderGetByBillingAccountWithExpandPlanInformation() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservationOrders.getByBillingAccount( + billingAccountName, + reservationOrderId, + ); + console.log(result); +} + +async function main() { + reservationOrderGetByBillingAccount(); + reservationOrderGetByBillingAccountWithExpandPlanInformation(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/reservationOrdersListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/reservationOrdersListByBillingAccountSample.ts new file mode 100644 index 000000000000..8cbb4870936b --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/reservationOrdersListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List all the `ReservationOrders in the billing account. + * + * @summary List all the `ReservationOrders in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrdersListByBillingAccount.json + */ +async function reservationOrderListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.reservationOrders.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + reservationOrderListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/reservationsGetByReservationOrderSample.ts b/sdk/billing/arm-billing/samples-dev/reservationsGetByReservationOrderSample.ts new file mode 100644 index 000000000000..e95b6ebdfa8f --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/reservationsGetByReservationOrderSample.ts @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccount.json + */ +async function reservationGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountManagementGroup.json + */ +async function reservationGetByBillingAccountManagementGroup() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountSingleResourceGroup.json + */ +async function reservationGetByBillingAccountSingleResourceGroup() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountSingleScope.json + */ +async function reservationGetByBillingAccountSingleScope() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +async function main() { + reservationGetByBillingAccount(); + reservationGetByBillingAccountManagementGroup(); + reservationGetByBillingAccountSingleResourceGroup(); + reservationGetByBillingAccountSingleScope(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/reservationsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/reservationsListByBillingAccountSample.ts index ab03abe94582..d278319eb23b 100644 --- a/sdk/billing/arm-billing/samples-dev/reservationsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples-dev/reservationsListByBillingAccountSample.ts @@ -10,37 +10,40 @@ // Licensed under the MIT License. import { ReservationsListByBillingAccountOptionalParams, - BillingManagementClient + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * This sample demonstrates how to Lists the reservations in the billing account and the roll up counts of reservations group by provisioning states. * - * @summary Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.json + * @summary Lists the reservations in the billing account and the roll up counts of reservations group by provisioning states. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingAccount.json */ async function reservationsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const filter = "properties/reservedResourceType eq 'VirtualMachines'"; - const orderby = "properties/userFriendlyAppliedScopeType asc"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const selectedState = "Succeeded"; const options: ReservationsListByBillingAccountOptionalParams = { - filter, - orderby, - selectedState + selectedState, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.reservations.listByBillingAccount( billingAccountName, - options + options, )) { resArray.push(item); } console.log(resArray); } -reservationsListByBillingAccount().catch(console.error); +async function main() { + reservationsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/reservationsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/reservationsListByBillingProfileSample.ts index 91fea4a7d3ec..70bb8a0a8436 100644 --- a/sdk/billing/arm-billing/samples-dev/reservationsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/reservationsListByBillingProfileSample.ts @@ -10,39 +10,42 @@ // Licensed under the MIT License. import { ReservationsListByBillingProfileOptionalParams, - BillingManagementClient + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @summary Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingProfile.json */ async function reservationsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const filter = "properties/reservedResourceType eq 'VirtualMachines'"; - const orderby = "properties/userFriendlyAppliedScopeType asc"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "AAAA-AAAA-AAA-AAA"; const selectedState = "Succeeded"; const options: ReservationsListByBillingProfileOptionalParams = { - filter, - orderby, - selectedState + selectedState, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.reservations.listByBillingProfile( billingAccountName, billingProfileName, - options + options, )) { resArray.push(item); } console.log(resArray); } -reservationsListByBillingProfile().catch(console.error); +async function main() { + reservationsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/reservationsListByReservationOrderSample.ts b/sdk/billing/arm-billing/samples-dev/reservationsListByReservationOrderSample.ts new file mode 100644 index 000000000000..827f0e104532 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/reservationsListByReservationOrderSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List Reservations within a single ReservationOrder in the billing account. + * + * @summary List Reservations within a single ReservationOrder in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsGetFromOrderByBillingAccount.json + */ +async function reservationsGetFromOrderByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.reservations.listByReservationOrder( + billingAccountName, + reservationOrderId, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + reservationsGetFromOrderByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/reservationsUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/reservationsUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..6587732341cc --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/reservationsUpdateByBillingAccountSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Patch, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update reservation by billing account. + * + * @summary Update reservation by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationUpdateByBillingAccount.json + */ +async function reservationUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const body: Patch = { displayName: "NewName" }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.beginUpdateByBillingAccountAndWait( + billingAccountName, + reservationOrderId, + reservationId, + body, + ); + console.log(result); +} + +async function main() { + reservationUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/savingsPlanOrdersGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/savingsPlanOrdersGetByBillingAccountSample.ts new file mode 100644 index 000000000000..75db1560fb06 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/savingsPlanOrdersGetByBillingAccountSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a savings plan order by billing account. + * + * @summary Get a savings plan order by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderGetByBillingAccount.json + */ +async function savingsPlanOrderGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlanOrders.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get a savings plan order by billing account. + * + * @summary Get a savings plan order by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderExpandedScheduleGetByBillingAccount.json + */ +async function savingsPlanOrderWithExpandedPaymentsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlanOrders.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + ); + console.log(result); +} + +async function main() { + savingsPlanOrderGet(); + savingsPlanOrderWithExpandedPaymentsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/instructionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/savingsPlanOrdersListByBillingAccountSample.ts similarity index 50% rename from sdk/billing/arm-billing/samples-dev/instructionsListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples-dev/savingsPlanOrdersListByBillingAccountSample.ts index 1dc4299effcd..0c457b8b02b6 100644 --- a/sdk/billing/arm-billing/samples-dev/instructionsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples-dev/savingsPlanOrdersListByBillingAccountSample.ts @@ -10,27 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the instructions by billing profile id. + * This sample demonstrates how to List all Savings plan orders by billing account. * - * @summary Lists the instructions by billing profile id. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json + * @summary List all Savings plan orders by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderListByBillingAccount.json */ -async function instructionsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function savingsPlanOrderList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.instructions.listByBillingProfile( + for await (let item of client.savingsPlanOrders.listByBillingAccount( billingAccountName, - billingProfileName )) { resArray.push(item); } console.log(resArray); } -instructionsListByBillingProfile().catch(console.error); +async function main() { + savingsPlanOrderList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/savingsPlansGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/savingsPlansGetByBillingAccountSample.ts new file mode 100644 index 000000000000..e8d29ee95dc3 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/savingsPlansGetByBillingAccountSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get savings plan by billing account. + * + * @summary Get savings plan by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetByBillingAccount.json + */ +async function savingsPlanGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get savings plan by billing account. + * + * @summary Get savings plan by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetExpandRenewPropertiesByBillingAccount.json + */ +async function savingsPlanGetExpandRenewProperties() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + ); + console.log(result); +} + +async function main() { + savingsPlanGet(); + savingsPlanGetExpandRenewProperties(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/savingsPlansListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/savingsPlansListByBillingAccountSample.ts new file mode 100644 index 000000000000..c5aeed42fad7 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/savingsPlansListByBillingAccountSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SavingsPlansListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List savings plans by billing account. + * + * @summary List savings plans by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListByBillingAccount.json + */ +async function savingsPlansList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const take = 3; + const selectedState = "Succeeded"; + const refreshSummary = "true"; + const options: SavingsPlansListByBillingAccountOptionalParams = { + take, + selectedState, + refreshSummary, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.savingsPlans.listByBillingAccount( + billingAccountName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + savingsPlansList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/savingsPlansListBySavingsPlanOrderSample.ts b/sdk/billing/arm-billing/samples-dev/savingsPlansListBySavingsPlanOrderSample.ts new file mode 100644 index 000000000000..ac22acece5bc --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/savingsPlansListBySavingsPlanOrderSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List savings plans in an order by billing account. + * + * @summary List savings plans in an order by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListBySavingsPlanOrders.json + */ +async function savingsPlansInOrderList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.savingsPlans.listBySavingsPlanOrder( + billingAccountName, + savingsPlanOrderId, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + savingsPlansInOrderList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/savingsPlansUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/savingsPlansUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..210c41a46aeb --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/savingsPlansUpdateByBillingAccountSample.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SavingsPlanUpdateRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update savings plan by billing account. + * + * @summary Update savings plan by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanUpdateByBillingAccount.json + */ +async function savingsPlanUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const body: SavingsPlanUpdateRequest = { + properties: { + appliedScopeProperties: { + managementGroupId: + "/providers/Microsoft.Management/managementGroups/mg1", + tenantId: "80000000-0000-0000-0000-000000000000", + }, + appliedScopeType: "ManagementGroup", + displayName: "sp_newName", + renew: true, + renewProperties: { + purchaseProperties: { + appliedScopeProperties: { + managementGroupId: + "/providers/Microsoft.Management/managementGroups/mg1", + tenantId: "80000000-0000-0000-0000-000000000000", + }, + appliedScopeType: "ManagementGroup", + billingPlan: "P1M", + billingScopeId: "/subscriptions/50000000-0000-0000-0000-000000000000", + commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" }, + displayName: "sp_newName_renewed", + sku: { name: "Compute_Savings_Plan" }, + term: "P3Y", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.beginUpdateByBillingAccountAndWait( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + body, + ); + console.log(result); +} + +async function main() { + savingsPlanUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/savingsPlansValidateUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples-dev/savingsPlansValidateUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..18dec86111ec --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/savingsPlansValidateUpdateByBillingAccountSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SavingsPlanUpdateValidateRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validate savings plan patch by billing account. + * + * @summary Validate savings plan patch by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanValidateUpdateByBillingAccount.json + */ +async function savingsPlanValidateUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const body: SavingsPlanUpdateValidateRequest = { + benefits: [ + { + appliedScopeProperties: { + subscriptionId: "/subscriptions/50000000-0000-0000-0000-000000000000", + }, + appliedScopeType: "Single", + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.validateUpdateByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + body, + ); + console.log(result); +} + +async function main() { + savingsPlanValidateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transactionsGetTransactionSummaryByInvoiceSample.ts b/sdk/billing/arm-billing/samples-dev/transactionsGetTransactionSummaryByInvoiceSample.ts new file mode 100644 index 000000000000..980362f0269b --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/transactionsGetTransactionSummaryByInvoiceSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges. + * + * @summary Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionSummaryGetByInvoice.json + */ +async function transactionSummaryGetByInvoice() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transactions.getTransactionSummaryByInvoice( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + transactionSummaryGetByInvoice(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transactionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples-dev/transactionsListByBillingProfileSample.ts new file mode 100644 index 000000000000..92ad172a2f0d --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/transactionsListByBillingProfileSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TransactionsListByBillingProfileOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * + * @summary Lists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByBillingProfile.json + */ +async function transactionsListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const periodStartDate = new Date("2024-04-01"); + const periodEndDate = new Date("2023-05-30"); + const typeParam = "Billed"; + const filter = "properties/date gt '2020-10-01'"; + const search = "storage"; + const options: TransactionsListByBillingProfileOptionalParams = { + filter, + search, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transactions.listByBillingProfile( + billingAccountName, + billingProfileName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transactionsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transactionsListByCustomerSample.ts b/sdk/billing/arm-billing/samples-dev/transactionsListByCustomerSample.ts new file mode 100644 index 000000000000..ae5dab890733 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/transactionsListByCustomerSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TransactionsListByCustomerOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * + * @summary Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByCustomer.json + */ +async function transactionsListByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "22000000-0000-0000-0000-000000000000"; + const periodStartDate = new Date("2024-04-01"); + const periodEndDate = new Date("2023-05-30"); + const typeParam = "Billed"; + const filter = "properties/date gt '2020-10-01'"; + const search = "storage"; + const options: TransactionsListByCustomerOptionalParams = { filter, search }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transactions.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transactionsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transactionsListByInvoiceSample.ts b/sdk/billing/arm-billing/samples-dev/transactionsListByInvoiceSample.ts index 0a3884b140d1..73b659b31ef0 100644 --- a/sdk/billing/arm-billing/samples-dev/transactionsListByInvoiceSample.ts +++ b/sdk/billing/arm-billing/samples-dev/transactionsListByInvoiceSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. * * @summary Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/TransactionsListByInvoice.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoice.json */ async function transactionsListByInvoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.transactions.listByInvoice( billingAccountName, - invoiceName + invoiceName, )) { resArray.push(item); } console.log(resArray); } -transactionsListByInvoice().catch(console.error); +async function main() { + transactionsListByInvoice(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transactionsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples-dev/transactionsListByInvoiceSectionSample.ts new file mode 100644 index 000000000000..32e73cd2dc69 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/transactionsListByInvoiceSectionSample.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TransactionsListByInvoiceSectionOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * + * @summary Lists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoiceSection.json + */ +async function transactionsListByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "22000000-0000-0000-0000-000000000000"; + const periodStartDate = new Date("2024-04-01"); + const periodEndDate = new Date("2023-05-30"); + const typeParam = "Billed"; + const filter = "properties/date gt '2020-10-01'"; + const search = "storage"; + const options: TransactionsListByInvoiceSectionOptionalParams = { + filter, + search, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transactions.listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transactionsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transactionsTransactionsDownloadByInvoiceSample.ts b/sdk/billing/arm-billing/samples-dev/transactionsTransactionsDownloadByInvoiceSample.ts new file mode 100644 index 000000000000..cfd458275051 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/transactionsTransactionsDownloadByInvoiceSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsDownloadByInvoice.json + */ +async function transactionsDownloadByInvoice() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.transactions.beginTransactionsDownloadByInvoiceAndWait( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + transactionsDownloadByInvoice(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transfersCancelSample.ts b/sdk/billing/arm-billing/samples-dev/transfersCancelSample.ts new file mode 100644 index 000000000000..ee03c0156764 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/transfersCancelSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersCancel.json + */ +async function transferCancel() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transfers.cancel( + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + ); + console.log(result); +} + +async function main() { + transferCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transfersGetSample.ts b/sdk/billing/arm-billing/samples-dev/transfersGetSample.ts new file mode 100644 index 000000000000..523b297eb915 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/transfersGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersGet.json + */ +async function transferGet() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transfers.get( + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + ); + console.log(result); +} + +async function main() { + transferGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transfersInitiateSample.ts b/sdk/billing/arm-billing/samples-dev/transfersInitiateSample.ts new file mode 100644 index 000000000000..daf7372bbe26 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/transfersInitiateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InitiateTransferRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Sends a request to a user in another billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Sends a request to a user in another billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersInitiate.json + */ +async function initiateTransfer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const transferName = "aabb123"; + const parameters: InitiateTransferRequest = { + recipientEmailId: "user@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transfers.initiate( + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + initiateTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/transfersListSample.ts b/sdk/billing/arm-billing/samples-dev/transfersListSample.ts new file mode 100644 index 000000000000..72aa697d9ee9 --- /dev/null +++ b/sdk/billing/arm-billing/samples-dev/transfersListSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the transfer requests for an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists the transfer requests for an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersList.json + */ +async function transfersList() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transfers.list( + billingAccountName, + billingProfileName, + invoiceSectionName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transfersList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/README.md b/sdk/billing/arm-billing/samples/v4/javascript/README.md deleted file mode 100644 index 3d39f5159664..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [addressValidateSample.js][addressvalidatesample] | Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressInvalid.json | -| [agreementsGetSample.js][agreementsgetsample] | Gets an agreement by ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementByName.json | -| [agreementsListByBillingAccountSample.js][agreementslistbybillingaccountsample] | Lists the agreements for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementsListByBillingAccount.json | -| [availableBalancesGetSample.js][availablebalancesgetsample] | The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json | -| [billingAccountsGetSample.js][billingaccountsgetsample] | Gets a billing account by its ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountWithExpand.json | -| [billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js][billingaccountslistinvoicesectionsbycreatesubscriptionpermissionsample] | Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListWithCreateSubPermission.json | -| [billingAccountsListSample.js][billingaccountslistsample] | Lists the billing accounts that a user has access to. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsList.json | -| [billingAccountsUpdateSample.js][billingaccountsupdatesample] | Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.json | -| [billingPeriodsGetSample.js][billingperiodsgetsample] | Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json | -| [billingPeriodsListSample.js][billingperiodslistsample] | Lists the available billing periods for a subscription in reverse chronological order. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json | -| [billingPermissionsListByBillingAccountSample.js][billingpermissionslistbybillingaccountsample] | Lists the billing permissions the caller has on a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountPermissionsList.json | -| [billingPermissionsListByBillingProfileSample.js][billingpermissionslistbybillingprofilesample] | Lists the billing permissions the caller has on a billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilePermissionsList.json | -| [billingPermissionsListByCustomerSample.js][billingpermissionslistbycustomersample] | Lists the billing permissions the caller has for a customer. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPermissionsList.json | -| [billingPermissionsListByInvoiceSectionsSample.js][billingpermissionslistbyinvoicesectionssample] | Lists the billing permissions the caller has on an invoice section. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json | -| [billingProfilesCreateOrUpdateSample.js][billingprofilescreateorupdatesample] | Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.json | -| [billingProfilesGetSample.js][billingprofilesgetsample] | Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json | -| [billingProfilesListByBillingAccountSample.js][billingprofileslistbybillingaccountsample] | Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json | -| [billingPropertyGetSample.js][billingpropertygetsample] | Get the billing properties for a subscription. This operation is not supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json | -| [billingPropertyUpdateSample.js][billingpropertyupdatesample] | Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.json | -| [billingRoleAssignmentsDeleteByBillingAccountSample.js][billingroleassignmentsdeletebybillingaccountsample] | Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json | -| [billingRoleAssignmentsDeleteByBillingProfileSample.js][billingroleassignmentsdeletebybillingprofilesample] | Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json | -| [billingRoleAssignmentsDeleteByInvoiceSectionSample.js][billingroleassignmentsdeletebyinvoicesectionsample] | Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json | -| [billingRoleAssignmentsGetByBillingAccountSample.js][billingroleassignmentsgetbybillingaccountsample] | Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json | -| [billingRoleAssignmentsGetByBillingProfileSample.js][billingroleassignmentsgetbybillingprofilesample] | Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignment.json | -| [billingRoleAssignmentsGetByInvoiceSectionSample.js][billingroleassignmentsgetbyinvoicesectionsample] | Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignment.json | -| [billingRoleAssignmentsListByBillingAccountSample.js][billingroleassignmentslistbybillingaccountsample] | Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json | -| [billingRoleAssignmentsListByBillingProfileSample.js][billingroleassignmentslistbybillingprofilesample] | Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json | -| [billingRoleAssignmentsListByInvoiceSectionSample.js][billingroleassignmentslistbyinvoicesectionsample] | Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentList.json | -| [billingRoleDefinitionsGetByBillingAccountSample.js][billingroledefinitionsgetbybillingaccountsample] | Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json | -| [billingRoleDefinitionsGetByBillingProfileSample.js][billingroledefinitionsgetbybillingprofilesample] | Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinition.json | -| [billingRoleDefinitionsGetByInvoiceSectionSample.js][billingroledefinitionsgetbyinvoicesectionsample] | Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinition.json | -| [billingRoleDefinitionsListByBillingAccountSample.js][billingroledefinitionslistbybillingaccountsample] | Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json | -| [billingRoleDefinitionsListByBillingProfileSample.js][billingroledefinitionslistbybillingprofilesample] | Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json | -| [billingRoleDefinitionsListByInvoiceSectionSample.js][billingroledefinitionslistbyinvoicesectionsample] | Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinitionsList.json | -| [billingSubscriptionsGetSample.js][billingsubscriptionsgetsample] | Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json | -| [billingSubscriptionsListByBillingAccountSample.js][billingsubscriptionslistbybillingaccountsample] | Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json | -| [billingSubscriptionsListByBillingProfileSample.js][billingsubscriptionslistbybillingprofilesample] | Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingProfile.json | -| [billingSubscriptionsListByCustomerSample.js][billingsubscriptionslistbycustomersample] | Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByCustomer.json | -| [billingSubscriptionsListByInvoiceSectionSample.js][billingsubscriptionslistbyinvoicesectionsample] | Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByInvoiceSection.json | -| [billingSubscriptionsMoveSample.js][billingsubscriptionsmovesample] | Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.json | -| [billingSubscriptionsUpdateSample.js][billingsubscriptionsupdatesample] | Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.json | -| [billingSubscriptionsValidateMoveSample.js][billingsubscriptionsvalidatemovesample] | Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.json | -| [customersGetSample.js][customersgetsample] | Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json | -| [customersListByBillingAccountSample.js][customerslistbybillingaccountsample] | Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingAccount.json | -| [customersListByBillingProfileSample.js][customerslistbybillingprofilesample] | Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingProfile.json | -| [enrollmentAccountsGetSample.js][enrollmentaccountsgetsample] | Gets a enrollment account by name. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json | -| [enrollmentAccountsListSample.js][enrollmentaccountslistsample] | Lists the enrollment accounts the caller has access to. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json | -| [instructionsGetSample.js][instructionsgetsample] | Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json | -| [instructionsListByBillingProfileSample.js][instructionslistbybillingprofilesample] | Lists the instructions by billing profile id. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json | -| [instructionsPutSample.js][instructionsputsample] | Creates or updates an instruction. These are custom billing instructions and are only applicable for certain customers. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json | -| [invoiceSectionsCreateOrUpdateSample.js][invoicesectionscreateorupdatesample] | Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInvoiceSection.json | -| [invoiceSectionsGetSample.js][invoicesectionsgetsample] | Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSection.json | -| [invoiceSectionsListByBillingProfileSample.js][invoicesectionslistbybillingprofilesample] | Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListByBillingProfile.json | -| [invoicesDownloadBillingSubscriptionInvoiceSample.js][invoicesdownloadbillingsubscriptioninvoicesample] | Gets a URL to download an invoice. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json | -| [invoicesDownloadInvoiceSample.js][invoicesdownloadinvoicesample] | Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json | -| [invoicesDownloadMultipleBillingProfileInvoicesSample.js][invoicesdownloadmultiplebillingprofileinvoicessample] | Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json | -| [invoicesDownloadMultipleBillingSubscriptionInvoicesSample.js][invoicesdownloadmultiplebillingsubscriptioninvoicessample] | Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json | -| [invoicesGetByIdSample.js][invoicesgetbyidsample] | Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceById.json | -| [invoicesGetBySubscriptionAndInvoiceIdSample.js][invoicesgetbysubscriptionandinvoiceidsample] | Gets an invoice by subscription ID and invoice ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json | -| [invoicesGetSample.js][invoicesgetsample] | Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json | -| [invoicesListByBillingAccountSample.js][invoiceslistbybillingaccountsample] | Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json | -| [invoicesListByBillingProfileSample.js][invoiceslistbybillingprofilesample] | Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfile.json | -| [invoicesListByBillingSubscriptionSample.js][invoiceslistbybillingsubscriptionsample] | Lists the invoices for a subscription. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json | -| [policiesGetByBillingProfileSample.js][policiesgetbybillingprofilesample] | Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Policy.json | -| [policiesGetByCustomerSample.js][policiesgetbycustomersample] | Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPolicy.json | -| [policiesUpdateCustomerSample.js][policiesupdatecustomersample] | Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateCustomerPolicy.json | -| [policiesUpdateSample.js][policiesupdatesample] | Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdatePolicy.json | -| [productsGetSample.js][productsgetsample] | Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Product.json | -| [productsListByBillingAccountSample.js][productslistbybillingaccountsample] | Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingAccount.json | -| [productsListByBillingProfileSample.js][productslistbybillingprofilesample] | Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingProfile.json | -| [productsListByCustomerSample.js][productslistbycustomersample] | Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByCustomer.json | -| [productsListByInvoiceSectionSample.js][productslistbyinvoicesectionsample] | Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByInvoiceSection.json | -| [productsMoveSample.js][productsmovesample] | Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveProduct.json | -| [productsUpdateSample.js][productsupdatesample] | Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateProduct.json | -| [productsValidateMoveSample.js][productsvalidatemovesample] | Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveFailure.json | -| [reservationsListByBillingAccountSample.js][reservationslistbybillingaccountsample] | Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.json | -| [reservationsListByBillingProfileSample.js][reservationslistbybillingprofilesample] | Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingProfile.json | -| [transactionsListByInvoiceSample.js][transactionslistbyinvoicesample] | Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/TransactionsListByInvoice.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node addressValidateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node addressValidateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[addressvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/addressValidateSample.js -[agreementsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/agreementsGetSample.js -[agreementslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/agreementsListByBillingAccountSample.js -[availablebalancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/availableBalancesGetSample.js -[billingaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsGetSample.js -[billingaccountslistinvoicesectionsbycreatesubscriptionpermissionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js -[billingaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsListSample.js -[billingaccountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsUpdateSample.js -[billingperiodsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsGetSample.js -[billingperiodslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsListSample.js -[billingpermissionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByBillingAccountSample.js -[billingpermissionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByBillingProfileSample.js -[billingpermissionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByCustomerSample.js -[billingpermissionslistbyinvoicesectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByInvoiceSectionsSample.js -[billingprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesCreateOrUpdateSample.js -[billingprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesGetSample.js -[billingprofileslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesListByBillingAccountSample.js -[billingpropertygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingPropertyGetSample.js -[billingpropertyupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingPropertyUpdateSample.js -[billingroleassignmentsdeletebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js -[billingroleassignmentsdeletebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js -[billingroleassignmentsdeletebyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js -[billingroleassignmentsgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByBillingAccountSample.js -[billingroleassignmentsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByBillingProfileSample.js -[billingroleassignmentsgetbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByInvoiceSectionSample.js -[billingroleassignmentslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByBillingAccountSample.js -[billingroleassignmentslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByBillingProfileSample.js -[billingroleassignmentslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByInvoiceSectionSample.js -[billingroledefinitionsgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByBillingAccountSample.js -[billingroledefinitionsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByBillingProfileSample.js -[billingroledefinitionsgetbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByInvoiceSectionSample.js -[billingroledefinitionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByBillingAccountSample.js -[billingroledefinitionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByBillingProfileSample.js -[billingroledefinitionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByInvoiceSectionSample.js -[billingsubscriptionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsGetSample.js -[billingsubscriptionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByBillingAccountSample.js -[billingsubscriptionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByBillingProfileSample.js -[billingsubscriptionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByCustomerSample.js -[billingsubscriptionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByInvoiceSectionSample.js -[billingsubscriptionsmovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsMoveSample.js -[billingsubscriptionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsUpdateSample.js -[billingsubscriptionsvalidatemovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsValidateMoveSample.js -[customersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/customersGetSample.js -[customerslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/customersListByBillingAccountSample.js -[customerslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/customersListByBillingProfileSample.js -[enrollmentaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/enrollmentAccountsGetSample.js -[enrollmentaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/enrollmentAccountsListSample.js -[instructionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/instructionsGetSample.js -[instructionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/instructionsListByBillingProfileSample.js -[instructionsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/instructionsPutSample.js -[invoicesectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsCreateOrUpdateSample.js -[invoicesectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsGetSample.js -[invoicesectionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsListByBillingProfileSample.js -[invoicesdownloadbillingsubscriptioninvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadBillingSubscriptionInvoiceSample.js -[invoicesdownloadinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadInvoiceSample.js -[invoicesdownloadmultiplebillingprofileinvoicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadMultipleBillingProfileInvoicesSample.js -[invoicesdownloadmultiplebillingsubscriptioninvoicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.js -[invoicesgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetByIdSample.js -[invoicesgetbysubscriptionandinvoiceidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetBySubscriptionAndInvoiceIdSample.js -[invoicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetSample.js -[invoiceslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingAccountSample.js -[invoiceslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingProfileSample.js -[invoiceslistbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingSubscriptionSample.js -[policiesgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/policiesGetByBillingProfileSample.js -[policiesgetbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/policiesGetByCustomerSample.js -[policiesupdatecustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/policiesUpdateCustomerSample.js -[policiesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/policiesUpdateSample.js -[productsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/productsGetSample.js -[productslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/productsListByBillingAccountSample.js -[productslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/productsListByBillingProfileSample.js -[productslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/productsListByCustomerSample.js -[productslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/productsListByInvoiceSectionSample.js -[productsmovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/productsMoveSample.js -[productsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/productsUpdateSample.js -[productsvalidatemovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/productsValidateMoveSample.js -[reservationslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/reservationsListByBillingAccountSample.js -[reservationslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/reservationsListByBillingProfileSample.js -[transactionslistbyinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/javascript/transactionsListByInvoiceSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-billing?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billing/arm-billing/README.md diff --git a/sdk/billing/arm-billing/samples/v4/javascript/availableBalancesGetSample.js b/sdk/billing/arm-billing/samples/v4/javascript/availableBalancesGetSample.js deleted file mode 100644 index 4bf822f49188..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/availableBalancesGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json - */ -async function availableBalanceByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.availableBalances.get(billingAccountName, billingProfileName); - console.log(result); -} - -availableBalanceByBillingProfile().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsGetSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsGetSample.js deleted file mode 100644 index 57b0e711ab4c..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsGetSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets a billing account by its ID. - * - * @summary Gets a billing account by its ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountWithExpand.json - */ -async function billingAccountWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const expand = "soldTo,billingProfiles,billingProfiles/invoiceSections"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingAccounts.get(billingAccountName, options); - console.log(result); -} - -billingAccountWithExpand().catch(console.error); - -/** - * This sample demonstrates how to Gets a billing account by its ID. - * - * @summary Gets a billing account by its ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccount.json - */ -async function billingAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingAccounts.get(billingAccountName); - console.log(result); -} - -billingAccounts().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsUpdateSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsUpdateSample.js deleted file mode 100644 index 913a6064fcdb..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsUpdateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.json - */ -async function updateBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const parameters = { - displayName: "Test Account", - soldTo: { - addressLine1: "Test Address 1", - city: "Redmond", - companyName: "Contoso", - country: "US", - firstName: "Test", - lastName: "User", - postalCode: "12345", - region: "WA", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingAccounts.beginUpdateAndWait(billingAccountName, parameters); - console.log(result); -} - -updateBillingAccount().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsGetSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsGetSample.js deleted file mode 100644 index afbc0f612e58..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @summary Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json - */ -async function billingPeriodsGet() { - const subscriptionId = "subid"; - const billingPeriodName = "201702-1"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingPeriods.get(billingPeriodName); - console.log(result); -} - -billingPeriodsGet().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsListSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsListSample.js deleted file mode 100644 index b09730cbfde0..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingPeriodsListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists the available billing periods for a subscription in reverse chronological order. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @summary Lists the available billing periods for a subscription in reverse chronological order. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json - */ -async function billingPeriodsList() { - const subscriptionId = "subid"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingPeriods.list()) { - resArray.push(item); - } - console.log(resArray); -} - -billingPeriodsList().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesCreateOrUpdateSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesCreateOrUpdateSample.js deleted file mode 100644 index 459512a78b24..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesCreateOrUpdateSample.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.json - */ -async function createBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const parameters = { - billTo: { - addressLine1: "Test Address 1", - city: "Redmond", - country: "US", - firstName: "Test", - lastName: "User", - postalCode: "12345", - region: "WA", - }, - displayName: "Finance", - enabledAzurePlans: [{ skuId: "0001" }, { skuId: "0002" }], - invoiceEmailOptIn: true, - poNumber: "ABC12345", - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingProfiles.beginCreateOrUpdateAndWait( - billingAccountName, - billingProfileName, - parameters - ); - console.log(result); -} - -createBillingProfile().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesGetSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesGetSample.js deleted file mode 100644 index a643503d8517..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesGetSample.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json - */ -async function billingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingProfiles.get(billingAccountName, billingProfileName); - console.log(result); -} - -billingProfile().catch(console.error); - -/** - * This sample demonstrates how to Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileWithExpand.json - */ -async function billingProfileWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const expand = "invoiceSections"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingProfiles.get(billingAccountName, billingProfileName, options); - console.log(result); -} - -billingProfileWithExpand().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesListByBillingAccountSample.js deleted file mode 100644 index d775004211e8..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingProfilesListByBillingAccountSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json - */ -async function billingProfilesListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingProfiles.listByBillingAccount(billingAccountName)) { - resArray.push(item); - } - console.log(resArray); -} - -billingProfilesListByBillingAccount().catch(console.error); - -/** - * This sample demonstrates how to Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListWithExpand.json - */ -async function billingProfilesListWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const expand = "invoiceSections"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingProfiles.listByBillingAccount(billingAccountName, options)) { - resArray.push(item); - } - console.log(resArray); -} - -billingProfilesListWithExpand().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingPropertyGetSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingPropertyGetSample.js deleted file mode 100644 index 0be8aeb1f790..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingPropertyGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the billing properties for a subscription. This operation is not supported for billing accounts with agreement type Enterprise Agreement. - * - * @summary Get the billing properties for a subscription. This operation is not supported for billing accounts with agreement type Enterprise Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json - */ -async function billingProperty() { - const subscriptionId = "{subscriptionId}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingPropertyOperations.get(); - console.log(result); -} - -billingProperty().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingPropertyUpdateSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingPropertyUpdateSample.js deleted file mode 100644 index 809f2048bce7..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingPropertyUpdateSample.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.json - */ -async function updateBillingProperty() { - const subscriptionId = "{subscriptionId}"; - const parameters = { costCenter: "1010" }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingPropertyOperations.update(parameters); - console.log(result); -} - -updateBillingProperty().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js deleted file mode 100644 index f5675ef56c28..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json - */ -async function billingAccountRoleAssignmentDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleAssignments.deleteByBillingAccount( - billingAccountName, - billingRoleAssignmentName - ); - console.log(result); -} - -billingAccountRoleAssignmentDelete().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js deleted file mode 100644 index 6fcc0ed4e820..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json - */ -async function billingProfileRoleAssignmentDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleAssignments.deleteByBillingProfile( - billingAccountName, - billingProfileName, - billingRoleAssignmentName - ); - console.log(result); -} - -billingProfileRoleAssignmentDelete().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js deleted file mode 100644 index 3ef870eaaade..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json - */ -async function invoiceSectionRoleAssignmentDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleAssignments.deleteByInvoiceSection( - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleAssignmentName - ); - console.log(result); -} - -invoiceSectionRoleAssignmentDelete().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByBillingProfileSample.js deleted file mode 100644 index d8edc597248b..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByBillingProfileSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingProfile.json - */ -async function billingSubscriptionsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingSubscriptions.listByBillingProfile( - billingAccountName, - billingProfileName - )) { - resArray.push(item); - } - console.log(resArray); -} - -billingSubscriptionsListByBillingProfile().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsMoveSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsMoveSample.js deleted file mode 100644 index 179841e6159d..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsMoveSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.json - */ -async function moveBillingSubscription() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters = { - destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}", - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.beginMoveAndWait(billingAccountName, parameters); - console.log(result); -} - -moveBillingSubscription().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsUpdateSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsUpdateSample.js deleted file mode 100644 index 31964608cef1..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsUpdateSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.json - */ -async function updateBillingProperty() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters = { costCenter: "ABC1234" }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.update(billingAccountName, parameters); - console.log(result); -} - -updateBillingProperty().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsValidateMoveSample.js b/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsValidateMoveSample.js deleted file mode 100644 index e7db1b72b067..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsValidateMoveSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.json - */ -async function subscriptionMoveValidateFailure() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters = { - destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}", - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.validateMove(billingAccountName, parameters); - console.log(result); -} - -subscriptionMoveValidateFailure().catch(console.error); - -/** - * This sample demonstrates how to Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveSuccess.json - */ -async function subscriptionMoveValidateSuccess() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters = { - destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}", - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.validateMove(billingAccountName, parameters); - console.log(result); -} - -subscriptionMoveValidateSuccess().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/customersGetSample.js b/sdk/billing/arm-billing/samples/v4/javascript/customersGetSample.js deleted file mode 100644 index bdb4b4ba1019..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/customersGetSample.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @summary Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json - */ -async function customer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.customers.get(billingAccountName, customerName); - console.log(result); -} - -customer().catch(console.error); - -/** - * This sample demonstrates how to Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @summary Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerWithExpand.json - */ -async function customerWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; - const expand = "enabledAzurePlans,resellers"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.customers.get(billingAccountName, customerName, options); - console.log(result); -} - -customerWithExpand().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/customersListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v4/javascript/customersListByBillingAccountSample.js deleted file mode 100644 index 39d5b39577db..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/customersListByBillingAccountSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @summary Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingAccount.json - */ -async function customersListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.customers.listByBillingAccount(billingAccountName)) { - resArray.push(item); - } - console.log(resArray); -} - -customersListByBillingAccount().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/instructionsGetSample.js b/sdk/billing/arm-billing/samples/v4/javascript/instructionsGetSample.js deleted file mode 100644 index 1806d7e008db..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/instructionsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @summary Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json - */ -async function instruction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const instructionName = "{instructionName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.instructions.get( - billingAccountName, - billingProfileName, - instructionName - ); - console.log(result); -} - -instruction().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/instructionsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v4/javascript/instructionsListByBillingProfileSample.js deleted file mode 100644 index ee8b086c8e68..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/instructionsListByBillingProfileSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists the instructions by billing profile id. - * - * @summary Lists the instructions by billing profile id. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json - */ -async function instructionsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.instructions.listByBillingProfile( - billingAccountName, - billingProfileName - )) { - resArray.push(item); - } - console.log(resArray); -} - -instructionsListByBillingProfile().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/instructionsPutSample.js b/sdk/billing/arm-billing/samples/v4/javascript/instructionsPutSample.js deleted file mode 100644 index c98c7a057d37..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/instructionsPutSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates or updates an instruction. These are custom billing instructions and are only applicable for certain customers. - * - * @summary Creates or updates an instruction. These are custom billing instructions and are only applicable for certain customers. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json - */ -async function putInstruction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const instructionName = "{instructionName}"; - const parameters = { - amount: 5000, - endDate: new Date("2020-12-30T21:26:47.997Z"), - startDate: new Date("2019-12-30T21:26:47.997Z"), - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.instructions.put( - billingAccountName, - billingProfileName, - instructionName, - parameters - ); - console.log(result); -} - -putInstruction().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadBillingSubscriptionInvoiceSample.js b/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadBillingSubscriptionInvoiceSample.js deleted file mode 100644 index 797c77316362..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadBillingSubscriptionInvoiceSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets a URL to download an invoice. - * - * @summary Gets a URL to download an invoice. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json - */ -async function billingSubscriptionInvoiceDownload() { - const subscriptionId = "{subscriptionId}"; - const invoiceName = "{invoiceName}"; - const downloadToken = "DRS_12345"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadBillingSubscriptionInvoiceAndWait( - invoiceName, - downloadToken - ); - console.log(result); -} - -billingSubscriptionInvoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadInvoiceSample.js b/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadInvoiceSample.js deleted file mode 100644 index 928f54dc9f50..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadInvoiceSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json - */ -async function invoiceDownload() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const downloadToken = "DRS_12345"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadInvoiceAndWait( - billingAccountName, - invoiceName, - downloadToken - ); - console.log(result); -} - -invoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.js b/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.js deleted file mode 100644 index d793e23e4e5c..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json - */ -async function billingSubscriptionInvoiceDownload() { - const subscriptionId = "{subscriptionId}"; - const downloadUrls = [ - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - ]; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadMultipleBillingSubscriptionInvoicesAndWait( - downloadUrls - ); - console.log(result); -} - -billingSubscriptionInvoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetSample.js b/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetSample.js deleted file mode 100644 index 18e41c0ad3bb..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetSample.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json - */ -async function creditNote() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -creditNote().catch(console.error); - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Invoice.json - */ -async function invoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -invoice().catch(console.error); - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceWithRebillDetails.json - */ -async function invoiceWithRebillDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -invoiceWithRebillDetails().catch(console.error); - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/VoidInvoice.json - */ -async function voidInvoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -voidInvoice().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingAccountSample.js deleted file mode 100644 index 4e56786d5263..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingAccountSample.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json - */ -async function billingAccountInvoicesList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingAccount( - billingAccountName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); -} - -billingAccountInvoicesList().catch(console.error); - -/** - * This sample demonstrates how to Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesListWithRebillDetails.json - */ -async function billingAccountInvoicesListWithRebillDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingAccount( - billingAccountName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); -} - -billingAccountInvoicesListWithRebillDetails().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingProfileSample.js deleted file mode 100644 index 881162f846c8..000000000000 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingProfileSample.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingManagementClient } = require("@azure/arm-billing"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfile.json - */ -async function invoicesListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingProfile( - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); -} - -invoicesListByBillingProfile().catch(console.error); - -/** - * This sample demonstrates how to Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfileWithRebillDetails.json - */ -async function invoicesListByBillingProfileWithRebillDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingProfile( - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); -} - -invoicesListByBillingProfileWithRebillDetails().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/README.md b/sdk/billing/arm-billing/samples/v4/typescript/README.md deleted file mode 100644 index e89f18d67a4e..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/README.md +++ /dev/null @@ -1,217 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [addressValidateSample.ts][addressvalidatesample] | Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressInvalid.json | -| [agreementsGetSample.ts][agreementsgetsample] | Gets an agreement by ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementByName.json | -| [agreementsListByBillingAccountSample.ts][agreementslistbybillingaccountsample] | Lists the agreements for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementsListByBillingAccount.json | -| [availableBalancesGetSample.ts][availablebalancesgetsample] | The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json | -| [billingAccountsGetSample.ts][billingaccountsgetsample] | Gets a billing account by its ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountWithExpand.json | -| [billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts][billingaccountslistinvoicesectionsbycreatesubscriptionpermissionsample] | Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListWithCreateSubPermission.json | -| [billingAccountsListSample.ts][billingaccountslistsample] | Lists the billing accounts that a user has access to. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsList.json | -| [billingAccountsUpdateSample.ts][billingaccountsupdatesample] | Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.json | -| [billingPeriodsGetSample.ts][billingperiodsgetsample] | Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json | -| [billingPeriodsListSample.ts][billingperiodslistsample] | Lists the available billing periods for a subscription in reverse chronological order. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json | -| [billingPermissionsListByBillingAccountSample.ts][billingpermissionslistbybillingaccountsample] | Lists the billing permissions the caller has on a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountPermissionsList.json | -| [billingPermissionsListByBillingProfileSample.ts][billingpermissionslistbybillingprofilesample] | Lists the billing permissions the caller has on a billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilePermissionsList.json | -| [billingPermissionsListByCustomerSample.ts][billingpermissionslistbycustomersample] | Lists the billing permissions the caller has for a customer. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPermissionsList.json | -| [billingPermissionsListByInvoiceSectionsSample.ts][billingpermissionslistbyinvoicesectionssample] | Lists the billing permissions the caller has on an invoice section. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json | -| [billingProfilesCreateOrUpdateSample.ts][billingprofilescreateorupdatesample] | Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.json | -| [billingProfilesGetSample.ts][billingprofilesgetsample] | Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json | -| [billingProfilesListByBillingAccountSample.ts][billingprofileslistbybillingaccountsample] | Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json | -| [billingPropertyGetSample.ts][billingpropertygetsample] | Get the billing properties for a subscription. This operation is not supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json | -| [billingPropertyUpdateSample.ts][billingpropertyupdatesample] | Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.json | -| [billingRoleAssignmentsDeleteByBillingAccountSample.ts][billingroleassignmentsdeletebybillingaccountsample] | Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json | -| [billingRoleAssignmentsDeleteByBillingProfileSample.ts][billingroleassignmentsdeletebybillingprofilesample] | Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json | -| [billingRoleAssignmentsDeleteByInvoiceSectionSample.ts][billingroleassignmentsdeletebyinvoicesectionsample] | Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json | -| [billingRoleAssignmentsGetByBillingAccountSample.ts][billingroleassignmentsgetbybillingaccountsample] | Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json | -| [billingRoleAssignmentsGetByBillingProfileSample.ts][billingroleassignmentsgetbybillingprofilesample] | Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignment.json | -| [billingRoleAssignmentsGetByInvoiceSectionSample.ts][billingroleassignmentsgetbyinvoicesectionsample] | Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignment.json | -| [billingRoleAssignmentsListByBillingAccountSample.ts][billingroleassignmentslistbybillingaccountsample] | Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json | -| [billingRoleAssignmentsListByBillingProfileSample.ts][billingroleassignmentslistbybillingprofilesample] | Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json | -| [billingRoleAssignmentsListByInvoiceSectionSample.ts][billingroleassignmentslistbyinvoicesectionsample] | Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentList.json | -| [billingRoleDefinitionsGetByBillingAccountSample.ts][billingroledefinitionsgetbybillingaccountsample] | Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json | -| [billingRoleDefinitionsGetByBillingProfileSample.ts][billingroledefinitionsgetbybillingprofilesample] | Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinition.json | -| [billingRoleDefinitionsGetByInvoiceSectionSample.ts][billingroledefinitionsgetbyinvoicesectionsample] | Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinition.json | -| [billingRoleDefinitionsListByBillingAccountSample.ts][billingroledefinitionslistbybillingaccountsample] | Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json | -| [billingRoleDefinitionsListByBillingProfileSample.ts][billingroledefinitionslistbybillingprofilesample] | Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json | -| [billingRoleDefinitionsListByInvoiceSectionSample.ts][billingroledefinitionslistbyinvoicesectionsample] | Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinitionsList.json | -| [billingSubscriptionsGetSample.ts][billingsubscriptionsgetsample] | Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json | -| [billingSubscriptionsListByBillingAccountSample.ts][billingsubscriptionslistbybillingaccountsample] | Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json | -| [billingSubscriptionsListByBillingProfileSample.ts][billingsubscriptionslistbybillingprofilesample] | Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingProfile.json | -| [billingSubscriptionsListByCustomerSample.ts][billingsubscriptionslistbycustomersample] | Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByCustomer.json | -| [billingSubscriptionsListByInvoiceSectionSample.ts][billingsubscriptionslistbyinvoicesectionsample] | Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByInvoiceSection.json | -| [billingSubscriptionsMoveSample.ts][billingsubscriptionsmovesample] | Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.json | -| [billingSubscriptionsUpdateSample.ts][billingsubscriptionsupdatesample] | Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.json | -| [billingSubscriptionsValidateMoveSample.ts][billingsubscriptionsvalidatemovesample] | Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.json | -| [customersGetSample.ts][customersgetsample] | Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json | -| [customersListByBillingAccountSample.ts][customerslistbybillingaccountsample] | Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingAccount.json | -| [customersListByBillingProfileSample.ts][customerslistbybillingprofilesample] | Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingProfile.json | -| [enrollmentAccountsGetSample.ts][enrollmentaccountsgetsample] | Gets a enrollment account by name. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json | -| [enrollmentAccountsListSample.ts][enrollmentaccountslistsample] | Lists the enrollment accounts the caller has access to. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json | -| [instructionsGetSample.ts][instructionsgetsample] | Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json | -| [instructionsListByBillingProfileSample.ts][instructionslistbybillingprofilesample] | Lists the instructions by billing profile id. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json | -| [instructionsPutSample.ts][instructionsputsample] | Creates or updates an instruction. These are custom billing instructions and are only applicable for certain customers. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json | -| [invoiceSectionsCreateOrUpdateSample.ts][invoicesectionscreateorupdatesample] | Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInvoiceSection.json | -| [invoiceSectionsGetSample.ts][invoicesectionsgetsample] | Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSection.json | -| [invoiceSectionsListByBillingProfileSample.ts][invoicesectionslistbybillingprofilesample] | Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListByBillingProfile.json | -| [invoicesDownloadBillingSubscriptionInvoiceSample.ts][invoicesdownloadbillingsubscriptioninvoicesample] | Gets a URL to download an invoice. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json | -| [invoicesDownloadInvoiceSample.ts][invoicesdownloadinvoicesample] | Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json | -| [invoicesDownloadMultipleBillingProfileInvoicesSample.ts][invoicesdownloadmultiplebillingprofileinvoicessample] | Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json | -| [invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts][invoicesdownloadmultiplebillingsubscriptioninvoicessample] | Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json | -| [invoicesGetByIdSample.ts][invoicesgetbyidsample] | Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceById.json | -| [invoicesGetBySubscriptionAndInvoiceIdSample.ts][invoicesgetbysubscriptionandinvoiceidsample] | Gets an invoice by subscription ID and invoice ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json | -| [invoicesGetSample.ts][invoicesgetsample] | Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json | -| [invoicesListByBillingAccountSample.ts][invoiceslistbybillingaccountsample] | Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json | -| [invoicesListByBillingProfileSample.ts][invoiceslistbybillingprofilesample] | Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfile.json | -| [invoicesListByBillingSubscriptionSample.ts][invoiceslistbybillingsubscriptionsample] | Lists the invoices for a subscription. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json | -| [policiesGetByBillingProfileSample.ts][policiesgetbybillingprofilesample] | Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Policy.json | -| [policiesGetByCustomerSample.ts][policiesgetbycustomersample] | Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPolicy.json | -| [policiesUpdateCustomerSample.ts][policiesupdatecustomersample] | Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateCustomerPolicy.json | -| [policiesUpdateSample.ts][policiesupdatesample] | Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdatePolicy.json | -| [productsGetSample.ts][productsgetsample] | Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Product.json | -| [productsListByBillingAccountSample.ts][productslistbybillingaccountsample] | Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingAccount.json | -| [productsListByBillingProfileSample.ts][productslistbybillingprofilesample] | Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingProfile.json | -| [productsListByCustomerSample.ts][productslistbycustomersample] | Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByCustomer.json | -| [productsListByInvoiceSectionSample.ts][productslistbyinvoicesectionsample] | Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByInvoiceSection.json | -| [productsMoveSample.ts][productsmovesample] | Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveProduct.json | -| [productsUpdateSample.ts][productsupdatesample] | Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateProduct.json | -| [productsValidateMoveSample.ts][productsvalidatemovesample] | Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveFailure.json | -| [reservationsListByBillingAccountSample.ts][reservationslistbybillingaccountsample] | Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.json | -| [reservationsListByBillingProfileSample.ts][reservationslistbybillingprofilesample] | Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingProfile.json | -| [transactionsListByInvoiceSample.ts][transactionslistbyinvoicesample] | Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/TransactionsListByInvoice.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/addressValidateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node dist/addressValidateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[addressvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/addressValidateSample.ts -[agreementsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/agreementsGetSample.ts -[agreementslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/agreementsListByBillingAccountSample.ts -[availablebalancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/availableBalancesGetSample.ts -[billingaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsGetSample.ts -[billingaccountslistinvoicesectionsbycreatesubscriptionpermissionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts -[billingaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsListSample.ts -[billingaccountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsUpdateSample.ts -[billingperiodsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsGetSample.ts -[billingperiodslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsListSample.ts -[billingpermissionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByBillingAccountSample.ts -[billingpermissionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByBillingProfileSample.ts -[billingpermissionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByCustomerSample.ts -[billingpermissionslistbyinvoicesectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByInvoiceSectionsSample.ts -[billingprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesCreateOrUpdateSample.ts -[billingprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesGetSample.ts -[billingprofileslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesListByBillingAccountSample.ts -[billingpropertygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyGetSample.ts -[billingpropertyupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyUpdateSample.ts -[billingroleassignmentsdeletebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts -[billingroleassignmentsdeletebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts -[billingroleassignmentsdeletebyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts -[billingroleassignmentsgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByBillingAccountSample.ts -[billingroleassignmentsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByBillingProfileSample.ts -[billingroleassignmentsgetbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByInvoiceSectionSample.ts -[billingroleassignmentslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByBillingAccountSample.ts -[billingroleassignmentslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByBillingProfileSample.ts -[billingroleassignmentslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByInvoiceSectionSample.ts -[billingroledefinitionsgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByBillingAccountSample.ts -[billingroledefinitionsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByBillingProfileSample.ts -[billingroledefinitionsgetbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByInvoiceSectionSample.ts -[billingroledefinitionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByBillingAccountSample.ts -[billingroledefinitionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByBillingProfileSample.ts -[billingroledefinitionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByInvoiceSectionSample.ts -[billingsubscriptionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsGetSample.ts -[billingsubscriptionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingAccountSample.ts -[billingsubscriptionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingProfileSample.ts -[billingsubscriptionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByCustomerSample.ts -[billingsubscriptionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByInvoiceSectionSample.ts -[billingsubscriptionsmovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsMoveSample.ts -[billingsubscriptionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsUpdateSample.ts -[billingsubscriptionsvalidatemovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsValidateMoveSample.ts -[customersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/customersGetSample.ts -[customerslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/customersListByBillingAccountSample.ts -[customerslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/customersListByBillingProfileSample.ts -[enrollmentaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/enrollmentAccountsGetSample.ts -[enrollmentaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/enrollmentAccountsListSample.ts -[instructionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsGetSample.ts -[instructionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsListByBillingProfileSample.ts -[instructionsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsPutSample.ts -[invoicesectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsCreateOrUpdateSample.ts -[invoicesectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsGetSample.ts -[invoicesectionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsListByBillingProfileSample.ts -[invoicesdownloadbillingsubscriptioninvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadBillingSubscriptionInvoiceSample.ts -[invoicesdownloadinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadInvoiceSample.ts -[invoicesdownloadmultiplebillingprofileinvoicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingProfileInvoicesSample.ts -[invoicesdownloadmultiplebillingsubscriptioninvoicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts -[invoicesgetbyidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetByIdSample.ts -[invoicesgetbysubscriptionandinvoiceidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetBySubscriptionAndInvoiceIdSample.ts -[invoicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetSample.ts -[invoiceslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingAccountSample.ts -[invoiceslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingProfileSample.ts -[invoiceslistbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingSubscriptionSample.ts -[policiesgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/policiesGetByBillingProfileSample.ts -[policiesgetbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/policiesGetByCustomerSample.ts -[policiesupdatecustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/policiesUpdateCustomerSample.ts -[policiesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/policiesUpdateSample.ts -[productsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/productsGetSample.ts -[productslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByBillingAccountSample.ts -[productslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByBillingProfileSample.ts -[productslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByCustomerSample.ts -[productslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByInvoiceSectionSample.ts -[productsmovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/productsMoveSample.ts -[productsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/productsUpdateSample.ts -[productsvalidatemovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/productsValidateMoveSample.ts -[reservationslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/reservationsListByBillingAccountSample.ts -[reservationslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/reservationsListByBillingProfileSample.ts -[transactionslistbyinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v4/typescript/src/transactionsListByInvoiceSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-billing?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billing/arm-billing/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/availableBalancesGetSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/availableBalancesGetSample.ts deleted file mode 100644 index 6918777ee0d5..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/availableBalancesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json - */ -async function availableBalanceByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.availableBalances.get( - billingAccountName, - billingProfileName - ); - console.log(result); -} - -availableBalanceByBillingProfile().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsGetSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsGetSample.ts deleted file mode 100644 index e30b6cbd58d0..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsGetSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - BillingAccountsGetOptionalParams, - BillingManagementClient -} from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a billing account by its ID. - * - * @summary Gets a billing account by its ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountWithExpand.json - */ -async function billingAccountWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const expand = "soldTo,billingProfiles,billingProfiles/invoiceSections"; - const options: BillingAccountsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingAccounts.get(billingAccountName, options); - console.log(result); -} - -billingAccountWithExpand().catch(console.error); - -/** - * This sample demonstrates how to Gets a billing account by its ID. - * - * @summary Gets a billing account by its ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccount.json - */ -async function billingAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingAccounts.get(billingAccountName); - console.log(result); -} - -billingAccounts().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsUpdateSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsUpdateSample.ts deleted file mode 100644 index e21553695cb6..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - BillingAccountUpdateRequest, - BillingManagementClient -} from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.json - */ -async function updateBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const parameters: BillingAccountUpdateRequest = { - displayName: "Test Account", - soldTo: { - addressLine1: "Test Address 1", - city: "Redmond", - companyName: "Contoso", - country: "US", - firstName: "Test", - lastName: "User", - postalCode: "12345", - region: "WA" - } - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingAccounts.beginUpdateAndWait( - billingAccountName, - parameters - ); - console.log(result); -} - -updateBillingAccount().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsGetSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsGetSample.ts deleted file mode 100644 index eabc4475bf66..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @summary Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json - */ -async function billingPeriodsGet() { - const subscriptionId = "subid"; - const billingPeriodName = "201702-1"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingPeriods.get(billingPeriodName); - console.log(result); -} - -billingPeriodsGet().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsListSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsListSample.ts deleted file mode 100644 index d65aa789d2c2..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPeriodsListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the available billing periods for a subscription in reverse chronological order. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @summary Lists the available billing periods for a subscription in reverse chronological order. This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json - */ -async function billingPeriodsList() { - const subscriptionId = "subid"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingPeriods.list()) { - resArray.push(item); - } - console.log(resArray); -} - -billingPeriodsList().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesCreateOrUpdateSample.ts deleted file mode 100644 index 57f95ff7785b..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesCreateOrUpdateSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingProfile, BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.json - */ -async function createBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const parameters: BillingProfile = { - billTo: { - addressLine1: "Test Address 1", - city: "Redmond", - country: "US", - firstName: "Test", - lastName: "User", - postalCode: "12345", - region: "WA" - }, - displayName: "Finance", - enabledAzurePlans: [{ skuId: "0001" }, { skuId: "0002" }], - invoiceEmailOptIn: true, - poNumber: "ABC12345" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingProfiles.beginCreateOrUpdateAndWait( - billingAccountName, - billingProfileName, - parameters - ); - console.log(result); -} - -createBillingProfile().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesGetSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesGetSample.ts deleted file mode 100644 index 03c4167088f7..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesGetSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - BillingProfilesGetOptionalParams, - BillingManagementClient -} from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json - */ -async function billingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingProfiles.get( - billingAccountName, - billingProfileName - ); - console.log(result); -} - -billingProfile().catch(console.error); - -/** - * This sample demonstrates how to Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileWithExpand.json - */ -async function billingProfileWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const expand = "invoiceSections"; - const options: BillingProfilesGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingProfiles.get( - billingAccountName, - billingProfileName, - options - ); - console.log(result); -} - -billingProfileWithExpand().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesListByBillingAccountSample.ts deleted file mode 100644 index b2db43b5a34c..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingProfilesListByBillingAccountSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - BillingProfilesListByBillingAccountOptionalParams, - BillingManagementClient -} from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json - */ -async function billingProfilesListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingProfiles.listByBillingAccount( - billingAccountName - )) { - resArray.push(item); - } - console.log(resArray); -} - -billingProfilesListByBillingAccount().catch(console.error); - -/** - * This sample demonstrates how to Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListWithExpand.json - */ -async function billingProfilesListWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const expand = "invoiceSections"; - const options: BillingProfilesListByBillingAccountOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingProfiles.listByBillingAccount( - billingAccountName, - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -billingProfilesListWithExpand().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyGetSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyGetSample.ts deleted file mode 100644 index 8dc937bc98e7..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyGetSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the billing properties for a subscription. This operation is not supported for billing accounts with agreement type Enterprise Agreement. - * - * @summary Get the billing properties for a subscription. This operation is not supported for billing accounts with agreement type Enterprise Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json - */ -async function billingProperty() { - const subscriptionId = "{subscriptionId}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingPropertyOperations.get(); - console.log(result); -} - -billingProperty().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyUpdateSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyUpdateSample.ts deleted file mode 100644 index 16d701c70b78..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPropertyUpdateSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingProperty, BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.json - */ -async function updateBillingProperty() { - const subscriptionId = "{subscriptionId}"; - const parameters: BillingProperty = { costCenter: "1010" }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingPropertyOperations.update(parameters); - console.log(result); -} - -updateBillingProperty().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts deleted file mode 100644 index 65e400154da8..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json - */ -async function billingAccountRoleAssignmentDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleAssignments.deleteByBillingAccount( - billingAccountName, - billingRoleAssignmentName - ); - console.log(result); -} - -billingAccountRoleAssignmentDelete().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts deleted file mode 100644 index bc9f4a251bf6..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json - */ -async function billingProfileRoleAssignmentDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleAssignments.deleteByBillingProfile( - billingAccountName, - billingProfileName, - billingRoleAssignmentName - ); - console.log(result); -} - -billingProfileRoleAssignmentDelete().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts deleted file mode 100644 index 7cf6465dbb09..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json - */ -async function invoiceSectionRoleAssignmentDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleAssignments.deleteByInvoiceSection( - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleAssignmentName - ); - console.log(result); -} - -invoiceSectionRoleAssignmentDelete().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByBillingAccountSample.ts deleted file mode 100644 index 815db5946fe3..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByBillingAccountSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json - */ -async function billingAccountRoleDefinition() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingRoleDefinitionName = "{billingRoleDefinitionName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleDefinitions.getByBillingAccount( - billingAccountName, - billingRoleDefinitionName - ); - console.log(result); -} - -billingAccountRoleDefinition().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingAccountSample.ts deleted file mode 100644 index 17bb72d99bd2..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingAccountSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json - */ -async function billingSubscriptionsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingSubscriptions.listByBillingAccount( - billingAccountName - )) { - resArray.push(item); - } - console.log(resArray); -} - -billingSubscriptionsListByBillingAccount().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingProfileSample.ts deleted file mode 100644 index 20aeffecf48d..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByBillingProfileSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @summary Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingProfile.json - */ -async function billingSubscriptionsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.billingSubscriptions.listByBillingProfile( - billingAccountName, - billingProfileName - )) { - resArray.push(item); - } - console.log(resArray); -} - -billingSubscriptionsListByBillingProfile().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsMoveSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsMoveSample.ts deleted file mode 100644 index c51d13d42949..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsMoveSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TransferBillingSubscriptionRequestProperties, - BillingManagementClient -} from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.json - */ -async function moveBillingSubscription() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters: TransferBillingSubscriptionRequestProperties = { - destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.beginMoveAndWait( - billingAccountName, - parameters - ); - console.log(result); -} - -moveBillingSubscription().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsUpdateSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsUpdateSample.ts deleted file mode 100644 index faa9718c3f8f..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsUpdateSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - BillingSubscription, - BillingManagementClient -} from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.json - */ -async function updateBillingProperty() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters: BillingSubscription = { costCenter: "ABC1234" }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.update( - billingAccountName, - parameters - ); - console.log(result); -} - -updateBillingProperty().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsValidateMoveSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsValidateMoveSample.ts deleted file mode 100644 index 9ea6ed29d3fb..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsValidateMoveSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TransferBillingSubscriptionRequestProperties, - BillingManagementClient -} from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.json - */ -async function subscriptionMoveValidateFailure() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters: TransferBillingSubscriptionRequestProperties = { - destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.validateMove( - billingAccountName, - parameters - ); - console.log(result); -} - -subscriptionMoveValidateFailure().catch(console.error); - -/** - * This sample demonstrates how to Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveSuccess.json - */ -async function subscriptionMoveValidateSuccess() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; - const parameters: TransferBillingSubscriptionRequestProperties = { - destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.validateMove( - billingAccountName, - parameters - ); - console.log(result); -} - -subscriptionMoveValidateSuccess().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/customersGetSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/customersGetSample.ts deleted file mode 100644 index 3d930a72089a..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/customersGetSample.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CustomersGetOptionalParams, - BillingManagementClient -} from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @summary Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json - */ -async function customer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.customers.get(billingAccountName, customerName); - console.log(result); -} - -customer().catch(console.error); - -/** - * This sample demonstrates how to Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @summary Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerWithExpand.json - */ -async function customerWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; - const expand = "enabledAzurePlans,resellers"; - const options: CustomersGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.customers.get( - billingAccountName, - customerName, - options - ); - console.log(result); -} - -customerWithExpand().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/customersListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/customersListByBillingAccountSample.ts deleted file mode 100644 index 7e8eccfa01e3..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/customersListByBillingAccountSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @summary Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingAccount.json - */ -async function customersListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.customers.listByBillingAccount( - billingAccountName - )) { - resArray.push(item); - } - console.log(resArray); -} - -customersListByBillingAccount().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsGetSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsGetSample.ts deleted file mode 100644 index 5847d40ae430..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @summary Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json - */ -async function instruction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const instructionName = "{instructionName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.instructions.get( - billingAccountName, - billingProfileName, - instructionName - ); - console.log(result); -} - -instruction().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsPutSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsPutSample.ts deleted file mode 100644 index e1f493246d83..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsPutSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Instruction, BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates an instruction. These are custom billing instructions and are only applicable for certain customers. - * - * @summary Creates or updates an instruction. These are custom billing instructions and are only applicable for certain customers. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json - */ -async function putInstruction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const instructionName = "{instructionName}"; - const parameters: Instruction = { - amount: 5000, - endDate: new Date("2020-12-30T21:26:47.997Z"), - startDate: new Date("2019-12-30T21:26:47.997Z") - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.instructions.put( - billingAccountName, - billingProfileName, - instructionName, - parameters - ); - console.log(result); -} - -putInstruction().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadBillingSubscriptionInvoiceSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadBillingSubscriptionInvoiceSample.ts deleted file mode 100644 index bf8be754eaa7..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadBillingSubscriptionInvoiceSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a URL to download an invoice. - * - * @summary Gets a URL to download an invoice. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json - */ -async function billingSubscriptionInvoiceDownload() { - const subscriptionId = "{subscriptionId}"; - const invoiceName = "{invoiceName}"; - const downloadToken = "DRS_12345"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadBillingSubscriptionInvoiceAndWait( - invoiceName, - downloadToken - ); - console.log(result); -} - -billingSubscriptionInvoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadInvoiceSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadInvoiceSample.ts deleted file mode 100644 index 1bf44bddc2a8..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadInvoiceSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json - */ -async function invoiceDownload() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const downloadToken = "DRS_12345"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadInvoiceAndWait( - billingAccountName, - invoiceName, - downloadToken - ); - console.log(result); -} - -invoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingProfileInvoicesSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingProfileInvoicesSample.ts deleted file mode 100644 index 058a862ed906..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingProfileInvoicesSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json - */ -async function billingProfileInvoiceDownload() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const downloadUrls: string[] = [ - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01" - ]; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadMultipleBillingProfileInvoicesAndWait( - billingAccountName, - downloadUrls - ); - console.log(result); -} - -billingProfileInvoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts deleted file mode 100644 index bb40c77f86bf..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesDownloadMultipleBillingSubscriptionInvoicesSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json - */ -async function billingSubscriptionInvoiceDownload() { - const subscriptionId = "{subscriptionId}"; - const downloadUrls: string[] = [ - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01" - ]; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadMultipleBillingSubscriptionInvoicesAndWait( - downloadUrls - ); - console.log(result); -} - -billingSubscriptionInvoiceDownload().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetByIdSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetByIdSample.ts deleted file mode 100644 index 3279cc1d55d6..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetByIdSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceById.json - */ -async function invoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.getById(invoiceName); - console.log(result); -} - -invoice().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetBySubscriptionAndInvoiceIdSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetBySubscriptionAndInvoiceIdSample.ts deleted file mode 100644 index 0d4c59bb8238..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetBySubscriptionAndInvoiceIdSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets an invoice by subscription ID and invoice ID. - * - * @summary Gets an invoice by subscription ID and invoice ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json - */ -async function billingSubscriptionsListByBillingAccount() { - const subscriptionId = "{subscriptionId}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.getBySubscriptionAndInvoiceId( - invoiceName - ); - console.log(result); -} - -billingSubscriptionsListByBillingAccount().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetSample.ts deleted file mode 100644 index 2cc3812c5b89..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesGetSample.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json - */ -async function creditNote() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -creditNote().catch(console.error); - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Invoice.json - */ -async function invoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -invoice().catch(console.error); - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceWithRebillDetails.json - */ -async function invoiceWithRebillDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -invoiceWithRebillDetails().catch(console.error); - -/** - * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/VoidInvoice.json - */ -async function voidInvoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.get(billingAccountName, invoiceName); - console.log(result); -} - -voidInvoice().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingAccountSample.ts deleted file mode 100644 index 2cc8ce5be017..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingAccountSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json - */ -async function billingAccountInvoicesList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingAccount( - billingAccountName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); -} - -billingAccountInvoicesList().catch(console.error); - -/** - * This sample demonstrates how to Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing account for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesListWithRebillDetails.json - */ -async function billingAccountInvoicesListWithRebillDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingAccount( - billingAccountName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); -} - -billingAccountInvoicesListWithRebillDetails().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingProfileSample.ts deleted file mode 100644 index 5c91a385387d..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoicesListByBillingProfileSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfile.json - */ -async function invoicesListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingProfile( - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); -} - -invoicesListByBillingProfile().catch(console.error); - -/** - * This sample demonstrates how to Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @summary Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfileWithRebillDetails.json - */ -async function invoicesListByBillingProfileWithRebillDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.invoices.listByBillingProfile( - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate - )) { - resArray.push(item); - } - console.log(resArray); -} - -invoicesListByBillingProfileWithRebillDetails().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/policiesUpdateSample.ts b/sdk/billing/arm-billing/samples/v4/typescript/src/policiesUpdateSample.ts deleted file mode 100644 index da13f56f888d..000000000000 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/policiesUpdateSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Policy, BillingManagementClient } from "@azure/arm-billing"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @summary Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdatePolicy.json - */ -async function updatePolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const parameters: Policy = { - marketplacePurchases: "OnlyFreeAllowed", - reservationPurchases: "NotAllowed", - viewCharges: "Allowed" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.policies.update( - billingAccountName, - billingProfileName, - parameters - ); - console.log(result); -} - -updatePolicy().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/README.md b/sdk/billing/arm-billing/samples/v5/javascript/README.md new file mode 100644 index 000000000000..b180ae2e781f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/README.md @@ -0,0 +1,424 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [addressValidateSample.js][addressvalidatesample] | Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateInvalid.json | +| [agreementsGetSample.js][agreementsgetsample] | Gets an agreement by ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementByName.json | +| [agreementsListByBillingAccountSample.js][agreementslistbybillingaccountsample] | Lists the agreements for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementsListByBillingAccount.json | +| [associatedTenantsCreateOrUpdateSample.js][associatedtenantscreateorupdatesample] | Create or update an associated tenant for the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsCreateOrUpdate.json | +| [associatedTenantsDeleteSample.js][associatedtenantsdeletesample] | Deletes an associated tenant for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsDelete.json | +| [associatedTenantsGetSample.js][associatedtenantsgetsample] | Gets an associated tenant by ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsGet.json | +| [associatedTenantsListByBillingAccountSample.js][associatedtenantslistbybillingaccountsample] | Lists the associated tenants that can collaborate with the billing account on commerce activities like viewing and downloading invoices, managing payments, making purchases, and managing or provisioning licenses. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsListByBillingAccount.json | +| [availableBalancesGetByBillingAccountSample.js][availablebalancesgetbybillingaccountsample] | The Available Credit or Payment on Account Balance for a billing account. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Online Services Program. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingAccount.json | +| [availableBalancesGetByBillingProfileSample.js][availablebalancesgetbybillingprofilesample] | The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingProfile.json | +| [billingAccountsAddPaymentTermsSample.js][billingaccountsaddpaymenttermssample] | Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsAdd.json | +| [billingAccountsCancelPaymentTermsSample.js][billingaccountscancelpaymenttermssample] | Cancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsCancel.json | +| [billingAccountsConfirmTransitionSample.js][billingaccountsconfirmtransitionsample] | Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsConfirmTransition.json | +| [billingAccountsGetSample.js][billingaccountsgetsample] | Gets a billing account by its ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithExpandForPONumber.json | +| [billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js][billingaccountslistinvoicesectionsbycreatesubscriptionpermissionsample] | Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsWithCreateSubscriptionPermissionList.json | +| [billingAccountsListSample.js][billingaccountslistsample] | Lists the billing accounts that a user has access to. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountForLegacyAccountDetails.json | +| [billingAccountsUpdateSample.js][billingaccountsupdatesample] | Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountUpdateWithPONumber.json | +| [billingAccountsValidatePaymentTermsSample.js][billingaccountsvalidatepaymenttermssample] | Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermInvalid.json | +| [billingPermissionsCheckAccessByBillingAccountSample.js][billingpermissionscheckaccessbybillingaccountsample] | Provides a list of check access response objects for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingAccount.json | +| [billingPermissionsCheckAccessByBillingProfileSample.js][billingpermissionscheckaccessbybillingprofilesample] | Provides a list of check access response objects for a billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingProfile.json | +| [billingPermissionsCheckAccessByCustomerSample.js][billingpermissionscheckaccessbycustomersample] | Provides a list of check access response objects for a customer. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByCustomer.json | +| [billingPermissionsCheckAccessByDepartmentSample.js][billingpermissionscheckaccessbydepartmentsample] | Provides a list of check access response objects for a department. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByDepartment.json | +| [billingPermissionsCheckAccessByEnrollmentAccountSample.js][billingpermissionscheckaccessbyenrollmentaccountsample] | Provides a list of check access response objects for an enrollment account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByEnrollmentAccount.json | +| [billingPermissionsCheckAccessByInvoiceSectionSample.js][billingpermissionscheckaccessbyinvoicesectionsample] | Provides a list of check access response objects for an invoice section. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByInvoiceSection.json | +| [billingPermissionsListByBillingAccountSample.js][billingpermissionslistbybillingaccountsample] | Lists the billing permissions the caller has on a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingAccount.json | +| [billingPermissionsListByBillingProfileSample.js][billingpermissionslistbybillingprofilesample] | Lists the billing permissions the caller has on a billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingProfile.json | +| [billingPermissionsListByCustomerAtBillingAccountSample.js][billingpermissionslistbycustomeratbillingaccountsample] | Lists the billing permissions the caller has for a customer at billing account level. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomerAtBillingAccount.json | +| [billingPermissionsListByCustomerSample.js][billingpermissionslistbycustomersample] | Lists the billing permissions the caller has for a customer. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomer.json | +| [billingPermissionsListByDepartmentSample.js][billingpermissionslistbydepartmentsample] | Lists the billing permissions the caller has for a department. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByDepartment.json | +| [billingPermissionsListByEnrollmentAccountSample.js][billingpermissionslistbyenrollmentaccountsample] | Lists the billing permissions the caller has for an enrollment account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByEnrollmentAccount.json | +| [billingPermissionsListByInvoiceSectionSample.js][billingpermissionslistbyinvoicesectionsample] | Lists the billing permissions the caller has for an invoice section. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByInvoiceSection.json | +| [billingProfilesCreateOrUpdateSample.js][billingprofilescreateorupdatesample] | Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesCreateOrUpdate.json | +| [billingProfilesDeleteSample.js][billingprofilesdeletesample] | Deletes a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesDelete.json | +| [billingProfilesGetSample.js][billingprofilesgetsample] | Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesGet.json | +| [billingProfilesListByBillingAccountSample.js][billingprofileslistbybillingaccountsample] | Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesListByBillingAccount.json | +| [billingProfilesValidateDeleteEligibilitySample.js][billingprofilesvalidatedeleteeligibilitysample] | Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilityFailure.json | +| [billingPropertyGetSample.js][billingpropertygetsample] | Gets the billing properties for a subscription x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMCA.json | +| [billingPropertyUpdateSample.js][billingpropertyupdatesample] | Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchCostCenter.json | +| [billingRequestsCreateOrUpdateSample.js][billingrequestscreateorupdatesample] | Create or update a billing request. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsCreateOrUpdate.json | +| [billingRequestsGetSample.js][billingrequestsgetsample] | Gets a billing request by its ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsGet.json | +| [billingRequestsListByBillingAccountSample.js][billingrequestslistbybillingaccountsample] | The list of billing requests submitted for the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingAccount.json | +| [billingRequestsListByBillingProfileSample.js][billingrequestslistbybillingprofilesample] | The list of billing requests submitted for the billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingProfile.json | +| [billingRequestsListByCustomerSample.js][billingrequestslistbycustomersample] | The list of billing requests submitted for the customer. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByCustomer.json | +| [billingRequestsListByInvoiceSectionSample.js][billingrequestslistbyinvoicesectionsample] | The list of billing requests submitted for the invoice section. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByInvoiceSection.json | +| [billingRequestsListByUserSample.js][billingrequestslistbyusersample] | The list of billing requests submitted by a user. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUser.json | +| [billingRoleAssignmentsCreateByBillingAccountSample.js][billingroleassignmentscreatebybillingaccountsample] | Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingAccount.json | +| [billingRoleAssignmentsCreateByBillingProfileSample.js][billingroleassignmentscreatebybillingprofilesample] | Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingProfile.json | +| [billingRoleAssignmentsCreateByCustomerSample.js][billingroleassignmentscreatebycustomersample] | Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByCustomer.json | +| [billingRoleAssignmentsCreateByInvoiceSectionSample.js][billingroleassignmentscreatebyinvoicesectionsample] | Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByInvoiceSection.json | +| [billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.js][billingroleassignmentscreateorupdatebybillingaccountsample] | Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByBillingAccount.json | +| [billingRoleAssignmentsCreateOrUpdateByDepartmentSample.js][billingroleassignmentscreateorupdatebydepartmentsample] | Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByDepartment.json | +| [billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.js][billingroleassignmentscreateorupdatebyenrollmentaccountsample] | Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByEnrollmentAccount.json | +| [billingRoleAssignmentsDeleteByBillingAccountSample.js][billingroleassignmentsdeletebybillingaccountsample] | Deletes a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingAccount.json | +| [billingRoleAssignmentsDeleteByBillingProfileSample.js][billingroleassignmentsdeletebybillingprofilesample] | Deletes a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingProfile.json | +| [billingRoleAssignmentsDeleteByCustomerSample.js][billingroleassignmentsdeletebycustomersample] | Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByCustomer.json | +| [billingRoleAssignmentsDeleteByDepartmentSample.js][billingroleassignmentsdeletebydepartmentsample] | Deletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByDepartment.json | +| [billingRoleAssignmentsDeleteByEnrollmentAccountSample.js][billingroleassignmentsdeletebyenrollmentaccountsample] | Deletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByEnrollmentAccount.json | +| [billingRoleAssignmentsDeleteByInvoiceSectionSample.js][billingroleassignmentsdeletebyinvoicesectionsample] | Deletes a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByInvoiceSection.json | +| [billingRoleAssignmentsGetByBillingAccountSample.js][billingroleassignmentsgetbybillingaccountsample] | Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingAccount.json | +| [billingRoleAssignmentsGetByBillingProfileSample.js][billingroleassignmentsgetbybillingprofilesample] | Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingProfile.json | +| [billingRoleAssignmentsGetByCustomerSample.js][billingroleassignmentsgetbycustomersample] | Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByCustomer.json | +| [billingRoleAssignmentsGetByDepartmentSample.js][billingroleassignmentsgetbydepartmentsample] | Gets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByDepartment.json | +| [billingRoleAssignmentsGetByEnrollmentAccountSample.js][billingroleassignmentsgetbyenrollmentaccountsample] | Gets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByEnrollmentAccount.json | +| [billingRoleAssignmentsGetByInvoiceSectionSample.js][billingroleassignmentsgetbyinvoicesectionsample] | Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByInvoiceSection.json | +| [billingRoleAssignmentsListByBillingAccountSample.js][billingroleassignmentslistbybillingaccountsample] | Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingAccount.json | +| [billingRoleAssignmentsListByBillingProfileSample.js][billingroleassignmentslistbybillingprofilesample] | Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingProfile.json | +| [billingRoleAssignmentsListByCustomerSample.js][billingroleassignmentslistbycustomersample] | Lists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByCustomer.json | +| [billingRoleAssignmentsListByDepartmentSample.js][billingroleassignmentslistbydepartmentsample] | Lists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByDepartment.json | +| [billingRoleAssignmentsListByEnrollmentAccountSample.js][billingroleassignmentslistbyenrollmentaccountsample] | Lists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByEnrollmentAccount.json | +| [billingRoleAssignmentsListByInvoiceSectionSample.js][billingroleassignmentslistbyinvoicesectionsample] | Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByInvoiceSection.json | +| [billingRoleAssignmentsResolveByBillingAccountSample.js][billingroleassignmentsresolvebybillingaccountsample] | Lists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingAccount.json | +| [billingRoleAssignmentsResolveByBillingProfileSample.js][billingroleassignmentsresolvebybillingprofilesample] | Lists the role assignments for the caller on an billing profile while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingProfile.json | +| [billingRoleAssignmentsResolveByCustomerSample.js][billingroleassignmentsresolvebycustomersample] | Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByCustomer.json | +| [billingRoleAssignmentsResolveByInvoiceSectionSample.js][billingroleassignmentsresolvebyinvoicesectionsample] | Lists the role assignments for the caller on an invoice section while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByInvoiceSection.json | +| [billingRoleDefinitionGetByBillingAccountSample.js][billingroledefinitiongetbybillingaccountsample] | Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingAccount.json | +| [billingRoleDefinitionGetByBillingProfileSample.js][billingroledefinitiongetbybillingprofilesample] | Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingProfile.json | +| [billingRoleDefinitionGetByCustomerSample.js][billingroledefinitiongetbycustomersample] | Gets the definition for a role on a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByCustomer.json | +| [billingRoleDefinitionGetByDepartmentSample.js][billingroledefinitiongetbydepartmentsample] | Gets the definition for a role on a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByDepartment.json | +| [billingRoleDefinitionGetByEnrollmentAccountSample.js][billingroledefinitiongetbyenrollmentaccountsample] | Gets the definition for a role on an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByEnrollmentAccount.json | +| [billingRoleDefinitionGetByInvoiceSectionSample.js][billingroledefinitiongetbyinvoicesectionsample] | Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByInvoiceSection.json | +| [billingRoleDefinitionListByBillingAccountSample.js][billingroledefinitionlistbybillingaccountsample] | Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingAccount.json | +| [billingRoleDefinitionListByBillingProfileSample.js][billingroledefinitionlistbybillingprofilesample] | Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingProfile.json | +| [billingRoleDefinitionListByCustomerSample.js][billingroledefinitionlistbycustomersample] | Lists the role definitions for a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByCustomer.json | +| [billingRoleDefinitionListByDepartmentSample.js][billingroledefinitionlistbydepartmentsample] | List the definition for a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByDepartment.json | +| [billingRoleDefinitionListByEnrollmentAccountSample.js][billingroledefinitionlistbyenrollmentaccountsample] | List the definition for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByEnrollmentAccount.json | +| [billingRoleDefinitionListByInvoiceSectionSample.js][billingroledefinitionlistbyinvoicesectionsample] | Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByInvoiceSection.json | +| [billingSubscriptionsAliasesCreateOrUpdateSample.js][billingsubscriptionsaliasescreateorupdatesample] | Creates or updates a billing subscription by its alias ID. The operation is supported for seat based billing subscriptions. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasCreateOrUpdate.json | +| [billingSubscriptionsAliasesGetSample.js][billingsubscriptionsaliasesgetsample] | Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasGet.json | +| [billingSubscriptionsAliasesListByBillingAccountSample.js][billingsubscriptionsaliaseslistbybillingaccountsample] | Lists the subscription aliases for a billing account. The operation is supported for seat based billing subscriptions. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasList.json | +| [billingSubscriptionsCancelSample.js][billingsubscriptionscancelsample] | Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsCancel.json | +| [billingSubscriptionsDeleteSample.js][billingsubscriptionsdeletesample] | Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsDelete.json | +| [billingSubscriptionsGetByBillingProfileSample.js][billingsubscriptionsgetbybillingprofilesample] | Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionGetByBillingProfile.json | +| [billingSubscriptionsGetSample.js][billingsubscriptionsgetsample] | Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsGet.json | +| [billingSubscriptionsListByBillingAccountSample.js][billingsubscriptionslistbybillingaccountsample] | Lists the subscriptions for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingAccount.json | +| [billingSubscriptionsListByBillingProfileSample.js][billingsubscriptionslistbybillingprofilesample] | Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileEA.json | +| [billingSubscriptionsListByCustomerAtBillingAccountSample.js][billingsubscriptionslistbycustomeratbillingaccountsample] | Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomerAtBillingAccount.json | +| [billingSubscriptionsListByCustomerSample.js][billingsubscriptionslistbycustomersample] | Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomer.json | +| [billingSubscriptionsListByEnrollmentAccountSample.js][billingsubscriptionslistbyenrollmentaccountsample] | Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByEnrollmentAccount.json | +| [billingSubscriptionsListByInvoiceSectionSample.js][billingsubscriptionslistbyinvoicesectionsample] | Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByInvoiceSection.json | +| [billingSubscriptionsMergeSample.js][billingsubscriptionsmergesample] | Merges the billing subscription provided in the request with a target billing subscription. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsMerge.json | +| [billingSubscriptionsMoveSample.js][billingsubscriptionsmovesample] | Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionMove.json | +| [billingSubscriptionsSplitSample.js][billingsubscriptionssplitsample] | Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsSplit.json | +| [billingSubscriptionsUpdateSample.js][billingsubscriptionsupdatesample] | Updates the properties of a billing subscription. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsUpdate.json | +| [billingSubscriptionsValidateMoveEligibilitySample.js][billingsubscriptionsvalidatemoveeligibilitysample] | Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveFailure.json | +| [customersGetByBillingAccountSample.js][customersgetbybillingaccountsample] | Gets a customer by its ID at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGetByBillingAccount.json | +| [customersGetSample.js][customersgetsample] | Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGet.json | +| [customersListByBillingAccountSample.js][customerslistbybillingaccountsample] | Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingAccount.json | +| [customersListByBillingProfileSample.js][customerslistbybillingprofilesample] | Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingProfile.json | +| [departmentsGetSample.js][departmentsgetsample] | Gets a department by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentGet.json | +| [departmentsListByBillingAccountSample.js][departmentslistbybillingaccountsample] | Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentsListByBillingAccount.json | +| [enrollmentAccountsGetByDepartmentSample.js][enrollmentaccountsgetbydepartmentsample] | Gets an enrollment account by department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountByDepartment.json | +| [enrollmentAccountsGetSample.js][enrollmentaccountsgetsample] | Gets an enrollment account by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountGet.json | +| [enrollmentAccountsListByBillingAccountSample.js][enrollmentaccountslistbybillingaccountsample] | Lists the enrollment accounts for a billing account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByBillingAccount.json | +| [enrollmentAccountsListByDepartmentSample.js][enrollmentaccountslistbydepartmentsample] | Lists the enrollment accounts for a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByDepartment.json | +| [invoiceSectionsCreateOrUpdateSample.js][invoicesectionscreateorupdatesample] | Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsCreateOrUpdate.json | +| [invoiceSectionsDeleteSample.js][invoicesectionsdeletesample] | Deletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsDelete.json | +| [invoiceSectionsGetSample.js][invoicesectionsgetsample] | Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsGet.json | +| [invoiceSectionsListByBillingProfileSample.js][invoicesectionslistbybillingprofilesample] | Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsListByBillingProfile.json | +| [invoiceSectionsValidateDeleteEligibilitySample.js][invoicesectionsvalidatedeleteeligibilitysample] | Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilityFailure.json | +| [invoicesAmendSample.js][invoicesamendsample] | Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesAmend.json | +| [invoicesDownloadByBillingAccountSample.js][invoicesdownloadbybillingaccountsample] | Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingAccount.json | +| [invoicesDownloadByBillingSubscriptionSample.js][invoicesdownloadbybillingsubscriptionsample] | Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingSubscription.json | +| [invoicesDownloadDocumentsByBillingAccountSample.js][invoicesdownloaddocumentsbybillingaccountsample] | Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingAccount.json | +| [invoicesDownloadDocumentsByBillingSubscriptionSample.js][invoicesdownloaddocumentsbybillingsubscriptionsample] | Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingSubscription.json | +| [invoicesDownloadSummaryByBillingAccountSample.js][invoicesdownloadsummarybybillingaccountsample] | Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadSummaryByBillingAccount.json | +| [invoicesGetByBillingAccountSample.js][invoicesgetbybillingaccountsample] | Gets an invoice by billing account name and ID. The operation is supported for all billing account types. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingAccount.json | +| [invoicesGetByBillingSubscriptionSample.js][invoicesgetbybillingsubscriptionsample] | Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingSubscription.json | +| [invoicesGetSample.js][invoicesgetsample] | Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGet.json | +| [invoicesListByBillingAccountSample.js][invoiceslistbybillingaccountsample] | Lists the invoices for a billing account for a given start date and end date. The operation is supported for all billing account types. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingAccount.json | +| [invoicesListByBillingProfileSample.js][invoiceslistbybillingprofilesample] | Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingProfile.json | +| [invoicesListByBillingSubscriptionSample.js][invoiceslistbybillingsubscriptionsample] | Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingSubscription.json | +| [operationsListSample.js][operationslistsample] | List of operations supported by provider. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/operationsList.json | +| [partnerTransfersCancelSample.js][partnertransferscancelsample] | Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersCancel.json | +| [partnerTransfersGetSample.js][partnertransfersgetsample] | Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersGet.json | +| [partnerTransfersInitiateSample.js][partnertransfersinitiatesample] | Sends a request to a user in a customer's billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersInitiate.json | +| [partnerTransfersListSample.js][partnertransferslistsample] | Lists the transfer requests sent to a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersList.json | +| [paymentMethodsDeleteByUserSample.js][paymentmethodsdeletebyusersample] | Deletes a payment method owned by the caller. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsDeleteByUser.json | +| [paymentMethodsGetByBillingAccountSample.js][paymentmethodsgetbybillingaccountsample] | Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingAccount.json | +| [paymentMethodsGetByBillingProfileSample.js][paymentmethodsgetbybillingprofilesample] | Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingProfile.json | +| [paymentMethodsGetByUserSample.js][paymentmethodsgetbyusersample] | Gets a payment method owned by the caller. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByUser.json | +| [paymentMethodsListByBillingAccountSample.js][paymentmethodslistbybillingaccountsample] | Lists the payment methods available for a billing account. Along with the payment methods owned by the caller, these payment methods can be attached to a billing profile to make payments. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingAccount.json | +| [paymentMethodsListByBillingProfileSample.js][paymentmethodslistbybillingprofilesample] | Lists payment methods attached to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingProfile.json | +| [paymentMethodsListByUserSample.js][paymentmethodslistbyusersample] | Lists the payment methods owned by the caller. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByUser.json | +| [policiesCreateOrUpdateByBillingAccountSample.js][policiescreateorupdatebybillingaccountsample] | Update the policies for a billing account of Enterprise Agreement type. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingAccount.json | +| [policiesCreateOrUpdateByBillingProfileSample.js][policiescreateorupdatebybillingprofilesample] | Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingProfile.json | +| [policiesCreateOrUpdateByCustomerAtBillingAccountSample.js][policiescreateorupdatebycustomeratbillingaccountsample] | Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomerAtBillingAccount.json | +| [policiesCreateOrUpdateByCustomerSample.js][policiescreateorupdatebycustomersample] | Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomer.json | +| [policiesGetByBillingAccountSample.js][policiesgetbybillingaccountsample] | Get the policies for a billing account of Enterprise Agreement type. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingAccount.json | +| [policiesGetByBillingProfileSample.js][policiesgetbybillingprofilesample] | Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingProfile.json | +| [policiesGetByCustomerAtBillingAccountSample.js][policiesgetbycustomeratbillingaccountsample] | Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomerAtBillingAccount.json | +| [policiesGetByCustomerSample.js][policiesgetbycustomersample] | Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomer.json | +| [policiesGetBySubscriptionSample.js][policiesgetbysubscriptionsample] | Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetBySubscription.json | +| [productsGetSample.js][productsgetsample] | Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsGet.json | +| [productsListByBillingAccountSample.js][productslistbybillingaccountsample] | Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingAccount.json | +| [productsListByBillingProfileSample.js][productslistbybillingprofilesample] | Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingProfile.json | +| [productsListByCustomerSample.js][productslistbycustomersample] | Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByCustomer.json | +| [productsListByInvoiceSectionSample.js][productslistbyinvoicesectionsample] | Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByInvoiceSection.json | +| [productsMoveSample.js][productsmovesample] | Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productMove.json | +| [productsUpdateSample.js][productsupdatesample] | Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsUpdate.json | +| [productsValidateMoveEligibilitySample.js][productsvalidatemoveeligibilitysample] | Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveFailure.json | +| [recipientTransfersAcceptSample.js][recipienttransfersacceptsample] | Accepts a transfer request. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersAccept.json | +| [recipientTransfersDeclineSample.js][recipienttransfersdeclinesample] | Declines a transfer request. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersDecline.json | +| [recipientTransfersGetSample.js][recipienttransfersgetsample] | Gets a transfer request by ID. The caller must be the recipient of the transfer request. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersGet.json | +| [recipientTransfersListSample.js][recipienttransferslistsample] | Lists the transfer requests received by the caller. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersList.json | +| [recipientTransfersValidateSample.js][recipienttransfersvalidatesample] | Validates if a subscription or a reservation can be transferred. Use this operation to validate your subscriptions or reservation before using the accept transfer operation. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersValidate.json | +| [reservationOrdersGetByBillingAccountSample.js][reservationordersgetbybillingaccountsample] | Get the details of the ReservationOrder in the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccount.json | +| [reservationOrdersListByBillingAccountSample.js][reservationorderslistbybillingaccountsample] | List all the `ReservationOrders in the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrdersListByBillingAccount.json | +| [reservationsGetByReservationOrderSample.js][reservationsgetbyreservationordersample] | Get specific Reservation details in the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccount.json | +| [reservationsListByBillingAccountSample.js][reservationslistbybillingaccountsample] | Lists the reservations in the billing account and the roll up counts of reservations group by provisioning states. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingAccount.json | +| [reservationsListByBillingProfileSample.js][reservationslistbybillingprofilesample] | Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingProfile.json | +| [reservationsListByReservationOrderSample.js][reservationslistbyreservationordersample] | List Reservations within a single ReservationOrder in the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsGetFromOrderByBillingAccount.json | +| [reservationsUpdateByBillingAccountSample.js][reservationsupdatebybillingaccountsample] | Update reservation by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationUpdateByBillingAccount.json | +| [savingsPlanOrdersGetByBillingAccountSample.js][savingsplanordersgetbybillingaccountsample] | Get a savings plan order by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderGetByBillingAccount.json | +| [savingsPlanOrdersListByBillingAccountSample.js][savingsplanorderslistbybillingaccountsample] | List all Savings plan orders by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderListByBillingAccount.json | +| [savingsPlansGetByBillingAccountSample.js][savingsplansgetbybillingaccountsample] | Get savings plan by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetByBillingAccount.json | +| [savingsPlansListByBillingAccountSample.js][savingsplanslistbybillingaccountsample] | List savings plans by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListByBillingAccount.json | +| [savingsPlansListBySavingsPlanOrderSample.js][savingsplanslistbysavingsplanordersample] | List savings plans in an order by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListBySavingsPlanOrders.json | +| [savingsPlansUpdateByBillingAccountSample.js][savingsplansupdatebybillingaccountsample] | Update savings plan by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanUpdateByBillingAccount.json | +| [savingsPlansValidateUpdateByBillingAccountSample.js][savingsplansvalidateupdatebybillingaccountsample] | Validate savings plan patch by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanValidateUpdateByBillingAccount.json | +| [transactionsGetTransactionSummaryByInvoiceSample.js][transactionsgettransactionsummarybyinvoicesample] | Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionSummaryGetByInvoice.json | +| [transactionsListByBillingProfileSample.js][transactionslistbybillingprofilesample] | Lists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByBillingProfile.json | +| [transactionsListByCustomerSample.js][transactionslistbycustomersample] | Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByCustomer.json | +| [transactionsListByInvoiceSample.js][transactionslistbyinvoicesample] | Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoice.json | +| [transactionsListByInvoiceSectionSample.js][transactionslistbyinvoicesectionsample] | Lists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoiceSection.json | +| [transactionsTransactionsDownloadByInvoiceSample.js][transactionstransactionsdownloadbyinvoicesample] | Gets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsDownloadByInvoice.json | +| [transfersCancelSample.js][transferscancelsample] | Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersCancel.json | +| [transfersGetSample.js][transfersgetsample] | Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersGet.json | +| [transfersInitiateSample.js][transfersinitiatesample] | Sends a request to a user in another billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersInitiate.json | +| [transfersListSample.js][transferslistsample] | Lists the transfer requests for an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersList.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node addressValidateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node addressValidateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[addressvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/addressValidateSample.js +[agreementsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/agreementsGetSample.js +[agreementslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/agreementsListByBillingAccountSample.js +[associatedtenantscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsCreateOrUpdateSample.js +[associatedtenantsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsDeleteSample.js +[associatedtenantsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsGetSample.js +[associatedtenantslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsListByBillingAccountSample.js +[availablebalancesgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingAccountSample.js +[availablebalancesgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingProfileSample.js +[billingaccountsaddpaymenttermssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsAddPaymentTermsSample.js +[billingaccountscancelpaymenttermssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsCancelPaymentTermsSample.js +[billingaccountsconfirmtransitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsConfirmTransitionSample.js +[billingaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsGetSample.js +[billingaccountslistinvoicesectionsbycreatesubscriptionpermissionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js +[billingaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsListSample.js +[billingaccountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsUpdateSample.js +[billingaccountsvalidatepaymenttermssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsValidatePaymentTermsSample.js +[billingpermissionscheckaccessbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingAccountSample.js +[billingpermissionscheckaccessbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingProfileSample.js +[billingpermissionscheckaccessbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByCustomerSample.js +[billingpermissionscheckaccessbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByDepartmentSample.js +[billingpermissionscheckaccessbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByEnrollmentAccountSample.js +[billingpermissionscheckaccessbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByInvoiceSectionSample.js +[billingpermissionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByBillingAccountSample.js +[billingpermissionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByBillingProfileSample.js +[billingpermissionslistbycustomeratbillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByCustomerAtBillingAccountSample.js +[billingpermissionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByCustomerSample.js +[billingpermissionslistbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByDepartmentSample.js +[billingpermissionslistbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByEnrollmentAccountSample.js +[billingpermissionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByInvoiceSectionSample.js +[billingprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesCreateOrUpdateSample.js +[billingprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesDeleteSample.js +[billingprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesGetSample.js +[billingprofileslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesListByBillingAccountSample.js +[billingprofilesvalidatedeleteeligibilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesValidateDeleteEligibilitySample.js +[billingpropertygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPropertyGetSample.js +[billingpropertyupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingPropertyUpdateSample.js +[billingrequestscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsCreateOrUpdateSample.js +[billingrequestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsGetSample.js +[billingrequestslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingAccountSample.js +[billingrequestslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingProfileSample.js +[billingrequestslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByCustomerSample.js +[billingrequestslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByInvoiceSectionSample.js +[billingrequestslistbyusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByUserSample.js +[billingroleassignmentscreatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingAccountSample.js +[billingroleassignmentscreatebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingProfileSample.js +[billingroleassignmentscreatebycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByCustomerSample.js +[billingroleassignmentscreatebyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByInvoiceSectionSample.js +[billingroleassignmentscreateorupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.js +[billingroleassignmentscreateorupdatebydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.js +[billingroleassignmentscreateorupdatebyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.js +[billingroleassignmentsdeletebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js +[billingroleassignmentsdeletebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js +[billingroleassignmentsdeletebycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByCustomerSample.js +[billingroleassignmentsdeletebydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByDepartmentSample.js +[billingroleassignmentsdeletebyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByEnrollmentAccountSample.js +[billingroleassignmentsdeletebyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js +[billingroleassignmentsgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByBillingAccountSample.js +[billingroleassignmentsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByBillingProfileSample.js +[billingroleassignmentsgetbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByCustomerSample.js +[billingroleassignmentsgetbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByDepartmentSample.js +[billingroleassignmentsgetbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByEnrollmentAccountSample.js +[billingroleassignmentsgetbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByInvoiceSectionSample.js +[billingroleassignmentslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByBillingAccountSample.js +[billingroleassignmentslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByBillingProfileSample.js +[billingroleassignmentslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByCustomerSample.js +[billingroleassignmentslistbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByDepartmentSample.js +[billingroleassignmentslistbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByEnrollmentAccountSample.js +[billingroleassignmentslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByInvoiceSectionSample.js +[billingroleassignmentsresolvebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingAccountSample.js +[billingroleassignmentsresolvebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingProfileSample.js +[billingroleassignmentsresolvebycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByCustomerSample.js +[billingroleassignmentsresolvebyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByInvoiceSectionSample.js +[billingroledefinitiongetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByBillingAccountSample.js +[billingroledefinitiongetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByBillingProfileSample.js +[billingroledefinitiongetbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByCustomerSample.js +[billingroledefinitiongetbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByDepartmentSample.js +[billingroledefinitiongetbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByEnrollmentAccountSample.js +[billingroledefinitiongetbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByInvoiceSectionSample.js +[billingroledefinitionlistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByBillingAccountSample.js +[billingroledefinitionlistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByBillingProfileSample.js +[billingroledefinitionlistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByCustomerSample.js +[billingroledefinitionlistbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByDepartmentSample.js +[billingroledefinitionlistbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByEnrollmentAccountSample.js +[billingroledefinitionlistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByInvoiceSectionSample.js +[billingsubscriptionsaliasescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesCreateOrUpdateSample.js +[billingsubscriptionsaliasesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesGetSample.js +[billingsubscriptionsaliaseslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesListByBillingAccountSample.js +[billingsubscriptionscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsCancelSample.js +[billingsubscriptionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsDeleteSample.js +[billingsubscriptionsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsGetByBillingProfileSample.js +[billingsubscriptionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsGetSample.js +[billingsubscriptionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByBillingAccountSample.js +[billingsubscriptionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByBillingProfileSample.js +[billingsubscriptionslistbycustomeratbillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByCustomerAtBillingAccountSample.js +[billingsubscriptionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByCustomerSample.js +[billingsubscriptionslistbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByEnrollmentAccountSample.js +[billingsubscriptionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByInvoiceSectionSample.js +[billingsubscriptionsmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMergeSample.js +[billingsubscriptionsmovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMoveSample.js +[billingsubscriptionssplitsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsSplitSample.js +[billingsubscriptionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsUpdateSample.js +[billingsubscriptionsvalidatemoveeligibilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsValidateMoveEligibilitySample.js +[customersgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/customersGetByBillingAccountSample.js +[customersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/customersGetSample.js +[customerslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/customersListByBillingAccountSample.js +[customerslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/customersListByBillingProfileSample.js +[departmentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/departmentsGetSample.js +[departmentslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/departmentsListByBillingAccountSample.js +[enrollmentaccountsgetbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetByDepartmentSample.js +[enrollmentaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetSample.js +[enrollmentaccountslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByBillingAccountSample.js +[enrollmentaccountslistbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByDepartmentSample.js +[invoicesectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsCreateOrUpdateSample.js +[invoicesectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsDeleteSample.js +[invoicesectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsGetSample.js +[invoicesectionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsListByBillingProfileSample.js +[invoicesectionsvalidatedeleteeligibilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsValidateDeleteEligibilitySample.js +[invoicesamendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesAmendSample.js +[invoicesdownloadbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingAccountSample.js +[invoicesdownloadbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingSubscriptionSample.js +[invoicesdownloaddocumentsbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadDocumentsByBillingAccountSample.js +[invoicesdownloaddocumentsbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadDocumentsByBillingSubscriptionSample.js +[invoicesdownloadsummarybybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadSummaryByBillingAccountSample.js +[invoicesgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingAccountSample.js +[invoicesgetbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingSubscriptionSample.js +[invoicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetSample.js +[invoiceslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingAccountSample.js +[invoiceslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingProfileSample.js +[invoiceslistbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingSubscriptionSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/operationsListSample.js +[partnertransferscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersCancelSample.js +[partnertransfersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersGetSample.js +[partnertransfersinitiatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersInitiateSample.js +[partnertransferslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersListSample.js +[paymentmethodsdeletebyusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsDeleteByUserSample.js +[paymentmethodsgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingAccountSample.js +[paymentmethodsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingProfileSample.js +[paymentmethodsgetbyusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByUserSample.js +[paymentmethodslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingAccountSample.js +[paymentmethodslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingProfileSample.js +[paymentmethodslistbyusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByUserSample.js +[policiescreateorupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByBillingAccountSample.js +[policiescreateorupdatebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByBillingProfileSample.js +[policiescreateorupdatebycustomeratbillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByCustomerAtBillingAccountSample.js +[policiescreateorupdatebycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByCustomerSample.js +[policiesgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByBillingAccountSample.js +[policiesgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByBillingProfileSample.js +[policiesgetbycustomeratbillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByCustomerAtBillingAccountSample.js +[policiesgetbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByCustomerSample.js +[policiesgetbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/policiesGetBySubscriptionSample.js +[productsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/productsGetSample.js +[productslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/productsListByBillingAccountSample.js +[productslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/productsListByBillingProfileSample.js +[productslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/productsListByCustomerSample.js +[productslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/productsListByInvoiceSectionSample.js +[productsmovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/productsMoveSample.js +[productsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/productsUpdateSample.js +[productsvalidatemoveeligibilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/productsValidateMoveEligibilitySample.js +[recipienttransfersacceptsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersAcceptSample.js +[recipienttransfersdeclinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersDeclineSample.js +[recipienttransfersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersGetSample.js +[recipienttransferslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersListSample.js +[recipienttransfersvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersValidateSample.js +[reservationordersgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersGetByBillingAccountSample.js +[reservationorderslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersListByBillingAccountSample.js +[reservationsgetbyreservationordersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/reservationsGetByReservationOrderSample.js +[reservationslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByBillingAccountSample.js +[reservationslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByBillingProfileSample.js +[reservationslistbyreservationordersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByReservationOrderSample.js +[reservationsupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/reservationsUpdateByBillingAccountSample.js +[savingsplanordersgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersGetByBillingAccountSample.js +[savingsplanorderslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersListByBillingAccountSample.js +[savingsplansgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansGetByBillingAccountSample.js +[savingsplanslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListByBillingAccountSample.js +[savingsplanslistbysavingsplanordersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListBySavingsPlanOrderSample.js +[savingsplansupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansUpdateByBillingAccountSample.js +[savingsplansvalidateupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansValidateUpdateByBillingAccountSample.js +[transactionsgettransactionsummarybyinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transactionsGetTransactionSummaryByInvoiceSample.js +[transactionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByBillingProfileSample.js +[transactionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByCustomerSample.js +[transactionslistbyinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByInvoiceSample.js +[transactionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByInvoiceSectionSample.js +[transactionstransactionsdownloadbyinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transactionsTransactionsDownloadByInvoiceSample.js +[transferscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transfersCancelSample.js +[transfersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transfersGetSample.js +[transfersinitiatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transfersInitiateSample.js +[transferslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/javascript/transfersListSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-billing?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billing/arm-billing/README.md diff --git a/sdk/billing/arm-billing/samples/v4/javascript/addressValidateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/addressValidateSample.js similarity index 66% rename from sdk/billing/arm-billing/samples/v4/javascript/addressValidateSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/addressValidateSample.js index 08b65f8dddf6..d8c2234f4b88 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/addressValidateSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/addressValidateSample.js @@ -10,16 +10,16 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. * * @summary Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressInvalid.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateInvalid.json */ -async function addressInvalid() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const address = { +async function addressValidateInvalid() { + const parameters = { addressLine1: "1 Test", city: "bellevue", country: "us", @@ -27,32 +27,34 @@ async function addressInvalid() { region: "wa", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.address.validate(address); + const client = new BillingManagementClient(credential); + const result = await client.address.validate(parameters); console.log(result); } -addressInvalid().catch(console.error); - /** * This sample demonstrates how to Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. * * @summary Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressValid.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateValid.json */ -async function addressValid() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const address = { - addressLine1: "1 Test Address", +async function addressValidateValid() { + const parameters = { + addressLine1: "1 Test", city: "bellevue", country: "us", postalCode: "12345", region: "wa", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.address.validate(address); + const client = new BillingManagementClient(credential); + const result = await client.address.validate(parameters); console.log(result); } -addressValid().catch(console.error); +async function main() { + addressValidateInvalid(); + addressValidateValid(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/agreementsGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/agreementsGetSample.js similarity index 67% rename from sdk/billing/arm-billing/samples/v4/javascript/agreementsGetSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/agreementsGetSample.js index 7c7ebaab0023..a3f34f5b7a68 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/agreementsGetSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/agreementsGetSample.js @@ -10,21 +10,26 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets an agreement by ID. * * @summary Gets an agreement by ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementByName.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementByName.json */ async function agreementByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const agreementName = "{agreementName}"; + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const agreementName = "ABC123"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.agreements.get(billingAccountName, agreementName); console.log(result); } -agreementByName().catch(console.error); +async function main() { + agreementByName(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/agreementsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/agreementsListByBillingAccountSample.js similarity index 66% rename from sdk/billing/arm-billing/samples/v4/javascript/agreementsListByBillingAccountSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/agreementsListByBillingAccountSample.js index e7c1ace2e20d..29c9e3a71fa7 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/agreementsListByBillingAccountSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/agreementsListByBillingAccountSample.js @@ -10,23 +10,30 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the agreements for a billing account. * * @summary Lists the agreements for a billing account. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementsListByBillingAccount.json */ async function agreementsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const expand = "Participants"; + const options = { expand }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.agreements.listByBillingAccount(billingAccountName)) { + for await (let item of client.agreements.listByBillingAccount(billingAccountName, options)) { resArray.push(item); } console.log(resArray); } -agreementsListByBillingAccount().catch(console.error); +async function main() { + agreementsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsCreateOrUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsCreateOrUpdateSample.js new file mode 100644 index 000000000000..18f3f586acd3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsCreateOrUpdateSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create or update an associated tenant for the billing account. + * + * @summary Create or update an associated tenant for the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsCreateOrUpdate.json + */ +async function associatedTenantsCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const associatedTenantName = "11111111-1111-1111-1111-111111111111"; + const parameters = { + properties: { + billingManagementState: "Active", + displayName: "Contoso Finance", + provisioningManagementState: "Pending", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.associatedTenants.beginCreateOrUpdateAndWait( + billingAccountName, + associatedTenantName, + parameters, + ); + console.log(result); +} + +async function main() { + associatedTenantsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsDeleteSample.js b/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsDeleteSample.js new file mode 100644 index 000000000000..813558f494d4 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsDeleteSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes an associated tenant for a billing account. + * + * @summary Deletes an associated tenant for a billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsDelete.json + */ +async function associatedTenantsDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const associatedTenantName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.associatedTenants.beginDeleteAndWait( + billingAccountName, + associatedTenantName, + ); + console.log(result); +} + +async function main() { + associatedTenantsDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsGetSample.js new file mode 100644 index 000000000000..e5e576c81a5e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets an associated tenant by ID. + * + * @summary Gets an associated tenant by ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsGet.json + */ +async function associatedTenantsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const associatedTenantName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.associatedTenants.get(billingAccountName, associatedTenantName); + console.log(result); +} + +async function main() { + associatedTenantsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsListByBillingAccountSample.js new file mode 100644 index 000000000000..768db3db88a1 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/associatedTenantsListByBillingAccountSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the associated tenants that can collaborate with the billing account on commerce activities like viewing and downloading invoices, managing payments, making purchases, and managing or provisioning licenses. + * + * @summary Lists the associated tenants that can collaborate with the billing account on commerce activities like viewing and downloading invoices, managing payments, making purchases, and managing or provisioning licenses. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsListByBillingAccount.json + */ +async function associatedTenantsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.associatedTenants.listByBillingAccount(billingAccountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + associatedTenantsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingAccountSample.js new file mode 100644 index 000000000000..c278ee4a9737 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingAccountSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to The Available Credit or Payment on Account Balance for a billing account. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Online Services Program. + * + * @summary The Available Credit or Payment on Account Balance for a billing account. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Online Services Program. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingAccount.json + */ +async function availableBalanceGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.availableBalances.getByBillingAccount(billingAccountName); + console.log(result); +} + +async function main() { + availableBalanceGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingProfileSample.js new file mode 100644 index 000000000000..2a7ab0b70c82 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/availableBalancesGetByBillingProfileSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingProfile.json + */ +async function availableBalanceGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.availableBalances.getByBillingProfile( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + availableBalanceGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsAddPaymentTermsSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsAddPaymentTermsSample.js new file mode 100644 index 000000000000..26b26f1c17b2 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsAddPaymentTermsSample.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action. + * + * @summary Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsAdd.json + */ +async function paymentTermsAdd() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters = [ + { + endDate: new Date("2023-01-25T22:39:34.2606750Z"), + startDate: new Date("2023-01-05T22:39:34.2606750Z"), + term: "net10", + }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginAddPaymentTermsAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + paymentTermsAdd(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsCancelPaymentTermsSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsCancelPaymentTermsSample.js new file mode 100644 index 000000000000..088c40e6922e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsCancelPaymentTermsSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Cancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action. + * + * @summary Cancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsCancel.json + */ +async function paymentTermsCancel() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters = new Date("2023-01-05T22:39:34.2606750Z"); + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginCancelPaymentTermsAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + paymentTermsCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsConfirmTransitionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsConfirmTransitionSample.js new file mode 100644 index 000000000000..2091c93a3601 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsConfirmTransitionSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. + * + * @summary Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsConfirmTransition.json + */ +async function billingAccountsConfirmTransition() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.confirmTransition(billingAccountName); + console.log(result); +} + +async function main() { + billingAccountsConfirmTransition(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsGetSample.js new file mode 100644 index 000000000000..dfca14018caa --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsGetSample.js @@ -0,0 +1,112 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithExpandForPONumber.json + */ +async function billingAccountWithExpandForPoNumber() { + const billingAccountName = "8608480"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithRegistrationNumberWithDefaultType.json + */ +async function billingAccountWithRegistrationNumberWithDefaultType() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithRegistrationNumberWithType.json + */ +async function billingAccountWithRegistrationNumberWithType() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGet.json + */ +async function billingAccountsGet() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGetEA.json + */ +async function billingAccountsGetEa() { + const billingAccountName = "6575495"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGetWithExpand.json + */ +async function billingAccountsGetWithExpand() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +async function main() { + billingAccountWithExpandForPoNumber(); + billingAccountWithRegistrationNumberWithDefaultType(); + billingAccountWithRegistrationNumberWithType(); + billingAccountsGet(); + billingAccountsGetEa(); + billingAccountsGetWithExpand(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js similarity index 69% rename from sdk/billing/arm-billing/samples/v4/javascript/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js index d12d2232b204..47dec2e15bc4 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.js @@ -10,25 +10,30 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListWithCreateSubPermission.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsWithCreateSubscriptionPermissionList.json */ -async function invoiceSectionsListWithCreateSubPermission() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function invoiceSectionsWithCreateSubscriptionPermissionList() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingAccounts.listInvoiceSectionsByCreateSubscriptionPermission( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionsListWithCreateSubPermission().catch(console.error); +async function main() { + invoiceSectionsWithCreateSubscriptionPermissionList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsListSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsListSample.js similarity index 59% rename from sdk/billing/arm-billing/samples/v4/javascript/billingAccountsListSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingAccountsListSample.js index d4edb04386fa..5080fc7ea618 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingAccountsListSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsListSample.js @@ -10,17 +10,17 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the billing accounts that a user has access to. * * @summary Lists the billing accounts that a user has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountForLegacyAccountDetails.json */ -async function billingAccountsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; +async function billingAccountForLegacyAccountDetails() { const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingAccounts.list()) { resArray.push(item); @@ -28,41 +28,33 @@ async function billingAccountsList() { console.log(resArray); } -billingAccountsList().catch(console.error); - /** * This sample demonstrates how to Lists the billing accounts that a user has access to. * * @summary Lists the billing accounts that a user has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpand.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsList.json */ -async function billingAccountsListWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "soldTo,billingProfiles,billingProfiles/invoiceSections"; - const options = { expand }; +async function billingAccountsList() { const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingAccounts.list(options)) { + for await (let item of client.billingAccounts.list()) { resArray.push(item); } console.log(resArray); } -billingAccountsListWithExpand().catch(console.error); - /** * This sample demonstrates how to Lists the billing accounts that a user has access to. * * @summary Lists the billing accounts that a user has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpandForEnrollmentDetails.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsListWithExpandForPONumber.json */ -async function billingAccountsListWithExpandForEnrollmentDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "enrollmentDetails,departments,enrollmentAccounts"; +async function billingAccountsListWithExpandForPoNumber() { + const expand = "soldTo,enrollmentDetails/poNumber"; const options = { expand }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingAccounts.list(options)) { resArray.push(item); @@ -70,4 +62,10 @@ async function billingAccountsListWithExpandForEnrollmentDetails() { console.log(resArray); } -billingAccountsListWithExpandForEnrollmentDetails().catch(console.error); +async function main() { + billingAccountForLegacyAccountDetails(); + billingAccountsList(); + billingAccountsListWithExpandForPoNumber(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsUpdateSample.js new file mode 100644 index 000000000000..dbae69e3c9aa --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsUpdateSample.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * + * @summary Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountUpdateWithPONumber.json + */ +async function billingAccountUpdateWithPoNumber() { + const billingAccountName = "6575495"; + const parameters = { + properties: { enrollmentDetails: { poNumber: "poNumber123" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginUpdateAndWait(billingAccountName, parameters); + console.log(result); +} + +/** + * This sample demonstrates how to Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * + * @summary Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsUpdate.json + */ +async function billingAccountsUpdate() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters = { + properties: { + displayName: "Test Account", + soldTo: { + addressLine1: "1 Microsoft Way", + city: "Redmond", + companyName: "Contoso", + country: "US", + postalCode: "98052-8300", + region: "WA", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginUpdateAndWait(billingAccountName, parameters); + console.log(result); +} + +async function main() { + billingAccountUpdateWithPoNumber(); + billingAccountsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsValidatePaymentTermsSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsValidatePaymentTermsSample.js new file mode 100644 index 000000000000..b0e66f823887 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingAccountsValidatePaymentTermsSample.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * + * @summary Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermInvalid.json + */ +async function paymentTermInvalid() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters = [ + { + endDate: new Date("2023-01-25T22:39:34.2606750Z"), + startDate: new Date("2023-02-05T22:39:34.2606750Z"), + term: "net10", + }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.validatePaymentTerms(billingAccountName, parameters); + console.log(result); +} + +/** + * This sample demonstrates how to Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * + * @summary Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermValid.json + */ +async function paymentTermValid() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters = [ + { + endDate: new Date("2023-01-25T22:39:34.2606750Z"), + startDate: new Date("2023-01-05T22:39:34.2606750Z"), + term: "net10", + }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.validatePaymentTerms(billingAccountName, parameters); + console.log(result); +} + +async function main() { + paymentTermInvalid(); + paymentTermValid(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingAccountSample.js new file mode 100644 index 000000000000..828b8ab1ee22 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingAccountSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a billing account. + * + * @summary Provides a list of check access response objects for a billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingAccount.json + */ +async function checkAccessByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByBillingAccount( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingProfileSample.js new file mode 100644 index 000000000000..4a3f57586b37 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByBillingProfileSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a billing profile. + * + * @summary Provides a list of check access response objects for a billing profile. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingProfile.json + */ +async function checkAccessByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const parameters = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByBillingProfile( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByCustomerSample.js new file mode 100644 index 000000000000..0a27c9ab9d44 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByCustomerSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a customer. + * + * @summary Provides a list of check access response objects for a customer. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByCustomer.json + */ +async function checkAccessByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const parameters = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByCustomer( + billingAccountName, + billingProfileName, + customerName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByDepartmentSample.js new file mode 100644 index 000000000000..8c41edabbcd7 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByDepartmentSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a department. + * + * @summary Provides a list of check access response objects for a department. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByDepartment.json + */ +async function checkAccessByDepartment() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const departmentName = "12345"; + const parameters = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByDepartment( + billingAccountName, + departmentName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByEnrollmentAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByEnrollmentAccountSample.js new file mode 100644 index 000000000000..18a8bdf71acd --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByEnrollmentAccountSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for an enrollment account. + * + * @summary Provides a list of check access response objects for an enrollment account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByEnrollmentAccount.json + */ +async function checkAccessByEnrollmentAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const enrollmentAccountName = "123456"; + const parameters = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByInvoiceSectionSample.js new file mode 100644 index 000000000000..793c4a6176ee --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsCheckAccessByInvoiceSectionSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for an invoice section. + * + * @summary Provides a list of check access response objects for an invoice section. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByInvoiceSection.json + */ +async function checkAccessByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "Q7GV-UUVA-PJA-TGB"; + const parameters = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByBillingAccountSample.js similarity index 67% rename from sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByBillingAccountSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByBillingAccountSample.js index 4923cc05874c..442669091ae7 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByBillingAccountSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByBillingAccountSample.js @@ -10,18 +10,19 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the billing permissions the caller has on a billing account. * * @summary Lists the billing permissions the caller has on a billing account. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountPermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingAccount.json */ -async function billingAccountPermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingPermissionsListByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingPermissions.listByBillingAccount(billingAccountName)) { resArray.push(item); @@ -29,4 +30,8 @@ async function billingAccountPermissionsList() { console.log(resArray); } -billingAccountPermissionsList().catch(console.error); +async function main() { + billingPermissionsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByBillingProfileSample.js similarity index 64% rename from sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByBillingProfileSample.js index f6801f16df9f..dccfe14ad4cc 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByBillingProfileSample.js @@ -10,27 +10,32 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the billing permissions the caller has on a billing profile. * * @summary Lists the billing permissions the caller has on a billing profile. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilePermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingProfile.json */ -async function billingProfilePermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingPermissionsListByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingPermissions.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingProfilePermissionsList().catch(console.error); +async function main() { + billingPermissionsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByCustomerAtBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByCustomerAtBillingAccountSample.js new file mode 100644 index 000000000000..60f1f02f0080 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByCustomerAtBillingAccountSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the billing permissions the caller has for a customer at billing account level. + * + * @summary Lists the billing permissions the caller has for a customer at billing account level. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomerAtBillingAccount.json + */ +async function billingPermissionsListByCustomerAtBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingPermissions.listByCustomerAtBillingAccount( + billingAccountName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingPermissionsListByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByCustomerSample.js similarity index 61% rename from sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByCustomerSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByCustomerSample.js index 0701ce147728..01cf34ea08bb 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByCustomerSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByCustomerSample.js @@ -10,27 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the billing permissions the caller has for a customer. * * @summary Lists the billing permissions the caller has for a customer. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomer.json */ -async function billingProfilePermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; +async function billingPermissionsListByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingPermissions.listByCustomer( billingAccountName, - customerName + billingProfileName, + customerName, )) { resArray.push(item); } console.log(resArray); } -billingProfilePermissionsList().catch(console.error); +async function main() { + billingPermissionsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByDepartmentSample.js new file mode 100644 index 000000000000..33c3563b0f5d --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByDepartmentSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the billing permissions the caller has for a department. + * + * @summary Lists the billing permissions the caller has for a department. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByDepartment.json + */ +async function billingPermissionsListByDepartment() { + const billingAccountName = "6100092"; + const departmentName = "123456"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingPermissions.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingPermissionsListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByEnrollmentAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByEnrollmentAccountSample.js new file mode 100644 index 000000000000..19d700ef0242 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByEnrollmentAccountSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the billing permissions the caller has for an enrollment account. + * + * @summary Lists the billing permissions the caller has for an enrollment account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByEnrollmentAccount.json + */ +async function billingPermissionsListByEnrollmentAccount() { + const billingAccountName = "6100092"; + const enrollmentAccountName = "123456"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingPermissions.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingPermissionsListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByInvoiceSectionsSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByInvoiceSectionSample.js similarity index 54% rename from sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByInvoiceSectionsSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByInvoiceSectionSample.js index 6ebf8793fd04..4490cc549ee8 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingPermissionsListByInvoiceSectionsSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPermissionsListByInvoiceSectionSample.js @@ -10,29 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the billing permissions the caller has on an invoice section. + * This sample demonstrates how to Lists the billing permissions the caller has for an invoice section. * - * @summary Lists the billing permissions the caller has on an invoice section. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json + * @summary Lists the billing permissions the caller has for an invoice section. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByInvoiceSection.json */ -async function invoiceSectionPermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function billingPermissionsListByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "XXXX-XXXX-XXX-XXX"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingPermissions.listByInvoiceSections( + for await (let item of client.billingPermissions.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionPermissionsList().catch(console.error); +async function main() { + billingPermissionsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesCreateOrUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesCreateOrUpdateSample.js new file mode 100644 index 000000000000..154da2afde0f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesCreateOrUpdateSample.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. + * + * @summary Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesCreateOrUpdate.json + */ +async function billingProfilesCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const parameters = { + properties: { + billTo: { + addressLine1: "Test Address1", + addressLine2: "Test Address2", + addressLine3: "Test Address3", + city: "City", + companyName: "Contoso", + country: "US", + email: "abc@contoso.com", + firstName: "Test", + isValidAddress: true, + lastName: "User", + phoneNumber: "000-000-0000", + postalCode: "00000", + region: "WA", + }, + displayName: "Billing Profile 1", + enabledAzurePlans: [{ skuId: "0001" }, { skuId: "0002" }], + invoiceEmailOptIn: true, + poNumber: "ABC12345", + shipTo: { + addressLine1: "Test Address1", + addressLine2: "Test Address2", + addressLine3: "Test Address3", + city: "City", + companyName: "Contoso", + country: "US", + email: "abc@contoso.com", + firstName: "Test", + isValidAddress: true, + lastName: "User", + phoneNumber: "000-000-0000", + postalCode: "00000", + region: "WA", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.beginCreateOrUpdateAndWait( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + billingProfilesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesDeleteSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesDeleteSample.js new file mode 100644 index 000000000000..7cea2406e40a --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesDeleteSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Deletes a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesDelete.json + */ +async function billingProfilesDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.beginDeleteAndWait( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + billingProfilesDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesGetSample.js new file mode 100644 index 000000000000..11f8e4fd6526 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesGet.json + */ +async function billingProfilesGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.get(billingAccountName, billingProfileName); + console.log(result); +} + +async function main() { + billingProfilesGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesListByBillingAccountSample.js new file mode 100644 index 000000000000..138a5eadd67f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesListByBillingAccountSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesListByBillingAccount.json + */ +async function billingProfilesListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingProfiles.listByBillingAccount(billingAccountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingProfilesListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesValidateDeleteEligibilitySample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesValidateDeleteEligibilitySample.js new file mode 100644 index 000000000000..47b212e0973a --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingProfilesValidateDeleteEligibilitySample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilityFailure.json + */ +async function billingProfilesValidateDeleteEligibilityFailure() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.validateDeleteEligibility( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilitySuccess.json + */ +async function billingProfilesValidateDeleteEligibilitySuccess() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.validateDeleteEligibility( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + billingProfilesValidateDeleteEligibilityFailure(); + billingProfilesValidateDeleteEligibilitySuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPropertyGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPropertyGetSample.js new file mode 100644 index 000000000000..23c9fc3bd3b0 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPropertyGetSample.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the billing properties for a subscription + * + * @summary Gets the billing properties for a subscription + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMCA.json + */ +async function billingPropertyGetMca() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.get(); + console.log(result); +} + +/** + * This sample demonstrates how to Gets the billing properties for a subscription + * + * @summary Gets the billing properties for a subscription + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMOSP.json + */ +async function billingPropertyGetMosp() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.get(); + console.log(result); +} + +/** + * This sample demonstrates how to Gets the billing properties for a subscription + * + * @summary Gets the billing properties for a subscription + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMPA.json + */ +async function billingPropertyGetMpa() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.get(); + console.log(result); +} + +async function main() { + billingPropertyGetMca(); + billingPropertyGetMosp(); + billingPropertyGetMpa(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingPropertyUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingPropertyUpdateSample.js new file mode 100644 index 000000000000..33b741fb32c3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingPropertyUpdateSample.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * + * @summary Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchCostCenter.json + */ +async function billingPropertyPatchCostCenter() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; + const parameters = { properties: { costCenter: "1010" } }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.update(parameters); + console.log(result); +} + +/** + * This sample demonstrates how to Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * + * @summary Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchSubscriptionServiceUsageAddress.json + */ +async function billingPropertyPatchSubscriptionServiceUsageAddress() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; + const parameters = { + properties: { + subscriptionServiceUsageAddress: { + addressLine1: "Address line 1", + addressLine2: "Address line 2", + city: "City", + country: "US", + firstName: "Jenny", + lastName: "Doe", + middleName: "Ann", + postalCode: "12345", + region: "State", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.update(parameters); + console.log(result); +} + +async function main() { + billingPropertyPatchCostCenter(); + billingPropertyPatchSubscriptionServiceUsageAddress(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsCreateOrUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsCreateOrUpdateSample.js new file mode 100644 index 000000000000..01577ef6ef81 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsCreateOrUpdateSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create or update a billing request. + * + * @summary Create or update a billing request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsCreateOrUpdate.json + */ +async function billingRequestsCreateOrUpdate() { + const billingRequestName = "00000000-0000-0000-0000-000000000000"; + const parameters = { + properties: { + type: "RoleAssignment", + additionalInformation: { roleId: "40000000-aaaa-bbbb-cccc-200000000006" }, + decisionReason: "New team member", + requestScope: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx", + status: "Pending", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRequests.beginCreateOrUpdateAndWait( + billingRequestName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRequestsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/enrollmentAccountsGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsGetSample.js similarity index 52% rename from sdk/billing/arm-billing/samples/v4/javascript/enrollmentAccountsGetSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRequestsGetSample.js index edb32d030d45..f788f1954509 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/enrollmentAccountsGetSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsGetSample.js @@ -10,20 +10,24 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Gets a enrollment account by name. + * This sample demonstrates how to Gets a billing request by its ID. * - * @summary Gets a enrollment account by name. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json + * @summary Gets a billing request by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsGet.json */ -async function enrollmentAccountsGet() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const name = "e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"; +async function billingRequestsGet() { + const billingRequestName = "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.enrollmentAccounts.get(name); + const client = new BillingManagementClient(credential); + const result = await client.billingRequests.get(billingRequestName); console.log(result); } -enrollmentAccountsGet().catch(console.error); +async function main() { + billingRequestsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingAccountSample.js new file mode 100644 index 000000000000..557842e771d5 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingAccountSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the billing account. + * + * @summary The list of billing requests submitted for the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingAccount.json + */ +async function billingRequestsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByBillingAccount(billingAccountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingProfileSample.js new file mode 100644 index 000000000000..f2ab3a6bb8fe --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByBillingProfileSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the billing profile. + * + * @summary The list of billing requests submitted for the billing profile. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingProfile.json + */ +async function billingRequestsListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByCustomerSample.js new file mode 100644 index 000000000000..565d1da46bca --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByCustomerSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the customer. + * + * @summary The list of billing requests submitted for the customer. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByCustomer.json + */ +async function billingRequestsListByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByInvoiceSectionSample.js new file mode 100644 index 000000000000..ad04aa456bd0 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByInvoiceSectionSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the invoice section. + * + * @summary The list of billing requests submitted for the invoice section. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByInvoiceSection.json + */ +async function billingRequestsListByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByUserSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByUserSample.js new file mode 100644 index 000000000000..3fbbf58aa1a3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRequestsListByUserSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to The list of billing requests submitted by a user. + * + * @summary The list of billing requests submitted by a user. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUser.json + */ +async function billingRequestsListByUser() { + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByUser()) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to The list of billing requests submitted by a user. + * + * @summary The list of billing requests submitted by a user. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUserWithFilter.json + */ +async function billingRequestsListByUserWithFilter() { + const filter = "properties/status eq 'Approved'"; + const options = { filter }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByUser(options)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByUser(); + billingRequestsListByUserWithFilter(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingAccountSample.js new file mode 100644 index 000000000000..36cf10a87a37 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingAccountSample.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingAccount.json + */ +async function billingRoleAssignmentCreateByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const parameters = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginCreateByBillingAccountAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingProfileSample.js new file mode 100644 index 000000000000..872127044767 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByBillingProfileSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingProfile.json + */ +async function billingRoleAssignmentCreateByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const parameters = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginCreateByBillingProfileAndWait( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByCustomerSample.js new file mode 100644 index 000000000000..c300fc87539f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByCustomerSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByCustomer.json + */ +async function billingRoleAssignmentCreateByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const parameters = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfileName/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginCreateByCustomerAndWait( + billingAccountName, + billingProfileName, + customerName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByInvoiceSectionSample.js new file mode 100644 index 000000000000..639937c34a13 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateByInvoiceSectionSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByInvoiceSection.json + */ +async function billingRoleAssignmentCreateByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const parameters = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginCreateByInvoiceSectionAndWait( + billingAccountName, + billingProfileName, + invoiceSectionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.js new file mode 100644 index 000000000000..250e708ac10b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByBillingAccount.json + */ +async function billingRoleAssignmentCreateOrUpdateByBillingAccount() { + const billingAccountName = "7898901"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const parameters = { + properties: { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/7898901/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db", + userEmailAddress: "john@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName, + billingRoleAssignmentName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateOrUpdateByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.js new file mode 100644 index 000000000000..a99a1cbd7278 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByDepartment.json + */ +async function billingRoleAssignmentCreateOrUpdateByDepartment() { + const billingAccountName = "7898901"; + const departmentName = "12345"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const parameters = { + properties: { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/7898901/departments/12345/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db", + userEmailAddress: "john@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginCreateOrUpdateByDepartmentAndWait( + billingAccountName, + departmentName, + billingRoleAssignmentName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateOrUpdateByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.js new file mode 100644 index 000000000000..ead35e8e7cb7 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByEnrollmentAccount.json + */ +async function billingRoleAssignmentCreateOrUpdateByEnrollmentAccount() { + const billingAccountName = "7898901"; + const enrollmentAccountName = "123456"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const parameters = { + properties: { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/123456/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db", + userEmailAddress: "john@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginCreateOrUpdateByEnrollmentAccountAndWait( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateOrUpdateByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js new file mode 100644 index 000000000000..2904e41e3172 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingAccountSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Deletes a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingAccount.json + */ +async function billingRoleAssignmentDeleteByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByBillingAccount( + billingAccountName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js new file mode 100644 index 000000000000..99d13ab47347 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByBillingProfileSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Deletes a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingProfile.json + */ +async function billingRoleAssignmentDeleteByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByBillingProfile( + billingAccountName, + billingProfileName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByCustomerSample.js new file mode 100644 index 000000000000..b85e330ee860 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByCustomerSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByCustomer.json + */ +async function billingRoleAssignmentDeleteByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const billingRoleAssignmentName = + "30000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByCustomer( + billingAccountName, + billingProfileName, + customerName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByDepartmentSample.js new file mode 100644 index 000000000000..f8fc0e7c83ef --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByDepartmentSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Deletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByDepartment.json + */ +async function billingRoleAssignmentDeleteByDepartment() { + const billingAccountName = "8608480"; + const departmentName = "123456"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByDepartment( + billingAccountName, + departmentName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByEnrollmentAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByEnrollmentAccountSample.js new file mode 100644 index 000000000000..0a37f7e9293f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByEnrollmentAccountSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Deletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByEnrollmentAccount.json + */ +async function billingRoleAssignmentDeleteByEnrollmentAccount() { + const billingAccountName = "8608480"; + const enrollmentAccountName = "123456"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js new file mode 100644 index 000000000000..06a601568330 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsDeleteByInvoiceSectionSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Deletes a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByInvoiceSection.json + */ +async function billingRoleAssignmentDeleteByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByBillingAccountSample.js similarity index 53% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByBillingAccountSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByBillingAccountSample.js index 30ea869d8d90..59de39e8a12f 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByBillingAccountSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByBillingAccountSample.js @@ -10,24 +10,30 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json + * @summary Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingAccount.json */ -async function billingAccountRoleAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentId}"; +async function billingRoleAssignmentGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.getByBillingAccount( billingAccountName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -billingAccountRoleAssignment().catch(console.error); +async function main() { + billingRoleAssignmentGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByBillingProfileSample.js similarity index 63% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByBillingProfileSample.js index 2db5ae260c23..1a316733369d 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByBillingProfileSample.js @@ -10,26 +10,32 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignment.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingProfile.json */ -async function billingProfileRoleAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; +async function billingRoleAssignmentGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.getByBillingProfile( billingAccountName, billingProfileName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -billingProfileRoleAssignment().catch(console.error); +async function main() { + billingRoleAssignmentGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByCustomerSample.js new file mode 100644 index 000000000000..091ebdbd5f18 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByCustomerSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByCustomer.json + */ +async function billingRoleAssignmentGetByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const billingRoleAssignmentName = + "30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.getByCustomer( + billingAccountName, + billingProfileName, + customerName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentGetByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByDepartmentSample.js new file mode 100644 index 000000000000..44831963f512 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByDepartmentSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByDepartment.json + */ +async function billingRoleAssignmentGetByDepartment() { + const billingAccountName = "7898901"; + const departmentName = "225314"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.getByDepartment( + billingAccountName, + departmentName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentGetByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByEnrollmentAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByEnrollmentAccountSample.js new file mode 100644 index 000000000000..644fa1477d0e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByEnrollmentAccountSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByEnrollmentAccount.json + */ +async function billingRoleAssignmentGetByEnrollmentAccount() { + const billingAccountName = "7898901"; + const enrollmentAccountName = "225314"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.getByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentGetByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByInvoiceSectionSample.js similarity index 61% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByInvoiceSectionSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByInvoiceSectionSample.js index 5ec3984c4f06..51a935000048 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsGetByInvoiceSectionSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsGetByInvoiceSectionSample.js @@ -10,28 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignment.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByInvoiceSection.json */ -async function invoiceSectionRoleAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; +async function billingRoleAssignmentGetByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.getByInvoiceSection( billingAccountName, billingProfileName, invoiceSectionName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -invoiceSectionRoleAssignment().catch(console.error); +async function main() { + billingRoleAssignmentGetByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByBillingAccountSample.js similarity index 63% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByBillingAccountSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByBillingAccountSample.js index b1dbd6be8d34..4ac11851ab66 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByBillingAccountSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByBillingAccountSample.js @@ -10,18 +10,19 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json + * @summary Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingAccount.json */ -async function billingAccountRoleAssignmentList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingRoleAssignmentListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingRoleAssignments.listByBillingAccount(billingAccountName)) { resArray.push(item); @@ -29,4 +30,8 @@ async function billingAccountRoleAssignmentList() { console.log(resArray); } -billingAccountRoleAssignmentList().catch(console.error); +async function main() { + billingRoleAssignmentListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByBillingProfileSample.js similarity index 58% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByBillingProfileSample.js index d5a33ac7ef16..d36282ba613c 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByBillingProfileSample.js @@ -10,27 +10,32 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @summary Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json + * @summary Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingProfile.json */ -async function billingProfileRoleAssignmentList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingRoleAssignmentListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingRoleAssignments.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingProfileRoleAssignmentList().catch(console.error); +async function main() { + billingRoleAssignmentListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByCustomerSample.js new file mode 100644 index 000000000000..a891694dc87e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByCustomerSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByCustomer.json + */ +async function billingRoleAssignmentListByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleAssignments.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleAssignmentListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByDepartmentSample.js new file mode 100644 index 000000000000..dddf27e3af8d --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByDepartmentSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement. + * + * @summary Lists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByDepartment.json + */ +async function billingRoleAssignmentListByDepartment() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const departmentName = "12345"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleAssignments.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleAssignmentListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByEnrollmentAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByEnrollmentAccountSample.js new file mode 100644 index 000000000000..4150a3c599cd --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByEnrollmentAccountSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement. + * + * @summary Lists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByEnrollmentAccount.json + */ +async function billingRoleAssignmentListByEnrollmentAccount() { + const billingAccountName = "6100092"; + const enrollmentAccountName = "123456"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleAssignments.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleAssignmentListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByInvoiceSectionSample.js similarity index 66% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByInvoiceSectionSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByInvoiceSectionSample.js index 068c5088c0b2..0f8de956785b 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleAssignmentsListByInvoiceSectionSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsListByInvoiceSectionSample.js @@ -10,29 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByInvoiceSection.json */ -async function invoiceSectionRoleAssignmentList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function billingRoleAssignmentListByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingRoleAssignments.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionRoleAssignmentList().catch(console.error); +async function main() { + billingRoleAssignmentListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingAccountSample.js new file mode 100644 index 000000000000..3cea82ea2102 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingAccountSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Lists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingAccount.json + */ +async function resolveBillingRoleAssignmentByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginResolveByBillingAccountAndWait(billingAccountName); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingProfileSample.js new file mode 100644 index 000000000000..407df0def760 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByBillingProfileSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on an billing profile while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Lists the role assignments for the caller on an billing profile while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingProfile.json + */ +async function resolveBillingRoleAssignmentByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginResolveByBillingProfileAndWait( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByCustomerSample.js new file mode 100644 index 000000000000..985cc0c43269 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByCustomerSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByCustomer.json + */ +async function resolveBillingRoleAssignmentByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginResolveByCustomerAndWait( + billingAccountName, + billingProfileName, + customerName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByInvoiceSectionSample.js new file mode 100644 index 000000000000..fc3868907e46 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleAssignmentsResolveByInvoiceSectionSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on an invoice section while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists the role assignments for the caller on an invoice section while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByInvoiceSection.json + */ +async function resolveBillingRoleAssignmentByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.beginResolveByInvoiceSectionAndWait( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByBillingAccountSample.js similarity index 51% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByBillingAccountSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByBillingAccountSample.js index 389a923479be..0f4e0db62adb 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByBillingAccountSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByBillingAccountSample.js @@ -10,24 +10,29 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json + * @summary Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingAccount.json */ -async function billingAccountRoleDefinition() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingRoleDefinitionName = "{billingRoleDefinitionName}"; +async function billingRoleDefinitionGetByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const roleDefinitionName = "50000000-aaaa-bbbb-cccc-100000000000"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleDefinitions.getByBillingAccount( + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByBillingAccount( billingAccountName, - billingRoleDefinitionName + roleDefinitionName, ); console.log(result); } -billingAccountRoleDefinition().catch(console.error); +async function main() { + billingRoleDefinitionGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByBillingProfileSample.js similarity index 60% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByBillingProfileSample.js index 494ab368a831..8261dcb33ee8 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByBillingProfileSample.js @@ -10,26 +10,31 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinition.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingProfile.json */ -async function billingProfileRoleDefinition() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const billingRoleDefinitionName = "{billingRoleDefinitionName}"; +async function billingRoleDefinitionGetByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const roleDefinitionName = "40000000-aaaa-bbbb-cccc-100000000000"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleDefinitions.getByBillingProfile( + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByBillingProfile( billingAccountName, billingProfileName, - billingRoleDefinitionName + roleDefinitionName, ); console.log(result); } -billingProfileRoleDefinition().catch(console.error); +async function main() { + billingRoleDefinitionGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByCustomerSample.js new file mode 100644 index 000000000000..cafd8aa916a4 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByCustomerSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the definition for a role on a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets the definition for a role on a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByCustomer.json + */ +async function billingRoleDefinitionGetByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const roleDefinitionName = "30000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByCustomer( + billingAccountName, + billingProfileName, + customerName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByDepartmentSample.js new file mode 100644 index 000000000000..b768db49d1f0 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByDepartmentSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the definition for a role on a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets the definition for a role on a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByDepartment.json + */ +async function billingRoleDefinitionGetByDepartment() { + const billingAccountName = "123456"; + const departmentName = "7368531"; + const roleDefinitionName = "50000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByDepartment( + billingAccountName, + departmentName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByEnrollmentAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByEnrollmentAccountSample.js new file mode 100644 index 000000000000..9f671ac0ccee --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByEnrollmentAccountSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the definition for a role on an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets the definition for a role on an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByEnrollmentAccount.json + */ +async function billingRoleDefinitionGetByEnrollmentAccount() { + const billingAccountName = "123456"; + const enrollmentAccountName = "4568789"; + const roleDefinitionName = "50000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByInvoiceSectionSample.js similarity index 58% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByInvoiceSectionSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByInvoiceSectionSample.js index e71f04ede1c4..d7ce04fe754c 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsGetByInvoiceSectionSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionGetByInvoiceSectionSample.js @@ -10,28 +10,33 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinition.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByInvoiceSection.json */ -async function invoiceSectionRoleDefinition() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; - const billingRoleDefinitionName = "{billingRoleDefinitionName}"; +async function billingRoleDefinitionGetByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const roleDefinitionName = "30000000-aaaa-bbbb-cccc-100000000000"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleDefinitions.getByInvoiceSection( + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByInvoiceSection( billingAccountName, billingProfileName, invoiceSectionName, - billingRoleDefinitionName + roleDefinitionName, ); console.log(result); } -invoiceSectionRoleDefinition().catch(console.error); +async function main() { + billingRoleDefinitionGetByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByBillingAccountSample.js similarity index 54% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByBillingAccountSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByBillingAccountSample.js index 63ab32a084f7..066a76b36caf 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByBillingAccountSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByBillingAccountSample.js @@ -10,23 +10,30 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json + * @summary Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingAccount.json */ -async function billingAccountRoleDefinitionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingRoleDefinitionListByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingRoleDefinitions.listByBillingAccount(billingAccountName)) { + for await (let item of client.billingRoleDefinitionOperations.listByBillingAccount( + billingAccountName, + )) { resArray.push(item); } console.log(resArray); } -billingAccountRoleDefinitionsList().catch(console.error); +async function main() { + billingRoleDefinitionListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByBillingProfileSample.js similarity index 53% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByBillingProfileSample.js index a05f2a2e3a74..aad8d20e4363 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByBillingProfileSample.js @@ -10,27 +10,32 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json + * @summary Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingProfile.json */ -async function billingProfileRoleDefinitionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingRoleDefinitionListByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingRoleDefinitions.listByBillingProfile( + for await (let item of client.billingRoleDefinitionOperations.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingProfileRoleDefinitionsList().catch(console.error); +async function main() { + billingRoleDefinitionListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByCustomerSample.js new file mode 100644 index 000000000000..512c5319cfea --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByCustomerSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the role definitions for a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the role definitions for a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByCustomer.json + */ +async function billingRoleDefinitionListByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleDefinitionOperations.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleDefinitionListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByDepartmentSample.js new file mode 100644 index 000000000000..466e92b8d77e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByDepartmentSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List the definition for a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary List the definition for a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByDepartment.json + */ +async function billingRoleDefinitionListByDepartment() { + const billingAccountName = "123456"; + const departmentName = "7368531"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleDefinitionOperations.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleDefinitionListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByEnrollmentAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByEnrollmentAccountSample.js new file mode 100644 index 000000000000..dacdfa4b1ddd --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByEnrollmentAccountSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List the definition for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary List the definition for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByEnrollmentAccount.json + */ +async function billingRoleDefinitionListByEnrollmentAccount() { + const billingAccountName = "123456"; + const enrollmentAccountName = "4568789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleDefinitionOperations.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleDefinitionListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByInvoiceSectionSample.js similarity index 62% rename from sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByInvoiceSectionSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByInvoiceSectionSample.js index 317884374294..50faca77b6d1 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingRoleDefinitionsListByInvoiceSectionSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingRoleDefinitionListByInvoiceSectionSample.js @@ -10,29 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinitionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByInvoiceSection.json */ -async function invoiceSectionRoleDefinitionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function billingRoleDefinitionListByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingRoleDefinitions.listByInvoiceSection( + for await (let item of client.billingRoleDefinitionOperations.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionRoleDefinitionsList().catch(console.error); +async function main() { + billingRoleDefinitionListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesCreateOrUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesCreateOrUpdateSample.js new file mode 100644 index 000000000000..1bf259d589f1 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesCreateOrUpdateSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Creates or updates a billing subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * + * @summary Creates or updates a billing subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasCreateOrUpdate.json + */ +async function billingSubscriptionAliasCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const aliasName = "c356b7c7-7545-4686-b843-c1a49cf853fc"; + const parameters = { + billingFrequency: "P1M", + displayName: "Subscription 3", + quantity: 1, + skuId: "0001", + termDuration: "P1M", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptionsAliases.beginCreateOrUpdateAndWait( + billingAccountName, + aliasName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionAliasCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesGetSample.js new file mode 100644 index 000000000000..4d7f9e4739d2 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * + * @summary Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasGet.json + */ +async function billingSubscriptionAliasGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const aliasName = "c356b7c7-7545-4686-b843-c1a49cf853fc"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptionsAliases.get(billingAccountName, aliasName); + console.log(result); +} + +async function main() { + billingSubscriptionAliasGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesListByBillingAccountSample.js new file mode 100644 index 000000000000..29997df6d120 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsAliasesListByBillingAccountSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the subscription aliases for a billing account. The operation is supported for seat based billing subscriptions. + * + * @summary Lists the subscription aliases for a billing account. The operation is supported for seat based billing subscriptions. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasList.json + */ +async function billingSubscriptionAliasList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptionsAliases.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionAliasList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsCancelSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsCancelSample.js new file mode 100644 index 000000000000..1b079b70d6cb --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsCancelSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. + * + * @summary Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsCancel.json + */ +async function billingSubscriptionsCancel() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters = { + cancellationReason: "Compromise", + customerId: "11111111-1111-1111-1111-111111111111", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginCancelAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsDeleteSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsDeleteSample.js new file mode 100644 index 000000000000..ed94d281056b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsDeleteSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsDelete.json + */ +async function billingSubscriptionsDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginDeleteAndWait( + billingAccountName, + billingSubscriptionName, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsGetByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsGetByBillingProfileSample.js new file mode 100644 index 000000000000..eac9ea02e280 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsGetByBillingProfileSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionGetByBillingProfile.json + */ +async function billingSubscriptionGetByBillingProfile() { + const billingAccountName = "pcn.94077792"; + const billingProfileName = "6478903"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.getByBillingProfile( + billingAccountName, + billingProfileName, + billingSubscriptionName, + ); + console.log(result); +} + +async function main() { + billingSubscriptionGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsGetSample.js similarity index 57% rename from sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsGetSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsGetSample.js index 98c7ede95182..37c5da87b4d1 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsGetSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsGetSample.js @@ -10,20 +10,26 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * This sample demonstrates how to Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. * - * @summary Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json + * @summary Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsGet.json */ -async function billingSubscription() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; +async function billingSubscriptionsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.get(billingAccountName); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.get(billingAccountName, billingSubscriptionName); console.log(result); } -billingSubscription().catch(console.error); +async function main() { + billingSubscriptionsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByBillingAccountSample.js similarity index 55% rename from sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByBillingAccountSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByBillingAccountSample.js index 84fbe51b434e..3247360a3a2a 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByBillingAccountSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByBillingAccountSample.js @@ -10,23 +10,37 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * This sample demonstrates how to Lists the subscriptions for a billing account. * - * @summary Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json + * @summary Lists the subscriptions for a billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingAccount.json */ async function billingSubscriptionsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const includeDeleted = false; + const includeTenantSubscriptions = false; + const options = { + includeDeleted, + includeTenantSubscriptions, + }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingSubscriptions.listByBillingAccount(billingAccountName)) { + for await (let item of client.billingSubscriptions.listByBillingAccount( + billingAccountName, + options, + )) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByBillingAccount().catch(console.error); +async function main() { + billingSubscriptionsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByBillingProfileSample.js new file mode 100644 index 000000000000..4887adbb89f9 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByBillingProfileSample.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * + * @summary Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileEA.json + */ +async function billingSubscriptionsListByBillingProfileEa() { + const billingAccountName = "pcn.94077792"; + const billingProfileName = "6478903"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * + * @summary Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileMCA.json + */ +async function billingSubscriptionsListByBillingProfileMca() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionsListByBillingProfileEa(); + billingSubscriptionsListByBillingProfileMca(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByCustomerAtBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByCustomerAtBillingAccountSample.js new file mode 100644 index 000000000000..bd38f3236562 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByCustomerAtBillingAccountSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomerAtBillingAccount.json + */ +async function billingSubscriptionsListByCustomerAtBillingAccount() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const customerName = "Q7GV-UUVA-PJA-TGB"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByCustomerAtBillingAccount( + billingAccountName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionsListByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByCustomerSample.js similarity index 68% rename from sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByCustomerSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByCustomerSample.js index 16ba266590c0..cd1e316efb6f 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByCustomerSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByCustomerSample.js @@ -10,27 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByCustomer.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomer.json */ async function billingSubscriptionsListByCustomer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const customerName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingSubscriptions.listByCustomer( billingAccountName, - customerName + billingProfileName, + customerName, )) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByCustomer().catch(console.error); +async function main() { + billingSubscriptionsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByEnrollmentAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByEnrollmentAccountSample.js new file mode 100644 index 000000000000..169bf98d8ce5 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByEnrollmentAccountSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByEnrollmentAccount.json + */ +async function billingSubscriptionsListByEnrollmentAccount() { + const billingAccountName = "6564892"; + const enrollmentAccountName = "172988"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionsListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByInvoiceSectionSample.js similarity index 70% rename from sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByInvoiceSectionSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByInvoiceSectionSample.js index 52cba5d1126d..39d359dd24e4 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/billingSubscriptionsListByInvoiceSectionSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsListByInvoiceSectionSample.js @@ -10,29 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByInvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByInvoiceSection.json */ async function billingSubscriptionsListByInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const invoiceSectionName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingSubscriptions.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByInvoiceSection().catch(console.error); +async function main() { + billingSubscriptionsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMergeSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMergeSample.js new file mode 100644 index 000000000000..599dee03d0ba --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMergeSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Merges the billing subscription provided in the request with a target billing subscription. + * + * @summary Merges the billing subscription provided in the request with a target billing subscription. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsMerge.json + */ +async function billingSubscriptionsMerge() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters = { + quantity: 1, + targetBillingSubscriptionName: "22222222-2222-2222-2222-222222222222", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginMergeAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsMerge(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMoveSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMoveSample.js new file mode 100644 index 000000000000..85e6ba61e353 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsMoveSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionMove.json + */ +async function billingSubscriptionMove() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters = { + destinationInvoiceSectionId: + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginMoveAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionMove(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsSplitSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsSplitSample.js new file mode 100644 index 000000000000..f55a3223b14e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsSplitSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. + * + * @summary Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsSplit.json + */ +async function billingSubscriptionsSplit() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters = { + billingFrequency: "P1M", + quantity: 1, + targetProductTypeId: "XYZ56789", + targetSkuId: "0001", + termDuration: "P1M", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginSplitAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsSplit(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsUpdateSample.js new file mode 100644 index 000000000000..ca331ca6bc61 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsUpdateSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Updates the properties of a billing subscription. + * + * @summary Updates the properties of a billing subscription. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsUpdate.json + */ +async function billingSubscriptionsUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters = { + consumptionCostCenter: "ABC1234", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginUpdateAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsValidateMoveEligibilitySample.js b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsValidateMoveEligibilitySample.js new file mode 100644 index 000000000000..14db870396be --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/billingSubscriptionsValidateMoveEligibilitySample.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveFailure.json + */ +async function billingSubscriptionValidateMoveFailure() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters = { + destinationInvoiceSectionId: + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.validateMoveEligibility( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveSuccess.json + */ +async function billingSubscriptionValidateMoveSuccess() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters = { + destinationInvoiceSectionId: + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.validateMoveEligibility( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionValidateMoveFailure(); + billingSubscriptionValidateMoveSuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/customersGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/customersGetByBillingAccountSample.js new file mode 100644 index 000000000000..8d082d416731 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/customersGetByBillingAccountSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a customer by its ID at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a customer by its ID at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGetByBillingAccount.json + */ +async function customersGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.customers.getByBillingAccount(billingAccountName, customerName); + console.log(result); +} + +async function main() { + customersGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/customersGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/customersGetSample.js new file mode 100644 index 000000000000..e18566725111 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/customersGetSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGet.json + */ +async function customersGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.customers.get(billingAccountName, billingProfileName, customerName); + console.log(result); +} + +async function main() { + customersGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/customersListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/customersListByBillingAccountSample.js new file mode 100644 index 000000000000..db20c8ff633e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/customersListByBillingAccountSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingAccount.json + */ +async function customersListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.customers.listByBillingAccount(billingAccountName)) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingAccountWithExpand.json + */ +async function customersListByBillingAccountWithExpand() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const expand = "enabledAzurePlans,resellers"; + const options = { expand }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.customers.listByBillingAccount(billingAccountName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + customersListByBillingAccount(); + customersListByBillingAccountWithExpand(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/customersListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/customersListByBillingProfileSample.js similarity index 73% rename from sdk/billing/arm-billing/samples/v4/javascript/customersListByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/customersListByBillingProfileSample.js index 7da2713b5913..9dd994f9ed33 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/customersListByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/customersListByBillingProfileSample.js @@ -10,27 +10,32 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingProfile.json */ async function customersListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.customers.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -customersListByBillingProfile().catch(console.error); +async function main() { + customersListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/departmentsGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/departmentsGetSample.js new file mode 100644 index 000000000000..e17630e030d9 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/departmentsGetSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a department by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a department by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentGet.json + */ +async function departmentGet() { + const billingAccountName = "456598"; + const departmentName = "164821"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.departments.get(billingAccountName, departmentName); + console.log(result); +} + +async function main() { + departmentGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/departmentsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/departmentsListByBillingAccountSample.js new file mode 100644 index 000000000000..ebf977ec6747 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/departmentsListByBillingAccountSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentsListByBillingAccount.json + */ +async function departmentsListByBillingAccount() { + const billingAccountName = "456598"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.departments.listByBillingAccount(billingAccountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + departmentsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetByDepartmentSample.js new file mode 100644 index 000000000000..185c8a0bc245 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetByDepartmentSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets an enrollment account by department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets an enrollment account by department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountByDepartment.json + */ +async function enrollmentAccountByDepartment() { + const billingAccountName = "6564892"; + const departmentName = "164821"; + const enrollmentAccountName = "257698"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.enrollmentAccounts.getByDepartment( + billingAccountName, + departmentName, + enrollmentAccountName, + ); + console.log(result); +} + +async function main() { + enrollmentAccountByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetSample.js new file mode 100644 index 000000000000..6253dfc58336 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsGetSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets an enrollment account by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets an enrollment account by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountGet.json + */ +async function enrollmentAccountGet() { + const billingAccountName = "6564892"; + const enrollmentAccountName = "257698"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.enrollmentAccounts.get(billingAccountName, enrollmentAccountName); + console.log(result); +} + +async function main() { + enrollmentAccountGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByBillingAccountSample.js new file mode 100644 index 000000000000..a217dfffd939 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByBillingAccountSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the enrollment accounts for a billing account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the enrollment accounts for a billing account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByBillingAccount.json + */ +async function enrollmentAccountsListByBillingAccount() { + const billingAccountName = "6564892"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.enrollmentAccounts.listByBillingAccount(billingAccountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + enrollmentAccountsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByDepartmentSample.js b/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByDepartmentSample.js new file mode 100644 index 000000000000..191d55e2ad0b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/enrollmentAccountsListByDepartmentSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the enrollment accounts for a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the enrollment accounts for a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByDepartment.json + */ +async function enrollmentAccountsListByDepartment() { + const billingAccountName = "6564892"; + const departmentName = "164821"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.enrollmentAccounts.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + enrollmentAccountsListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsCreateOrUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsCreateOrUpdateSample.js similarity index 62% rename from sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsCreateOrUpdateSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsCreateOrUpdateSample.js index ac743f027a69..935cd9ae5204 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsCreateOrUpdateSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsCreateOrUpdateSample.js @@ -10,31 +10,38 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsCreateOrUpdate.json */ -async function putInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function invoiceSectionsCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "invoice-section-1"; const parameters = { - displayName: "invoiceSection1", - labels: { costCategory: "Support", pcCode: "A123456" }, + properties: { + displayName: "Invoice Section 1", + tags: { costCategory: "Support", pcCode: "A123456" }, + }, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.invoiceSections.beginCreateOrUpdateAndWait( billingAccountName, billingProfileName, invoiceSectionName, - parameters + parameters, ); console.log(result); } -putInvoiceSection().catch(console.error); +async function main() { + invoiceSectionsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsDeleteSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsDeleteSample.js new file mode 100644 index 000000000000..c72e9a62e32d --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsDeleteSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Deletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Deletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsDelete.json + */ +async function invoiceSectionsDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoiceSections.beginDeleteAndWait( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +async function main() { + invoiceSectionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsGetSample.js similarity index 66% rename from sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsGetSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsGetSample.js index 8038bee27bc9..99dce5b91e8d 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsGetSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsGetSample.js @@ -10,26 +10,31 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsGet.json */ -async function invoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function invoiceSectionsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.invoiceSections.get( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, ); console.log(result); } -invoiceSection().catch(console.error); +async function main() { + invoiceSectionsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsListByBillingProfileSample.js similarity index 69% rename from sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsListByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsListByBillingProfileSample.js index 31e2f58bf46d..8469bd948a6f 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoiceSectionsListByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsListByBillingProfileSample.js @@ -10,27 +10,37 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsListByBillingProfile.json */ async function invoiceSectionsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const includeDeleted = true; + const options = { + includeDeleted, + }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.invoiceSections.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, + options, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionsListByBillingProfile().catch(console.error); +async function main() { + invoiceSectionsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsValidateDeleteEligibilitySample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsValidateDeleteEligibilitySample.js new file mode 100644 index 000000000000..01d20245bae7 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoiceSectionsValidateDeleteEligibilitySample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilityFailure.json + */ +async function invoiceSectionsValidateDeleteEligibilityFailure() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoiceSections.validateDeleteEligibility( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilitySuccess.json + */ +async function invoiceSectionsValidateDeleteEligibilitySuccess() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoiceSections.validateDeleteEligibility( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +async function main() { + invoiceSectionsValidateDeleteEligibilityFailure(); + invoiceSectionsValidateDeleteEligibilitySuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoicesAmendSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesAmendSample.js new file mode 100644 index 000000000000..68e30e84dcfd --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesAmendSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesAmend.json + */ +async function invoicesAmend() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.beginAmendAndWait(billingAccountName, invoiceName); + console.log(result); +} + +async function main() { + invoicesAmend(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingAccountSample.js new file mode 100644 index 000000000000..23bb8bf06f43 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingAccountSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingAccount.json + */ +async function invoicesDownloadByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const documentName = "12345678"; + const options = { + documentName, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.beginDownloadByBillingAccountAndWait( + billingAccountName, + invoiceName, + options, + ); + console.log(result); +} + +async function main() { + invoicesDownloadByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingSubscriptionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingSubscriptionSample.js new file mode 100644 index 000000000000..b2b21082f487 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadByBillingSubscriptionSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingSubscription.json + */ +async function invoicesDownloadByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const invoiceName = "E123456789"; + const documentName = "12345678"; + const options = { + documentName, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.invoices.beginDownloadByBillingSubscriptionAndWait( + invoiceName, + options, + ); + console.log(result); +} + +async function main() { + invoicesDownloadByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadDocumentsByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadDocumentsByBillingAccountSample.js new file mode 100644 index 000000000000..d03ef28638c4 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadDocumentsByBillingAccountSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingAccount.json + */ +async function invoicesDownloadDocumentsByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters = [ + { documentName: "12345678", invoiceName: "G123456789" }, + { documentName: "12345678", invoiceName: "G987654321" }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.beginDownloadDocumentsByBillingAccountAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + invoicesDownloadDocumentsByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadMultipleBillingProfileInvoicesSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadDocumentsByBillingSubscriptionSample.js similarity index 52% rename from sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadMultipleBillingProfileInvoicesSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadDocumentsByBillingSubscriptionSample.js index 34a218e37813..e156b104b39a 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesDownloadMultipleBillingProfileInvoicesSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadDocumentsByBillingSubscriptionSample.js @@ -10,28 +10,30 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingSubscription.json */ -async function billingProfileInvoiceDownload() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const downloadUrls = [ - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", +async function invoicesDownloadDocumentsByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const parameters = [ + { documentName: "12345678", invoiceName: "E123456789" }, + { documentName: "12345678", invoiceName: "E987654321" }, ]; const credential = new DefaultAzureCredential(); const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.beginDownloadMultipleBillingProfileInvoicesAndWait( - billingAccountName, - downloadUrls - ); + const result = + await client.invoices.beginDownloadDocumentsByBillingSubscriptionAndWait(parameters); console.log(result); } -billingProfileInvoiceDownload().catch(console.error); +async function main() { + invoicesDownloadDocumentsByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadSummaryByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadSummaryByBillingAccountSample.js new file mode 100644 index 000000000000..21d8ba79d156 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesDownloadSummaryByBillingAccountSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadSummaryByBillingAccount.json + */ +async function invoicesDownloadSummaryByBillingAccount() { + const billingAccountName = "123456789"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.beginDownloadSummaryByBillingAccountAndWait( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + invoicesDownloadSummaryByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingAccountSample.js new file mode 100644 index 000000000000..08a6caad38e4 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingAccountSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for all billing account types. + * + * @summary Gets an invoice by billing account name and ID. The operation is supported for all billing account types. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingAccount.json + */ +async function invoicesGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.getByBillingAccount(billingAccountName, invoiceName); + console.log(result); +} + +async function main() { + invoicesGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingSubscriptionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingSubscriptionSample.js new file mode 100644 index 000000000000..029f1d00bcde --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetByBillingSubscriptionSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingSubscription.json + */ +async function invoicesGetByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; + const invoiceName = "E123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.invoices.getByBillingSubscription(invoiceName); + console.log(result); +} + +async function main() { + invoicesGetByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetByIdSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetSample.js similarity index 72% rename from sdk/billing/arm-billing/samples/v4/javascript/invoicesGetByIdSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/invoicesGetSample.js index 5c2337968b01..ddaf2ab493f1 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetByIdSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesGetSample.js @@ -10,20 +10,24 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceById.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGet.json */ -async function invoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const invoiceName = "{invoiceName}"; +async function invoicesGet() { + const invoiceName = "G123456789"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.getById(invoiceName); + const client = new BillingManagementClient(credential); + const result = await client.invoices.get(invoiceName); console.log(result); } -invoice().catch(console.error); +async function main() { + invoicesGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingAccountSample.js new file mode 100644 index 000000000000..a386d06f2659 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingAccountSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the invoices for a billing account for a given start date and end date. The operation is supported for all billing account types. + * + * @summary Lists the invoices for a billing account for a given start date and end date. The operation is supported for all billing account types. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingAccount.json + */ +async function invoicesListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const periodStartDate = new Date("2023-01-01"); + const periodEndDate = new Date("2023-06-30"); + const options = { + periodStartDate, + periodEndDate, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.invoices.listByBillingAccount(billingAccountName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + invoicesListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingProfileSample.js new file mode 100644 index 000000000000..0a96884ac647 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingProfileSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingProfile.json + */ +async function invoicesListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const periodStartDate = new Date("2023-01-01"); + const periodEndDate = new Date("2023-06-30"); + const options = { + periodStartDate, + periodEndDate, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.invoices.listByBillingProfile( + billingAccountName, + billingProfileName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + invoicesListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingSubscriptionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingSubscriptionSample.js similarity index 50% rename from sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingSubscriptionSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingSubscriptionSample.js index e1c695d51500..f6733c345472 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesListByBillingSubscriptionSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/invoicesListByBillingSubscriptionSample.js @@ -10,27 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the invoices for a subscription. + * This sample demonstrates how to Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @summary Lists the invoices for a subscription. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json + * @summary Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingSubscription.json */ -async function billingSubscriptionsListByBillingAccount() { - const subscriptionId = "{subscriptionId}"; - const periodStartDate = "2018-01-01"; - const periodEndDate = "2018-06-30"; +async function invoicesListByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "11111111-1111-1111-1111-111111111111"; + const periodStartDate = new Date("2023-01-01"); + const periodEndDate = new Date("2023-06-30"); + const options = { + periodStartDate, + periodEndDate, + }; const credential = new DefaultAzureCredential(); const client = new BillingManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.invoices.listByBillingSubscription( - periodStartDate, - periodEndDate - )) { + for await (let item of client.invoices.listByBillingSubscription(options)) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByBillingAccount().catch(console.error); +async function main() { + invoicesListByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/enrollmentAccountsListSample.js b/sdk/billing/arm-billing/samples/v5/javascript/operationsListSample.js similarity index 59% rename from sdk/billing/arm-billing/samples/v4/javascript/enrollmentAccountsListSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/operationsListSample.js index f08b0be02302..278edd0f0f52 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/enrollmentAccountsListSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/operationsListSample.js @@ -10,22 +10,28 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the enrollment accounts the caller has access to. + * This sample demonstrates how to List of operations supported by provider. * - * @summary Lists the enrollment accounts the caller has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json + * @summary List of operations supported by provider. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/operationsList.json */ -async function enrollmentAccountsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; +async function operationsList() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new BillingManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.enrollmentAccounts.list()) { + for await (let item of client.operations.list()) { resArray.push(item); } console.log(resArray); } -enrollmentAccountsList().catch(console.error); +async function main() { + operationsList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/package.json b/sdk/billing/arm-billing/samples/v5/javascript/package.json similarity index 100% rename from sdk/billing/arm-billing/samples/v4/javascript/package.json rename to sdk/billing/arm-billing/samples/v5/javascript/package.json diff --git a/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersCancelSample.js b/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersCancelSample.js new file mode 100644 index 000000000000..61f2f258dacf --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersCancelSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersCancel.json + */ +async function partnerTransferCancel() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.partnerTransfers.cancel( + billingAccountName, + billingProfileName, + customerName, + transferName, + ); + console.log(result); +} + +async function main() { + partnerTransferCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersGetSample.js new file mode 100644 index 000000000000..a7cd81d7111a --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersGetSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersGet.json + */ +async function partnerTransferGet() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.partnerTransfers.get( + billingAccountName, + billingProfileName, + customerName, + transferName, + ); + console.log(result); +} + +async function main() { + partnerTransferGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersInitiateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersInitiateSample.js new file mode 100644 index 000000000000..e94c7918ed63 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersInitiateSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Sends a request to a user in a customer's billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Sends a request to a user in a customer's billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersInitiate.json + */ +async function initiatePartnerTransfer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const transferName = "aabb123"; + const parameters = { + recipientEmailId: "user@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.partnerTransfers.initiate( + billingAccountName, + billingProfileName, + customerName, + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + initiatePartnerTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersListSample.js b/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersListSample.js new file mode 100644 index 000000000000..9ae5bee0c2bc --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/partnerTransfersListSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the transfer requests sent to a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the transfer requests sent to a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersList.json + */ +async function partnerTransfersList() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.partnerTransfers.list( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + partnerTransfersList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetBySubscriptionAndInvoiceIdSample.js b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsDeleteByUserSample.js similarity index 50% rename from sdk/billing/arm-billing/samples/v4/javascript/invoicesGetBySubscriptionAndInvoiceIdSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsDeleteByUserSample.js index dc8e685cf073..f75704d444f9 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/invoicesGetBySubscriptionAndInvoiceIdSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsDeleteByUserSample.js @@ -10,20 +10,24 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Gets an invoice by subscription ID and invoice ID. + * This sample demonstrates how to Deletes a payment method owned by the caller. * - * @summary Gets an invoice by subscription ID and invoice ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json + * @summary Deletes a payment method owned by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsDeleteByUser.json */ -async function billingSubscriptionsListByBillingAccount() { - const subscriptionId = "{subscriptionId}"; - const invoiceName = "{invoiceName}"; +async function deletePaymentMethodOwnedByUser() { + const paymentMethodName = "ABCDABCDABC0"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.getBySubscriptionAndInvoiceId(invoiceName); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.deleteByUser(paymentMethodName); console.log(result); } -billingSubscriptionsListByBillingAccount().catch(console.error); +async function main() { + deletePaymentMethodOwnedByUser(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingAccountSample.js new file mode 100644 index 000000000000..b26b62bd212f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingAccountSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingAccount.json + */ +async function paymentMethodGetAtBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const paymentMethodName = "21dd9edc-af71-4d62-80ce-37151d475326"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.getByBillingAccount( + billingAccountName, + paymentMethodName, + ); + console.log(result); +} + +async function main() { + paymentMethodGetAtBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingProfileSample.js new file mode 100644 index 000000000000..ee6314dfec11 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByBillingProfileSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingProfile.json + */ +async function paymentMethodsGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const billingProfileName = "ABC1-A1CD-AB1-BP1"; + const paymentMethodName = "ABCDABCDABC0"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.getByBillingProfile( + billingAccountName, + billingProfileName, + paymentMethodName, + ); + console.log(result); +} + +async function main() { + paymentMethodsGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByUserSample.js b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByUserSample.js new file mode 100644 index 000000000000..95b07fcbd836 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsGetByUserSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a payment method owned by the caller. + * + * @summary Gets a payment method owned by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByUser.json + */ +async function getPaymentMethodOwnedByUser() { + const paymentMethodName = "ABCDABCDABC0"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.getByUser(paymentMethodName); + console.log(result); +} + +async function main() { + getPaymentMethodOwnedByUser(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingAccountSample.js new file mode 100644 index 000000000000..043c49a55464 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingAccountSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the payment methods available for a billing account. Along with the payment methods owned by the caller, these payment methods can be attached to a billing profile to make payments. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists the payment methods available for a billing account. Along with the payment methods owned by the caller, these payment methods can be attached to a billing profile to make payments. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingAccount.json + */ +async function paymentMethodsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.paymentMethods.listByBillingAccount(billingAccountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + paymentMethodsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingProfileSample.js new file mode 100644 index 000000000000..654301ed89fe --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByBillingProfileSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists payment methods attached to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists payment methods attached to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingProfile.json + */ +async function paymentMethodsListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const billingProfileName = "ABC1-A1CD-AB1-BP1"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.paymentMethods.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + paymentMethodsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByUserSample.js b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByUserSample.js new file mode 100644 index 000000000000..8fd1a81b7a57 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/paymentMethodsListByUserSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the payment methods owned by the caller. + * + * @summary Lists the payment methods owned by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByUser.json + */ +async function listPaymentMethodOwnedByUser() { + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.paymentMethods.listByUser()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listPaymentMethodOwnedByUser(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByBillingAccountSample.js new file mode 100644 index 000000000000..ef46d9bb0574 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByBillingAccountSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update the policies for a billing account of Enterprise Agreement type. + * + * @summary Update the policies for a billing account of Enterprise Agreement type. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingAccount.json + */ +async function policiesPutByBillingAccount() { + const billingAccountName = "1234567"; + const parameters = { + properties: { + enterpriseAgreementPolicies: { + authenticationType: "OrganizationalAccountOnly", + }, + marketplacePurchases: "AllAllowed", + reservationPurchases: "Allowed", + savingsPlanPurchases: "NotAllowed", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.policies.beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + policiesPutByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/policiesUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByBillingProfileSample.js similarity index 54% rename from sdk/billing/arm-billing/samples/v4/javascript/policiesUpdateSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByBillingProfileSample.js index e0884b7703d7..67fa735737ee 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/policiesUpdateSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByBillingProfileSample.js @@ -10,26 +10,38 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdatePolicy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingProfile.json */ -async function updatePolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function policiesPutByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const parameters = { - marketplacePurchases: "OnlyFreeAllowed", - reservationPurchases: "NotAllowed", - viewCharges: "Allowed", + properties: { + invoiceSectionLabelManagement: "Allowed", + marketplacePurchases: "AllAllowed", + reservationPurchases: "Allowed", + savingsPlanPurchases: "Allowed", + }, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.policies.update(billingAccountName, billingProfileName, parameters); + const client = new BillingManagementClient(credential); + const result = await client.policies.beginCreateOrUpdateByBillingProfileAndWait( + billingAccountName, + billingProfileName, + parameters, + ); console.log(result); } -updatePolicy().catch(console.error); +async function main() { + policiesPutByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByCustomerAtBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByCustomerAtBillingAccountSample.js new file mode 100644 index 000000000000..601ce67ac4e6 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByCustomerAtBillingAccountSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomerAtBillingAccount.json + */ +async function policiesPutByCustomerAtBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const parameters = { properties: { viewCharges: "Allowed" } }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.policies.beginCreateOrUpdateByCustomerAtBillingAccountAndWait( + billingAccountName, + customerName, + parameters, + ); + console.log(result); +} + +async function main() { + policiesPutByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/policiesUpdateCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByCustomerSample.js similarity index 55% rename from sdk/billing/arm-billing/samples/v4/javascript/policiesUpdateCustomerSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByCustomerSample.js index f5999d3116e5..a4f4804d98ef 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/policiesUpdateCustomerSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/policiesCreateOrUpdateByCustomerSample.js @@ -10,22 +10,33 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateCustomerPolicy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomer.json */ -async function updateCustomer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; - const parameters = { viewCharges: "NotAllowed" }; +async function policiesPutByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const parameters = { properties: { viewCharges: "Allowed" } }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.policies.updateCustomer(billingAccountName, customerName, parameters); + const client = new BillingManagementClient(credential); + const result = await client.policies.beginCreateOrUpdateByCustomerAndWait( + billingAccountName, + billingProfileName, + customerName, + parameters, + ); console.log(result); } -updateCustomer().catch(console.error); +async function main() { + policiesPutByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByBillingAccountSample.js new file mode 100644 index 000000000000..467aba199ce3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByBillingAccountSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get the policies for a billing account of Enterprise Agreement type. + * + * @summary Get the policies for a billing account of Enterprise Agreement type. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingAccount.json + */ +async function policiesGetByBillingAccount() { + const billingAccountName = "1234567"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.policies.getByBillingAccount(billingAccountName); + console.log(result); +} + +async function main() { + policiesGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/policiesGetByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByBillingProfileSample.js similarity index 68% rename from sdk/billing/arm-billing/samples/v4/javascript/policiesGetByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/policiesGetByBillingProfileSample.js index bdb563a44547..900e7b194b0e 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/policiesGetByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByBillingProfileSample.js @@ -10,21 +10,26 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Policy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingProfile.json */ -async function policyByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function policiesGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.policies.getByBillingProfile(billingAccountName, billingProfileName); console.log(result); } -policyByBillingProfile().catch(console.error); +async function main() { + policiesGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByCustomerAtBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByCustomerAtBillingAccountSample.js new file mode 100644 index 000000000000..b4ff50bcf4e6 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByCustomerAtBillingAccountSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomerAtBillingAccount.json + */ +async function policiesGetByCustomerAtBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.policies.getByCustomerAtBillingAccount( + billingAccountName, + customerName, + ); + console.log(result); +} + +async function main() { + policiesGetByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/policiesGetByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByCustomerSample.js similarity index 57% rename from sdk/billing/arm-billing/samples/v4/javascript/policiesGetByCustomerSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/policiesGetByCustomerSample.js index a92c4788c59e..e08940d5e2e0 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/policiesGetByCustomerSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetByCustomerSample.js @@ -10,21 +10,33 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPolicy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomer.json */ -async function policyByCustomer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; +async function policiesGetByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const policyName = "default"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.policies.getByCustomer(billingAccountName, customerName); + const client = new BillingManagementClient(credential); + const result = await client.policies.getByCustomer( + billingAccountName, + billingProfileName, + customerName, + policyName, + ); console.log(result); } -policyByCustomer().catch(console.error); +async function main() { + policiesGetByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/policiesGetBySubscriptionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetBySubscriptionSample.js new file mode 100644 index 000000000000..0a456b9edfdb --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/policiesGetBySubscriptionSample.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetBySubscription.json + */ +async function policiesGetBySubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.policies.getBySubscription(); + console.log(result); +} + +async function main() { + policiesGetBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/productsGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/productsGetSample.js similarity index 69% rename from sdk/billing/arm-billing/samples/v4/javascript/productsGetSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/productsGetSample.js index c7876f69d6e5..c161329118ce 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/productsGetSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/productsGetSample.js @@ -10,21 +10,26 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Product.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsGet.json */ -async function product() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; +async function productsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const productName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.products.get(billingAccountName, productName); console.log(result); } -product().catch(console.error); +async function main() { + productsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/productsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/productsListByBillingAccountSample.js similarity index 78% rename from sdk/billing/arm-billing/samples/v4/javascript/productsListByBillingAccountSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/productsListByBillingAccountSample.js index 2657faaf4e09..aa0ed62e1c4c 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/productsListByBillingAccountSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/productsListByBillingAccountSample.js @@ -10,18 +10,19 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. * * @summary Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingAccount.json */ async function productsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByBillingAccount(billingAccountName)) { resArray.push(item); @@ -29,4 +30,8 @@ async function productsListByBillingAccount() { console.log(resArray); } -productsListByBillingAccount().catch(console.error); +async function main() { + productsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/productsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/productsListByBillingProfileSample.js similarity index 74% rename from sdk/billing/arm-billing/samples/v4/javascript/productsListByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/productsListByBillingProfileSample.js index 8ea4cff632a4..e95456057ecd 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/productsListByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/productsListByBillingProfileSample.js @@ -10,27 +10,32 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. * * @summary Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingProfile.json */ async function productsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -productsListByBillingProfile().catch(console.error); +async function main() { + productsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/productsListByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/productsListByCustomerSample.js similarity index 72% rename from sdk/billing/arm-billing/samples/v4/javascript/productsListByCustomerSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/productsListByCustomerSample.js index f7714c6a25e8..b4cb48219d84 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/productsListByCustomerSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/productsListByCustomerSample.js @@ -10,19 +10,20 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByCustomer.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByCustomer.json */ -async function productsListByInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; +async function productsListByCustomer() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const customerName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByCustomer(billingAccountName, customerName)) { resArray.push(item); @@ -30,4 +31,8 @@ async function productsListByInvoiceSection() { console.log(resArray); } -productsListByInvoiceSection().catch(console.error); +async function main() { + productsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/productsListByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/productsListByInvoiceSectionSample.js similarity index 71% rename from sdk/billing/arm-billing/samples/v4/javascript/productsListByInvoiceSectionSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/productsListByInvoiceSectionSample.js index fc06912beaf5..74c9e0b1340c 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/productsListByInvoiceSectionSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/productsListByInvoiceSectionSample.js @@ -10,29 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByInvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByInvoiceSection.json */ async function productsListByInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const invoiceSectionName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -productsListByInvoiceSection().catch(console.error); +async function main() { + productsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/productsMoveSample.js b/sdk/billing/arm-billing/samples/v5/javascript/productsMoveSample.js similarity index 63% rename from sdk/billing/arm-billing/samples/v4/javascript/productsMoveSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/productsMoveSample.js index a758946f2c3c..45ba80b2fd77 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/productsMoveSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/productsMoveSample.js @@ -10,25 +10,34 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveProduct.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productMove.json */ -async function moveProduct() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; +async function productMove() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const productName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; const parameters = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}", + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.products.move(billingAccountName, productName, parameters); + const client = new BillingManagementClient(credential); + const result = await client.products.beginMoveAndWait( + billingAccountName, + productName, + parameters, + ); console.log(result); } -moveProduct().catch(console.error); +async function main() { + productMove(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/productsUpdateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/productsUpdateSample.js similarity index 68% rename from sdk/billing/arm-billing/samples/v4/javascript/productsUpdateSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/productsUpdateSample.js index 1b669261b9f3..42e242584e89 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/productsUpdateSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/productsUpdateSample.js @@ -10,22 +10,27 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateProduct.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsUpdate.json */ -async function updateBillingProperty() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; - const parameters = { autoRenew: "Off" }; +async function productsUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const productName = "11111111-1111-1111-1111-111111111111"; + const parameters = { properties: { autoRenew: "On" } }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.products.update(billingAccountName, productName, parameters); console.log(result); } -updateBillingProperty().catch(console.error); +async function main() { + productsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/productsValidateMoveSample.js b/sdk/billing/arm-billing/samples/v5/javascript/productsValidateMoveEligibilitySample.js similarity index 55% rename from sdk/billing/arm-billing/samples/v4/javascript/productsValidateMoveSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/productsValidateMoveEligibilitySample.js index ec2c46e313a0..41f1e08c23a3 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/productsValidateMoveSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/productsValidateMoveEligibilitySample.js @@ -10,47 +10,59 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveFailure.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveFailure.json */ -async function subscriptionMoveValidateFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; +async function productValidateMoveFailure() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const productName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; const parameters = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}", + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.products.validateMove(billingAccountName, productName, parameters); + const client = new BillingManagementClient(credential); + const result = await client.products.validateMoveEligibility( + billingAccountName, + productName, + parameters, + ); console.log(result); } -subscriptionMoveValidateFailure().catch(console.error); - /** * This sample demonstrates how to Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveSuccess.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveSuccess.json */ -async function subscriptionMoveValidateSuccess() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; +async function productValidateMoveSuccess() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const productName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; const parameters = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}", + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.products.validateMove(billingAccountName, productName, parameters); + const client = new BillingManagementClient(credential); + const result = await client.products.validateMoveEligibility( + billingAccountName, + productName, + parameters, + ); console.log(result); } -subscriptionMoveValidateSuccess().catch(console.error); +async function main() { + productValidateMoveFailure(); + productValidateMoveSuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersAcceptSample.js b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersAcceptSample.js new file mode 100644 index 000000000000..7246715cac7d --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersAcceptSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Accepts a transfer request. + * + * @summary Accepts a transfer request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersAccept.json + */ +async function acceptTransfer() { + const transferName = "aabb123"; + const parameters = { + productDetails: [ + { productId: "subscriptionId", productType: "AzureSubscription" }, + { productId: "reservedInstanceId", productType: "AzureReservation" }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.accept(transferName, parameters); + console.log(result); +} + +async function main() { + acceptTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersDeclineSample.js b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersDeclineSample.js new file mode 100644 index 000000000000..eb920a45f064 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersDeclineSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Declines a transfer request. + * + * @summary Declines a transfer request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersDecline.json + */ +async function declineTransfer() { + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.decline(transferName); + console.log(result); +} + +async function main() { + declineTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersGetSample.js new file mode 100644 index 000000000000..54f598088134 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersGetSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a transfer request by ID. The caller must be the recipient of the transfer request. + * + * @summary Gets a transfer request by ID. The caller must be the recipient of the transfer request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersGet.json + */ +async function recipientTransferGet() { + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.get(transferName); + console.log(result); +} + +async function main() { + recipientTransferGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersListSample.js b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersListSample.js new file mode 100644 index 000000000000..0b50595f9c07 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersListSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the transfer requests received by the caller. + * + * @summary Lists the transfer requests received by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersList.json + */ +async function recipientTransfersList() { + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.recipientTransfers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + recipientTransfersList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersValidateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersValidateSample.js new file mode 100644 index 000000000000..7f67b1dd8766 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/recipientTransfersValidateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Validates if a subscription or a reservation can be transferred. Use this operation to validate your subscriptions or reservation before using the accept transfer operation. + * + * @summary Validates if a subscription or a reservation can be transferred. Use this operation to validate your subscriptions or reservation before using the accept transfer operation. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersValidate.json + */ +async function validateTransfer() { + const transferName = "aabb123"; + const parameters = { + productDetails: [ + { productId: "subscriptionId", productType: "AzureSubscription" }, + { productId: "reservedInstanceId", productType: "AzureReservation" }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.validate(transferName, parameters); + console.log(result); +} + +async function main() { + validateTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersGetByBillingAccountSample.js new file mode 100644 index 000000000000..30a889800dea --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersGetByBillingAccountSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get the details of the ReservationOrder in the billing account. + * + * @summary Get the details of the ReservationOrder in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccount.json + */ +async function reservationOrderGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservationOrders.getByBillingAccount( + billingAccountName, + reservationOrderId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get the details of the ReservationOrder in the billing account. + * + * @summary Get the details of the ReservationOrder in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccountWithExpandPlanInformation.json + */ +async function reservationOrderGetByBillingAccountWithExpandPlanInformation() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservationOrders.getByBillingAccount( + billingAccountName, + reservationOrderId, + ); + console.log(result); +} + +async function main() { + reservationOrderGetByBillingAccount(); + reservationOrderGetByBillingAccountWithExpandPlanInformation(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersListByBillingAccountSample.js new file mode 100644 index 000000000000..94eb4d8f9967 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/reservationOrdersListByBillingAccountSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List all the `ReservationOrders in the billing account. + * + * @summary List all the `ReservationOrders in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrdersListByBillingAccount.json + */ +async function reservationOrderListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.reservationOrders.listByBillingAccount(billingAccountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + reservationOrderListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/reservationsGetByReservationOrderSample.js b/sdk/billing/arm-billing/samples/v5/javascript/reservationsGetByReservationOrderSample.js new file mode 100644 index 000000000000..ebe37c701818 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/reservationsGetByReservationOrderSample.js @@ -0,0 +1,106 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccount.json + */ +async function reservationGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountManagementGroup.json + */ +async function reservationGetByBillingAccountManagementGroup() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountSingleResourceGroup.json + */ +async function reservationGetByBillingAccountSingleResourceGroup() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountSingleScope.json + */ +async function reservationGetByBillingAccountSingleScope() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +async function main() { + reservationGetByBillingAccount(); + reservationGetByBillingAccountManagementGroup(); + reservationGetByBillingAccountSingleResourceGroup(); + reservationGetByBillingAccountSingleScope(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/reservationsListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByBillingAccountSample.js similarity index 54% rename from sdk/billing/arm-billing/samples/v4/javascript/reservationsListByBillingAccountSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/reservationsListByBillingAccountSample.js index b69c0c4c5137..57d11ccbc5bb 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/reservationsListByBillingAccountSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByBillingAccountSample.js @@ -10,26 +10,23 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** - * This sample demonstrates how to Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * This sample demonstrates how to Lists the reservations in the billing account and the roll up counts of reservations group by provisioning states. * - * @summary Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.json + * @summary Lists the reservations in the billing account and the roll up counts of reservations group by provisioning states. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingAccount.json */ async function reservationsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const filter = "properties/reservedResourceType eq 'VirtualMachines'"; - const orderby = "properties/userFriendlyAppliedScopeType asc"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const selectedState = "Succeeded"; const options = { - filter, - orderby, selectedState, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.reservations.listByBillingAccount(billingAccountName, options)) { resArray.push(item); @@ -37,4 +34,8 @@ async function reservationsListByBillingAccount() { console.log(resArray); } -reservationsListByBillingAccount().catch(console.error); +async function main() { + reservationsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/reservationsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByBillingProfileSample.js similarity index 68% rename from sdk/billing/arm-billing/samples/v4/javascript/reservationsListByBillingProfileSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/reservationsListByBillingProfileSample.js index 1267b8c1c5df..b653ecc5ece5 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/reservationsListByBillingProfileSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByBillingProfileSample.js @@ -10,36 +10,37 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @summary Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingProfile.json */ async function reservationsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const filter = "properties/reservedResourceType eq 'VirtualMachines'"; - const orderby = "properties/userFriendlyAppliedScopeType asc"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "AAAA-AAAA-AAA-AAA"; const selectedState = "Succeeded"; const options = { - filter, - orderby, selectedState, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.reservations.listByBillingProfile( billingAccountName, billingProfileName, - options + options, )) { resArray.push(item); } console.log(resArray); } -reservationsListByBillingProfile().catch(console.error); +async function main() { + reservationsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByReservationOrderSample.js b/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByReservationOrderSample.js new file mode 100644 index 000000000000..6e6205a0e39f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/reservationsListByReservationOrderSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List Reservations within a single ReservationOrder in the billing account. + * + * @summary List Reservations within a single ReservationOrder in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsGetFromOrderByBillingAccount.json + */ +async function reservationsGetFromOrderByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.reservations.listByReservationOrder( + billingAccountName, + reservationOrderId, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + reservationsGetFromOrderByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/reservationsUpdateByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/reservationsUpdateByBillingAccountSample.js new file mode 100644 index 000000000000..71f1c7d02d59 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/reservationsUpdateByBillingAccountSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update reservation by billing account. + * + * @summary Update reservation by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationUpdateByBillingAccount.json + */ +async function reservationUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const body = { displayName: "NewName" }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.beginUpdateByBillingAccountAndWait( + billingAccountName, + reservationOrderId, + reservationId, + body, + ); + console.log(result); +} + +async function main() { + reservationUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/sample.env b/sdk/billing/arm-billing/samples/v5/javascript/sample.env similarity index 100% rename from sdk/billing/arm-billing/samples/v4/javascript/sample.env rename to sdk/billing/arm-billing/samples/v5/javascript/sample.env diff --git a/sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersGetByBillingAccountSample.js new file mode 100644 index 000000000000..e0d37968f92c --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersGetByBillingAccountSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get a savings plan order by billing account. + * + * @summary Get a savings plan order by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderGetByBillingAccount.json + */ +async function savingsPlanOrderGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlanOrders.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get a savings plan order by billing account. + * + * @summary Get a savings plan order by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderExpandedScheduleGetByBillingAccount.json + */ +async function savingsPlanOrderWithExpandedPaymentsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlanOrders.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + ); + console.log(result); +} + +async function main() { + savingsPlanOrderGet(); + savingsPlanOrderWithExpandedPaymentsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersListByBillingAccountSample.js new file mode 100644 index 000000000000..1b0c2596be4b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlanOrdersListByBillingAccountSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List all Savings plan orders by billing account. + * + * @summary List all Savings plan orders by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderListByBillingAccount.json + */ +async function savingsPlanOrderList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.savingsPlanOrders.listByBillingAccount(billingAccountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + savingsPlanOrderList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansGetByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansGetByBillingAccountSample.js new file mode 100644 index 000000000000..4abd58fa56ce --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansGetByBillingAccountSample.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Get savings plan by billing account. + * + * @summary Get savings plan by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetByBillingAccount.json + */ +async function savingsPlanGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get savings plan by billing account. + * + * @summary Get savings plan by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetExpandRenewPropertiesByBillingAccount.json + */ +async function savingsPlanGetExpandRenewProperties() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + ); + console.log(result); +} + +async function main() { + savingsPlanGet(); + savingsPlanGetExpandRenewProperties(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListByBillingAccountSample.js new file mode 100644 index 000000000000..4ffc25420478 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListByBillingAccountSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List savings plans by billing account. + * + * @summary List savings plans by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListByBillingAccount.json + */ +async function savingsPlansList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const take = 3; + const selectedState = "Succeeded"; + const refreshSummary = "true"; + const options = { + take, + selectedState, + refreshSummary, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.savingsPlans.listByBillingAccount(billingAccountName, options)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + savingsPlansList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListBySavingsPlanOrderSample.js b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListBySavingsPlanOrderSample.js new file mode 100644 index 000000000000..4ab0c865a5fe --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansListBySavingsPlanOrderSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to List savings plans in an order by billing account. + * + * @summary List savings plans in an order by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListBySavingsPlanOrders.json + */ +async function savingsPlansInOrderList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.savingsPlans.listBySavingsPlanOrder( + billingAccountName, + savingsPlanOrderId, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + savingsPlansInOrderList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansUpdateByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansUpdateByBillingAccountSample.js new file mode 100644 index 000000000000..f43505c329b2 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansUpdateByBillingAccountSample.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Update savings plan by billing account. + * + * @summary Update savings plan by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanUpdateByBillingAccount.json + */ +async function savingsPlanUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const body = { + properties: { + appliedScopeProperties: { + managementGroupId: "/providers/Microsoft.Management/managementGroups/mg1", + tenantId: "80000000-0000-0000-0000-000000000000", + }, + appliedScopeType: "ManagementGroup", + displayName: "sp_newName", + renew: true, + renewProperties: { + purchaseProperties: { + appliedScopeProperties: { + managementGroupId: "/providers/Microsoft.Management/managementGroups/mg1", + tenantId: "80000000-0000-0000-0000-000000000000", + }, + appliedScopeType: "ManagementGroup", + billingPlan: "P1M", + billingScopeId: "/subscriptions/50000000-0000-0000-0000-000000000000", + commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" }, + displayName: "sp_newName_renewed", + sku: { name: "Compute_Savings_Plan" }, + term: "P3Y", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.beginUpdateByBillingAccountAndWait( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + body, + ); + console.log(result); +} + +async function main() { + savingsPlanUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansValidateUpdateByBillingAccountSample.js b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansValidateUpdateByBillingAccountSample.js new file mode 100644 index 000000000000..154e6a751434 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/savingsPlansValidateUpdateByBillingAccountSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Validate savings plan patch by billing account. + * + * @summary Validate savings plan patch by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanValidateUpdateByBillingAccount.json + */ +async function savingsPlanValidateUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const body = { + benefits: [ + { + appliedScopeProperties: { + subscriptionId: "/subscriptions/50000000-0000-0000-0000-000000000000", + }, + appliedScopeType: "Single", + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.validateUpdateByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + body, + ); + console.log(result); +} + +async function main() { + savingsPlanValidateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/transactionsGetTransactionSummaryByInvoiceSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transactionsGetTransactionSummaryByInvoiceSample.js new file mode 100644 index 000000000000..c3c13de53e19 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/transactionsGetTransactionSummaryByInvoiceSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges. + * + * @summary Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionSummaryGetByInvoice.json + */ +async function transactionSummaryGetByInvoice() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transactions.getTransactionSummaryByInvoice( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + transactionSummaryGetByInvoice(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByBillingProfileSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByBillingProfileSample.js new file mode 100644 index 000000000000..1c601b78c136 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByBillingProfileSample.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * + * @summary Lists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByBillingProfile.json + */ +async function transactionsListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const periodStartDate = new Date("2024-04-01"); + const periodEndDate = new Date("2023-05-30"); + const typeParam = "Billed"; + const filter = "properties/date gt '2020-10-01'"; + const search = "storage"; + const options = { + filter, + search, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transactions.listByBillingProfile( + billingAccountName, + billingProfileName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transactionsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByCustomerSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByCustomerSample.js new file mode 100644 index 000000000000..8daab80f9360 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByCustomerSample.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * + * @summary Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByCustomer.json + */ +async function transactionsListByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "22000000-0000-0000-0000-000000000000"; + const periodStartDate = new Date("2024-04-01"); + const periodEndDate = new Date("2023-05-30"); + const typeParam = "Billed"; + const filter = "properties/date gt '2020-10-01'"; + const search = "storage"; + const options = { filter, search }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transactions.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transactionsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/javascript/transactionsListByInvoiceSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByInvoiceSample.js similarity index 72% rename from sdk/billing/arm-billing/samples/v4/javascript/transactionsListByInvoiceSample.js rename to sdk/billing/arm-billing/samples/v5/javascript/transactionsListByInvoiceSample.js index b76307424841..955abbe89525 100644 --- a/sdk/billing/arm-billing/samples/v4/javascript/transactionsListByInvoiceSample.js +++ b/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByInvoiceSample.js @@ -10,19 +10,20 @@ // Licensed under the MIT License. const { BillingManagementClient } = require("@azure/arm-billing"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. * * @summary Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/TransactionsListByInvoice.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoice.json */ async function transactionsListByInvoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.transactions.listByInvoice(billingAccountName, invoiceName)) { resArray.push(item); @@ -30,4 +31,8 @@ async function transactionsListByInvoice() { console.log(resArray); } -transactionsListByInvoice().catch(console.error); +async function main() { + transactionsListByInvoice(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByInvoiceSectionSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByInvoiceSectionSample.js new file mode 100644 index 000000000000..2c9a094c55e7 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/transactionsListByInvoiceSectionSample.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * + * @summary Lists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoiceSection.json + */ +async function transactionsListByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "22000000-0000-0000-0000-000000000000"; + const periodStartDate = new Date("2024-04-01"); + const periodEndDate = new Date("2023-05-30"); + const typeParam = "Billed"; + const filter = "properties/date gt '2020-10-01'"; + const search = "storage"; + const options = { + filter, + search, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transactions.listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transactionsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/transactionsTransactionsDownloadByInvoiceSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transactionsTransactionsDownloadByInvoiceSample.js new file mode 100644 index 000000000000..f60450daf7aa --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/transactionsTransactionsDownloadByInvoiceSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsDownloadByInvoice.json + */ +async function transactionsDownloadByInvoice() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transactions.beginTransactionsDownloadByInvoiceAndWait( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + transactionsDownloadByInvoice(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/transfersCancelSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transfersCancelSample.js new file mode 100644 index 000000000000..8264f68264e8 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/transfersCancelSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersCancel.json + */ +async function transferCancel() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transfers.cancel( + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + ); + console.log(result); +} + +async function main() { + transferCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/transfersGetSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transfersGetSample.js new file mode 100644 index 000000000000..73d151b403e3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/transfersGetSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersGet.json + */ +async function transferGet() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transfers.get( + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + ); + console.log(result); +} + +async function main() { + transferGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/transfersInitiateSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transfersInitiateSample.js new file mode 100644 index 000000000000..a6416401d127 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/transfersInitiateSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Sends a request to a user in another billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Sends a request to a user in another billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersInitiate.json + */ +async function initiateTransfer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const transferName = "aabb123"; + const parameters = { + recipientEmailId: "user@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transfers.initiate( + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + initiateTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/javascript/transfersListSample.js b/sdk/billing/arm-billing/samples/v5/javascript/transfersListSample.js new file mode 100644 index 000000000000..8f86b4762a0c --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/javascript/transfersListSample.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { BillingManagementClient } = require("@azure/arm-billing"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); + +/** + * This sample demonstrates how to Lists the transfer requests for an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists the transfer requests for an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersList.json + */ +async function transfersList() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transfers.list( + billingAccountName, + billingProfileName, + invoiceSectionName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transfersList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/README.md b/sdk/billing/arm-billing/samples/v5/typescript/README.md new file mode 100644 index 000000000000..e2e7b0e71a97 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/README.md @@ -0,0 +1,437 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [addressValidateSample.ts][addressvalidatesample] | Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateInvalid.json | +| [agreementsGetSample.ts][agreementsgetsample] | Gets an agreement by ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementByName.json | +| [agreementsListByBillingAccountSample.ts][agreementslistbybillingaccountsample] | Lists the agreements for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementsListByBillingAccount.json | +| [associatedTenantsCreateOrUpdateSample.ts][associatedtenantscreateorupdatesample] | Create or update an associated tenant for the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsCreateOrUpdate.json | +| [associatedTenantsDeleteSample.ts][associatedtenantsdeletesample] | Deletes an associated tenant for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsDelete.json | +| [associatedTenantsGetSample.ts][associatedtenantsgetsample] | Gets an associated tenant by ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsGet.json | +| [associatedTenantsListByBillingAccountSample.ts][associatedtenantslistbybillingaccountsample] | Lists the associated tenants that can collaborate with the billing account on commerce activities like viewing and downloading invoices, managing payments, making purchases, and managing or provisioning licenses. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsListByBillingAccount.json | +| [availableBalancesGetByBillingAccountSample.ts][availablebalancesgetbybillingaccountsample] | The Available Credit or Payment on Account Balance for a billing account. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Online Services Program. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingAccount.json | +| [availableBalancesGetByBillingProfileSample.ts][availablebalancesgetbybillingprofilesample] | The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingProfile.json | +| [billingAccountsAddPaymentTermsSample.ts][billingaccountsaddpaymenttermssample] | Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsAdd.json | +| [billingAccountsCancelPaymentTermsSample.ts][billingaccountscancelpaymenttermssample] | Cancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsCancel.json | +| [billingAccountsConfirmTransitionSample.ts][billingaccountsconfirmtransitionsample] | Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsConfirmTransition.json | +| [billingAccountsGetSample.ts][billingaccountsgetsample] | Gets a billing account by its ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithExpandForPONumber.json | +| [billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts][billingaccountslistinvoicesectionsbycreatesubscriptionpermissionsample] | Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsWithCreateSubscriptionPermissionList.json | +| [billingAccountsListSample.ts][billingaccountslistsample] | Lists the billing accounts that a user has access to. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountForLegacyAccountDetails.json | +| [billingAccountsUpdateSample.ts][billingaccountsupdatesample] | Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountUpdateWithPONumber.json | +| [billingAccountsValidatePaymentTermsSample.ts][billingaccountsvalidatepaymenttermssample] | Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermInvalid.json | +| [billingPermissionsCheckAccessByBillingAccountSample.ts][billingpermissionscheckaccessbybillingaccountsample] | Provides a list of check access response objects for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingAccount.json | +| [billingPermissionsCheckAccessByBillingProfileSample.ts][billingpermissionscheckaccessbybillingprofilesample] | Provides a list of check access response objects for a billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingProfile.json | +| [billingPermissionsCheckAccessByCustomerSample.ts][billingpermissionscheckaccessbycustomersample] | Provides a list of check access response objects for a customer. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByCustomer.json | +| [billingPermissionsCheckAccessByDepartmentSample.ts][billingpermissionscheckaccessbydepartmentsample] | Provides a list of check access response objects for a department. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByDepartment.json | +| [billingPermissionsCheckAccessByEnrollmentAccountSample.ts][billingpermissionscheckaccessbyenrollmentaccountsample] | Provides a list of check access response objects for an enrollment account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByEnrollmentAccount.json | +| [billingPermissionsCheckAccessByInvoiceSectionSample.ts][billingpermissionscheckaccessbyinvoicesectionsample] | Provides a list of check access response objects for an invoice section. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByInvoiceSection.json | +| [billingPermissionsListByBillingAccountSample.ts][billingpermissionslistbybillingaccountsample] | Lists the billing permissions the caller has on a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingAccount.json | +| [billingPermissionsListByBillingProfileSample.ts][billingpermissionslistbybillingprofilesample] | Lists the billing permissions the caller has on a billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingProfile.json | +| [billingPermissionsListByCustomerAtBillingAccountSample.ts][billingpermissionslistbycustomeratbillingaccountsample] | Lists the billing permissions the caller has for a customer at billing account level. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomerAtBillingAccount.json | +| [billingPermissionsListByCustomerSample.ts][billingpermissionslistbycustomersample] | Lists the billing permissions the caller has for a customer. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomer.json | +| [billingPermissionsListByDepartmentSample.ts][billingpermissionslistbydepartmentsample] | Lists the billing permissions the caller has for a department. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByDepartment.json | +| [billingPermissionsListByEnrollmentAccountSample.ts][billingpermissionslistbyenrollmentaccountsample] | Lists the billing permissions the caller has for an enrollment account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByEnrollmentAccount.json | +| [billingPermissionsListByInvoiceSectionSample.ts][billingpermissionslistbyinvoicesectionsample] | Lists the billing permissions the caller has for an invoice section. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByInvoiceSection.json | +| [billingProfilesCreateOrUpdateSample.ts][billingprofilescreateorupdatesample] | Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesCreateOrUpdate.json | +| [billingProfilesDeleteSample.ts][billingprofilesdeletesample] | Deletes a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesDelete.json | +| [billingProfilesGetSample.ts][billingprofilesgetsample] | Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesGet.json | +| [billingProfilesListByBillingAccountSample.ts][billingprofileslistbybillingaccountsample] | Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesListByBillingAccount.json | +| [billingProfilesValidateDeleteEligibilitySample.ts][billingprofilesvalidatedeleteeligibilitysample] | Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilityFailure.json | +| [billingPropertyGetSample.ts][billingpropertygetsample] | Gets the billing properties for a subscription x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMCA.json | +| [billingPropertyUpdateSample.ts][billingpropertyupdatesample] | Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchCostCenter.json | +| [billingRequestsCreateOrUpdateSample.ts][billingrequestscreateorupdatesample] | Create or update a billing request. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsCreateOrUpdate.json | +| [billingRequestsGetSample.ts][billingrequestsgetsample] | Gets a billing request by its ID. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsGet.json | +| [billingRequestsListByBillingAccountSample.ts][billingrequestslistbybillingaccountsample] | The list of billing requests submitted for the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingAccount.json | +| [billingRequestsListByBillingProfileSample.ts][billingrequestslistbybillingprofilesample] | The list of billing requests submitted for the billing profile. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingProfile.json | +| [billingRequestsListByCustomerSample.ts][billingrequestslistbycustomersample] | The list of billing requests submitted for the customer. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByCustomer.json | +| [billingRequestsListByInvoiceSectionSample.ts][billingrequestslistbyinvoicesectionsample] | The list of billing requests submitted for the invoice section. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByInvoiceSection.json | +| [billingRequestsListByUserSample.ts][billingrequestslistbyusersample] | The list of billing requests submitted by a user. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUser.json | +| [billingRoleAssignmentsCreateByBillingAccountSample.ts][billingroleassignmentscreatebybillingaccountsample] | Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingAccount.json | +| [billingRoleAssignmentsCreateByBillingProfileSample.ts][billingroleassignmentscreatebybillingprofilesample] | Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingProfile.json | +| [billingRoleAssignmentsCreateByCustomerSample.ts][billingroleassignmentscreatebycustomersample] | Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByCustomer.json | +| [billingRoleAssignmentsCreateByInvoiceSectionSample.ts][billingroleassignmentscreatebyinvoicesectionsample] | Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByInvoiceSection.json | +| [billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts][billingroleassignmentscreateorupdatebybillingaccountsample] | Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByBillingAccount.json | +| [billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts][billingroleassignmentscreateorupdatebydepartmentsample] | Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByDepartment.json | +| [billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts][billingroleassignmentscreateorupdatebyenrollmentaccountsample] | Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByEnrollmentAccount.json | +| [billingRoleAssignmentsDeleteByBillingAccountSample.ts][billingroleassignmentsdeletebybillingaccountsample] | Deletes a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingAccount.json | +| [billingRoleAssignmentsDeleteByBillingProfileSample.ts][billingroleassignmentsdeletebybillingprofilesample] | Deletes a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingProfile.json | +| [billingRoleAssignmentsDeleteByCustomerSample.ts][billingroleassignmentsdeletebycustomersample] | Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByCustomer.json | +| [billingRoleAssignmentsDeleteByDepartmentSample.ts][billingroleassignmentsdeletebydepartmentsample] | Deletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByDepartment.json | +| [billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts][billingroleassignmentsdeletebyenrollmentaccountsample] | Deletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByEnrollmentAccount.json | +| [billingRoleAssignmentsDeleteByInvoiceSectionSample.ts][billingroleassignmentsdeletebyinvoicesectionsample] | Deletes a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByInvoiceSection.json | +| [billingRoleAssignmentsGetByBillingAccountSample.ts][billingroleassignmentsgetbybillingaccountsample] | Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingAccount.json | +| [billingRoleAssignmentsGetByBillingProfileSample.ts][billingroleassignmentsgetbybillingprofilesample] | Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingProfile.json | +| [billingRoleAssignmentsGetByCustomerSample.ts][billingroleassignmentsgetbycustomersample] | Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByCustomer.json | +| [billingRoleAssignmentsGetByDepartmentSample.ts][billingroleassignmentsgetbydepartmentsample] | Gets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByDepartment.json | +| [billingRoleAssignmentsGetByEnrollmentAccountSample.ts][billingroleassignmentsgetbyenrollmentaccountsample] | Gets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByEnrollmentAccount.json | +| [billingRoleAssignmentsGetByInvoiceSectionSample.ts][billingroleassignmentsgetbyinvoicesectionsample] | Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByInvoiceSection.json | +| [billingRoleAssignmentsListByBillingAccountSample.ts][billingroleassignmentslistbybillingaccountsample] | Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingAccount.json | +| [billingRoleAssignmentsListByBillingProfileSample.ts][billingroleassignmentslistbybillingprofilesample] | Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingProfile.json | +| [billingRoleAssignmentsListByCustomerSample.ts][billingroleassignmentslistbycustomersample] | Lists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByCustomer.json | +| [billingRoleAssignmentsListByDepartmentSample.ts][billingroleassignmentslistbydepartmentsample] | Lists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByDepartment.json | +| [billingRoleAssignmentsListByEnrollmentAccountSample.ts][billingroleassignmentslistbyenrollmentaccountsample] | Lists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByEnrollmentAccount.json | +| [billingRoleAssignmentsListByInvoiceSectionSample.ts][billingroleassignmentslistbyinvoicesectionsample] | Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByInvoiceSection.json | +| [billingRoleAssignmentsResolveByBillingAccountSample.ts][billingroleassignmentsresolvebybillingaccountsample] | Lists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingAccount.json | +| [billingRoleAssignmentsResolveByBillingProfileSample.ts][billingroleassignmentsresolvebybillingprofilesample] | Lists the role assignments for the caller on an billing profile while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingProfile.json | +| [billingRoleAssignmentsResolveByCustomerSample.ts][billingroleassignmentsresolvebycustomersample] | Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByCustomer.json | +| [billingRoleAssignmentsResolveByInvoiceSectionSample.ts][billingroleassignmentsresolvebyinvoicesectionsample] | Lists the role assignments for the caller on an invoice section while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByInvoiceSection.json | +| [billingRoleDefinitionGetByBillingAccountSample.ts][billingroledefinitiongetbybillingaccountsample] | Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingAccount.json | +| [billingRoleDefinitionGetByBillingProfileSample.ts][billingroledefinitiongetbybillingprofilesample] | Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingProfile.json | +| [billingRoleDefinitionGetByCustomerSample.ts][billingroledefinitiongetbycustomersample] | Gets the definition for a role on a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByCustomer.json | +| [billingRoleDefinitionGetByDepartmentSample.ts][billingroledefinitiongetbydepartmentsample] | Gets the definition for a role on a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByDepartment.json | +| [billingRoleDefinitionGetByEnrollmentAccountSample.ts][billingroledefinitiongetbyenrollmentaccountsample] | Gets the definition for a role on an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByEnrollmentAccount.json | +| [billingRoleDefinitionGetByInvoiceSectionSample.ts][billingroledefinitiongetbyinvoicesectionsample] | Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByInvoiceSection.json | +| [billingRoleDefinitionListByBillingAccountSample.ts][billingroledefinitionlistbybillingaccountsample] | Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingAccount.json | +| [billingRoleDefinitionListByBillingProfileSample.ts][billingroledefinitionlistbybillingprofilesample] | Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingProfile.json | +| [billingRoleDefinitionListByCustomerSample.ts][billingroledefinitionlistbycustomersample] | Lists the role definitions for a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByCustomer.json | +| [billingRoleDefinitionListByDepartmentSample.ts][billingroledefinitionlistbydepartmentsample] | List the definition for a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByDepartment.json | +| [billingRoleDefinitionListByEnrollmentAccountSample.ts][billingroledefinitionlistbyenrollmentaccountsample] | List the definition for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByEnrollmentAccount.json | +| [billingRoleDefinitionListByInvoiceSectionSample.ts][billingroledefinitionlistbyinvoicesectionsample] | Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByInvoiceSection.json | +| [billingSubscriptionsAliasesCreateOrUpdateSample.ts][billingsubscriptionsaliasescreateorupdatesample] | Creates or updates a billing subscription by its alias ID. The operation is supported for seat based billing subscriptions. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasCreateOrUpdate.json | +| [billingSubscriptionsAliasesGetSample.ts][billingsubscriptionsaliasesgetsample] | Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasGet.json | +| [billingSubscriptionsAliasesListByBillingAccountSample.ts][billingsubscriptionsaliaseslistbybillingaccountsample] | Lists the subscription aliases for a billing account. The operation is supported for seat based billing subscriptions. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasList.json | +| [billingSubscriptionsCancelSample.ts][billingsubscriptionscancelsample] | Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsCancel.json | +| [billingSubscriptionsDeleteSample.ts][billingsubscriptionsdeletesample] | Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsDelete.json | +| [billingSubscriptionsGetByBillingProfileSample.ts][billingsubscriptionsgetbybillingprofilesample] | Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionGetByBillingProfile.json | +| [billingSubscriptionsGetSample.ts][billingsubscriptionsgetsample] | Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsGet.json | +| [billingSubscriptionsListByBillingAccountSample.ts][billingsubscriptionslistbybillingaccountsample] | Lists the subscriptions for a billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingAccount.json | +| [billingSubscriptionsListByBillingProfileSample.ts][billingsubscriptionslistbybillingprofilesample] | Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileEA.json | +| [billingSubscriptionsListByCustomerAtBillingAccountSample.ts][billingsubscriptionslistbycustomeratbillingaccountsample] | Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomerAtBillingAccount.json | +| [billingSubscriptionsListByCustomerSample.ts][billingsubscriptionslistbycustomersample] | Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomer.json | +| [billingSubscriptionsListByEnrollmentAccountSample.ts][billingsubscriptionslistbyenrollmentaccountsample] | Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByEnrollmentAccount.json | +| [billingSubscriptionsListByInvoiceSectionSample.ts][billingsubscriptionslistbyinvoicesectionsample] | Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByInvoiceSection.json | +| [billingSubscriptionsMergeSample.ts][billingsubscriptionsmergesample] | Merges the billing subscription provided in the request with a target billing subscription. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsMerge.json | +| [billingSubscriptionsMoveSample.ts][billingsubscriptionsmovesample] | Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionMove.json | +| [billingSubscriptionsSplitSample.ts][billingsubscriptionssplitsample] | Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsSplit.json | +| [billingSubscriptionsUpdateSample.ts][billingsubscriptionsupdatesample] | Updates the properties of a billing subscription. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsUpdate.json | +| [billingSubscriptionsValidateMoveEligibilitySample.ts][billingsubscriptionsvalidatemoveeligibilitysample] | Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveFailure.json | +| [customersGetByBillingAccountSample.ts][customersgetbybillingaccountsample] | Gets a customer by its ID at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGetByBillingAccount.json | +| [customersGetSample.ts][customersgetsample] | Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGet.json | +| [customersListByBillingAccountSample.ts][customerslistbybillingaccountsample] | Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingAccount.json | +| [customersListByBillingProfileSample.ts][customerslistbybillingprofilesample] | Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingProfile.json | +| [departmentsGetSample.ts][departmentsgetsample] | Gets a department by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentGet.json | +| [departmentsListByBillingAccountSample.ts][departmentslistbybillingaccountsample] | Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentsListByBillingAccount.json | +| [enrollmentAccountsGetByDepartmentSample.ts][enrollmentaccountsgetbydepartmentsample] | Gets an enrollment account by department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountByDepartment.json | +| [enrollmentAccountsGetSample.ts][enrollmentaccountsgetsample] | Gets an enrollment account by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountGet.json | +| [enrollmentAccountsListByBillingAccountSample.ts][enrollmentaccountslistbybillingaccountsample] | Lists the enrollment accounts for a billing account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByBillingAccount.json | +| [enrollmentAccountsListByDepartmentSample.ts][enrollmentaccountslistbydepartmentsample] | Lists the enrollment accounts for a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByDepartment.json | +| [invoiceSectionsCreateOrUpdateSample.ts][invoicesectionscreateorupdatesample] | Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsCreateOrUpdate.json | +| [invoiceSectionsDeleteSample.ts][invoicesectionsdeletesample] | Deletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsDelete.json | +| [invoiceSectionsGetSample.ts][invoicesectionsgetsample] | Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsGet.json | +| [invoiceSectionsListByBillingProfileSample.ts][invoicesectionslistbybillingprofilesample] | Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsListByBillingProfile.json | +| [invoiceSectionsValidateDeleteEligibilitySample.ts][invoicesectionsvalidatedeleteeligibilitysample] | Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilityFailure.json | +| [invoicesAmendSample.ts][invoicesamendsample] | Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesAmend.json | +| [invoicesDownloadByBillingAccountSample.ts][invoicesdownloadbybillingaccountsample] | Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingAccount.json | +| [invoicesDownloadByBillingSubscriptionSample.ts][invoicesdownloadbybillingsubscriptionsample] | Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingSubscription.json | +| [invoicesDownloadDocumentsByBillingAccountSample.ts][invoicesdownloaddocumentsbybillingaccountsample] | Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingAccount.json | +| [invoicesDownloadDocumentsByBillingSubscriptionSample.ts][invoicesdownloaddocumentsbybillingsubscriptionsample] | Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingSubscription.json | +| [invoicesDownloadSummaryByBillingAccountSample.ts][invoicesdownloadsummarybybillingaccountsample] | Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadSummaryByBillingAccount.json | +| [invoicesGetByBillingAccountSample.ts][invoicesgetbybillingaccountsample] | Gets an invoice by billing account name and ID. The operation is supported for all billing account types. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingAccount.json | +| [invoicesGetByBillingSubscriptionSample.ts][invoicesgetbybillingsubscriptionsample] | Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingSubscription.json | +| [invoicesGetSample.ts][invoicesgetsample] | Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGet.json | +| [invoicesListByBillingAccountSample.ts][invoiceslistbybillingaccountsample] | Lists the invoices for a billing account for a given start date and end date. The operation is supported for all billing account types. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingAccount.json | +| [invoicesListByBillingProfileSample.ts][invoiceslistbybillingprofilesample] | Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingProfile.json | +| [invoicesListByBillingSubscriptionSample.ts][invoiceslistbybillingsubscriptionsample] | Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingSubscription.json | +| [operationsListSample.ts][operationslistsample] | List of operations supported by provider. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/operationsList.json | +| [partnerTransfersCancelSample.ts][partnertransferscancelsample] | Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersCancel.json | +| [partnerTransfersGetSample.ts][partnertransfersgetsample] | Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersGet.json | +| [partnerTransfersInitiateSample.ts][partnertransfersinitiatesample] | Sends a request to a user in a customer's billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersInitiate.json | +| [partnerTransfersListSample.ts][partnertransferslistsample] | Lists the transfer requests sent to a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersList.json | +| [paymentMethodsDeleteByUserSample.ts][paymentmethodsdeletebyusersample] | Deletes a payment method owned by the caller. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsDeleteByUser.json | +| [paymentMethodsGetByBillingAccountSample.ts][paymentmethodsgetbybillingaccountsample] | Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingAccount.json | +| [paymentMethodsGetByBillingProfileSample.ts][paymentmethodsgetbybillingprofilesample] | Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingProfile.json | +| [paymentMethodsGetByUserSample.ts][paymentmethodsgetbyusersample] | Gets a payment method owned by the caller. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByUser.json | +| [paymentMethodsListByBillingAccountSample.ts][paymentmethodslistbybillingaccountsample] | Lists the payment methods available for a billing account. Along with the payment methods owned by the caller, these payment methods can be attached to a billing profile to make payments. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingAccount.json | +| [paymentMethodsListByBillingProfileSample.ts][paymentmethodslistbybillingprofilesample] | Lists payment methods attached to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingProfile.json | +| [paymentMethodsListByUserSample.ts][paymentmethodslistbyusersample] | Lists the payment methods owned by the caller. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByUser.json | +| [policiesCreateOrUpdateByBillingAccountSample.ts][policiescreateorupdatebybillingaccountsample] | Update the policies for a billing account of Enterprise Agreement type. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingAccount.json | +| [policiesCreateOrUpdateByBillingProfileSample.ts][policiescreateorupdatebybillingprofilesample] | Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingProfile.json | +| [policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts][policiescreateorupdatebycustomeratbillingaccountsample] | Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomerAtBillingAccount.json | +| [policiesCreateOrUpdateByCustomerSample.ts][policiescreateorupdatebycustomersample] | Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomer.json | +| [policiesGetByBillingAccountSample.ts][policiesgetbybillingaccountsample] | Get the policies for a billing account of Enterprise Agreement type. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingAccount.json | +| [policiesGetByBillingProfileSample.ts][policiesgetbybillingprofilesample] | Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingProfile.json | +| [policiesGetByCustomerAtBillingAccountSample.ts][policiesgetbycustomeratbillingaccountsample] | Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomerAtBillingAccount.json | +| [policiesGetByCustomerSample.ts][policiesgetbycustomersample] | Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomer.json | +| [policiesGetBySubscriptionSample.ts][policiesgetbysubscriptionsample] | Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetBySubscription.json | +| [productsGetSample.ts][productsgetsample] | Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsGet.json | +| [productsListByBillingAccountSample.ts][productslistbybillingaccountsample] | Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingAccount.json | +| [productsListByBillingProfileSample.ts][productslistbybillingprofilesample] | Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingProfile.json | +| [productsListByCustomerSample.ts][productslistbycustomersample] | Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByCustomer.json | +| [productsListByInvoiceSectionSample.ts][productslistbyinvoicesectionsample] | Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByInvoiceSection.json | +| [productsMoveSample.ts][productsmovesample] | Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productMove.json | +| [productsUpdateSample.ts][productsupdatesample] | Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsUpdate.json | +| [productsValidateMoveEligibilitySample.ts][productsvalidatemoveeligibilitysample] | Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveFailure.json | +| [recipientTransfersAcceptSample.ts][recipienttransfersacceptsample] | Accepts a transfer request. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersAccept.json | +| [recipientTransfersDeclineSample.ts][recipienttransfersdeclinesample] | Declines a transfer request. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersDecline.json | +| [recipientTransfersGetSample.ts][recipienttransfersgetsample] | Gets a transfer request by ID. The caller must be the recipient of the transfer request. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersGet.json | +| [recipientTransfersListSample.ts][recipienttransferslistsample] | Lists the transfer requests received by the caller. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersList.json | +| [recipientTransfersValidateSample.ts][recipienttransfersvalidatesample] | Validates if a subscription or a reservation can be transferred. Use this operation to validate your subscriptions or reservation before using the accept transfer operation. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersValidate.json | +| [reservationOrdersGetByBillingAccountSample.ts][reservationordersgetbybillingaccountsample] | Get the details of the ReservationOrder in the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccount.json | +| [reservationOrdersListByBillingAccountSample.ts][reservationorderslistbybillingaccountsample] | List all the `ReservationOrders in the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrdersListByBillingAccount.json | +| [reservationsGetByReservationOrderSample.ts][reservationsgetbyreservationordersample] | Get specific Reservation details in the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccount.json | +| [reservationsListByBillingAccountSample.ts][reservationslistbybillingaccountsample] | Lists the reservations in the billing account and the roll up counts of reservations group by provisioning states. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingAccount.json | +| [reservationsListByBillingProfileSample.ts][reservationslistbybillingprofilesample] | Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingProfile.json | +| [reservationsListByReservationOrderSample.ts][reservationslistbyreservationordersample] | List Reservations within a single ReservationOrder in the billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsGetFromOrderByBillingAccount.json | +| [reservationsUpdateByBillingAccountSample.ts][reservationsupdatebybillingaccountsample] | Update reservation by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationUpdateByBillingAccount.json | +| [savingsPlanOrdersGetByBillingAccountSample.ts][savingsplanordersgetbybillingaccountsample] | Get a savings plan order by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderGetByBillingAccount.json | +| [savingsPlanOrdersListByBillingAccountSample.ts][savingsplanorderslistbybillingaccountsample] | List all Savings plan orders by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderListByBillingAccount.json | +| [savingsPlansGetByBillingAccountSample.ts][savingsplansgetbybillingaccountsample] | Get savings plan by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetByBillingAccount.json | +| [savingsPlansListByBillingAccountSample.ts][savingsplanslistbybillingaccountsample] | List savings plans by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListByBillingAccount.json | +| [savingsPlansListBySavingsPlanOrderSample.ts][savingsplanslistbysavingsplanordersample] | List savings plans in an order by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListBySavingsPlanOrders.json | +| [savingsPlansUpdateByBillingAccountSample.ts][savingsplansupdatebybillingaccountsample] | Update savings plan by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanUpdateByBillingAccount.json | +| [savingsPlansValidateUpdateByBillingAccountSample.ts][savingsplansvalidateupdatebybillingaccountsample] | Validate savings plan patch by billing account. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanValidateUpdateByBillingAccount.json | +| [transactionsGetTransactionSummaryByInvoiceSample.ts][transactionsgettransactionsummarybyinvoicesample] | Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionSummaryGetByInvoice.json | +| [transactionsListByBillingProfileSample.ts][transactionslistbybillingprofilesample] | Lists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByBillingProfile.json | +| [transactionsListByCustomerSample.ts][transactionslistbycustomersample] | Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByCustomer.json | +| [transactionsListByInvoiceSample.ts][transactionslistbyinvoicesample] | Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoice.json | +| [transactionsListByInvoiceSectionSample.ts][transactionslistbyinvoicesectionsample] | Lists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoiceSection.json | +| [transactionsTransactionsDownloadByInvoiceSample.ts][transactionstransactionsdownloadbyinvoicesample] | Gets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsDownloadByInvoice.json | +| [transfersCancelSample.ts][transferscancelsample] | Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersCancel.json | +| [transfersGetSample.ts][transfersgetsample] | Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersGet.json | +| [transfersInitiateSample.ts][transfersinitiatesample] | Sends a request to a user in another billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersInitiate.json | +| [transfersListSample.ts][transferslistsample] | Lists the transfer requests for an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersList.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/addressValidateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/addressValidateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[addressvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/addressValidateSample.ts +[agreementsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/agreementsGetSample.ts +[agreementslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/agreementsListByBillingAccountSample.ts +[associatedtenantscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsCreateOrUpdateSample.ts +[associatedtenantsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsDeleteSample.ts +[associatedtenantsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsGetSample.ts +[associatedtenantslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsListByBillingAccountSample.ts +[availablebalancesgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingAccountSample.ts +[availablebalancesgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingProfileSample.ts +[billingaccountsaddpaymenttermssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsAddPaymentTermsSample.ts +[billingaccountscancelpaymenttermssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsCancelPaymentTermsSample.ts +[billingaccountsconfirmtransitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsConfirmTransitionSample.ts +[billingaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsGetSample.ts +[billingaccountslistinvoicesectionsbycreatesubscriptionpermissionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts +[billingaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsListSample.ts +[billingaccountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsUpdateSample.ts +[billingaccountsvalidatepaymenttermssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsValidatePaymentTermsSample.ts +[billingpermissionscheckaccessbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingAccountSample.ts +[billingpermissionscheckaccessbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingProfileSample.ts +[billingpermissionscheckaccessbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByCustomerSample.ts +[billingpermissionscheckaccessbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByDepartmentSample.ts +[billingpermissionscheckaccessbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByEnrollmentAccountSample.ts +[billingpermissionscheckaccessbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByInvoiceSectionSample.ts +[billingpermissionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByBillingAccountSample.ts +[billingpermissionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByBillingProfileSample.ts +[billingpermissionslistbycustomeratbillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByCustomerAtBillingAccountSample.ts +[billingpermissionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByCustomerSample.ts +[billingpermissionslistbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByDepartmentSample.ts +[billingpermissionslistbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByEnrollmentAccountSample.ts +[billingpermissionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByInvoiceSectionSample.ts +[billingprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesCreateOrUpdateSample.ts +[billingprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesDeleteSample.ts +[billingprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesGetSample.ts +[billingprofileslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesListByBillingAccountSample.ts +[billingprofilesvalidatedeleteeligibilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesValidateDeleteEligibilitySample.ts +[billingpropertygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyGetSample.ts +[billingpropertyupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyUpdateSample.ts +[billingrequestscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsCreateOrUpdateSample.ts +[billingrequestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsGetSample.ts +[billingrequestslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingAccountSample.ts +[billingrequestslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingProfileSample.ts +[billingrequestslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByCustomerSample.ts +[billingrequestslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByInvoiceSectionSample.ts +[billingrequestslistbyusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByUserSample.ts +[billingroleassignmentscreatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingAccountSample.ts +[billingroleassignmentscreatebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingProfileSample.ts +[billingroleassignmentscreatebycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByCustomerSample.ts +[billingroleassignmentscreatebyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByInvoiceSectionSample.ts +[billingroleassignmentscreateorupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts +[billingroleassignmentscreateorupdatebydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts +[billingroleassignmentscreateorupdatebyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts +[billingroleassignmentsdeletebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts +[billingroleassignmentsdeletebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts +[billingroleassignmentsdeletebycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByCustomerSample.ts +[billingroleassignmentsdeletebydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByDepartmentSample.ts +[billingroleassignmentsdeletebyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts +[billingroleassignmentsdeletebyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts +[billingroleassignmentsgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByBillingAccountSample.ts +[billingroleassignmentsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByBillingProfileSample.ts +[billingroleassignmentsgetbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByCustomerSample.ts +[billingroleassignmentsgetbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByDepartmentSample.ts +[billingroleassignmentsgetbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByEnrollmentAccountSample.ts +[billingroleassignmentsgetbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByInvoiceSectionSample.ts +[billingroleassignmentslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByBillingAccountSample.ts +[billingroleassignmentslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByBillingProfileSample.ts +[billingroleassignmentslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByCustomerSample.ts +[billingroleassignmentslistbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByDepartmentSample.ts +[billingroleassignmentslistbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByEnrollmentAccountSample.ts +[billingroleassignmentslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByInvoiceSectionSample.ts +[billingroleassignmentsresolvebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingAccountSample.ts +[billingroleassignmentsresolvebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingProfileSample.ts +[billingroleassignmentsresolvebycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByCustomerSample.ts +[billingroleassignmentsresolvebyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByInvoiceSectionSample.ts +[billingroledefinitiongetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByBillingAccountSample.ts +[billingroledefinitiongetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByBillingProfileSample.ts +[billingroledefinitiongetbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByCustomerSample.ts +[billingroledefinitiongetbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByDepartmentSample.ts +[billingroledefinitiongetbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByEnrollmentAccountSample.ts +[billingroledefinitiongetbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByInvoiceSectionSample.ts +[billingroledefinitionlistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByBillingAccountSample.ts +[billingroledefinitionlistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByBillingProfileSample.ts +[billingroledefinitionlistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByCustomerSample.ts +[billingroledefinitionlistbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByDepartmentSample.ts +[billingroledefinitionlistbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByEnrollmentAccountSample.ts +[billingroledefinitionlistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByInvoiceSectionSample.ts +[billingsubscriptionsaliasescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesCreateOrUpdateSample.ts +[billingsubscriptionsaliasesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesGetSample.ts +[billingsubscriptionsaliaseslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesListByBillingAccountSample.ts +[billingsubscriptionscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsCancelSample.ts +[billingsubscriptionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsDeleteSample.ts +[billingsubscriptionsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsGetByBillingProfileSample.ts +[billingsubscriptionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsGetSample.ts +[billingsubscriptionslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingAccountSample.ts +[billingsubscriptionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingProfileSample.ts +[billingsubscriptionslistbycustomeratbillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByCustomerAtBillingAccountSample.ts +[billingsubscriptionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByCustomerSample.ts +[billingsubscriptionslistbyenrollmentaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByEnrollmentAccountSample.ts +[billingsubscriptionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByInvoiceSectionSample.ts +[billingsubscriptionsmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMergeSample.ts +[billingsubscriptionsmovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMoveSample.ts +[billingsubscriptionssplitsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsSplitSample.ts +[billingsubscriptionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsUpdateSample.ts +[billingsubscriptionsvalidatemoveeligibilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsValidateMoveEligibilitySample.ts +[customersgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/customersGetByBillingAccountSample.ts +[customersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/customersGetSample.ts +[customerslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/customersListByBillingAccountSample.ts +[customerslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/customersListByBillingProfileSample.ts +[departmentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/departmentsGetSample.ts +[departmentslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/departmentsListByBillingAccountSample.ts +[enrollmentaccountsgetbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetByDepartmentSample.ts +[enrollmentaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetSample.ts +[enrollmentaccountslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByBillingAccountSample.ts +[enrollmentaccountslistbydepartmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByDepartmentSample.ts +[invoicesectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsCreateOrUpdateSample.ts +[invoicesectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsDeleteSample.ts +[invoicesectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsGetSample.ts +[invoicesectionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsListByBillingProfileSample.ts +[invoicesectionsvalidatedeleteeligibilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsValidateDeleteEligibilitySample.ts +[invoicesamendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesAmendSample.ts +[invoicesdownloadbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingAccountSample.ts +[invoicesdownloadbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingSubscriptionSample.ts +[invoicesdownloaddocumentsbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingAccountSample.ts +[invoicesdownloaddocumentsbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingSubscriptionSample.ts +[invoicesdownloadsummarybybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadSummaryByBillingAccountSample.ts +[invoicesgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingAccountSample.ts +[invoicesgetbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingSubscriptionSample.ts +[invoicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetSample.ts +[invoiceslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingAccountSample.ts +[invoiceslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingProfileSample.ts +[invoiceslistbybillingsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingSubscriptionSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/operationsListSample.ts +[partnertransferscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersCancelSample.ts +[partnertransfersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersGetSample.ts +[partnertransfersinitiatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersInitiateSample.ts +[partnertransferslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersListSample.ts +[paymentmethodsdeletebyusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsDeleteByUserSample.ts +[paymentmethodsgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingAccountSample.ts +[paymentmethodsgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingProfileSample.ts +[paymentmethodsgetbyusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByUserSample.ts +[paymentmethodslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingAccountSample.ts +[paymentmethodslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingProfileSample.ts +[paymentmethodslistbyusersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByUserSample.ts +[policiescreateorupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingAccountSample.ts +[policiescreateorupdatebybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingProfileSample.ts +[policiescreateorupdatebycustomeratbillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts +[policiescreateorupdatebycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByCustomerSample.ts +[policiesgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByBillingAccountSample.ts +[policiesgetbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByBillingProfileSample.ts +[policiesgetbycustomeratbillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByCustomerAtBillingAccountSample.ts +[policiesgetbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByCustomerSample.ts +[policiesgetbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetBySubscriptionSample.ts +[productsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/productsGetSample.ts +[productslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByBillingAccountSample.ts +[productslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByBillingProfileSample.ts +[productslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByCustomerSample.ts +[productslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByInvoiceSectionSample.ts +[productsmovesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/productsMoveSample.ts +[productsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/productsUpdateSample.ts +[productsvalidatemoveeligibilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/productsValidateMoveEligibilitySample.ts +[recipienttransfersacceptsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersAcceptSample.ts +[recipienttransfersdeclinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersDeclineSample.ts +[recipienttransfersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersGetSample.ts +[recipienttransferslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersListSample.ts +[recipienttransfersvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersValidateSample.ts +[reservationordersgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersGetByBillingAccountSample.ts +[reservationorderslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersListByBillingAccountSample.ts +[reservationsgetbyreservationordersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsGetByReservationOrderSample.ts +[reservationslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByBillingAccountSample.ts +[reservationslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByBillingProfileSample.ts +[reservationslistbyreservationordersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByReservationOrderSample.ts +[reservationsupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsUpdateByBillingAccountSample.ts +[savingsplanordersgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlanOrdersGetByBillingAccountSample.ts +[savingsplanorderslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlanOrdersListByBillingAccountSample.ts +[savingsplansgetbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansGetByBillingAccountSample.ts +[savingsplanslistbybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListByBillingAccountSample.ts +[savingsplanslistbysavingsplanordersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListBySavingsPlanOrderSample.ts +[savingsplansupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansUpdateByBillingAccountSample.ts +[savingsplansvalidateupdatebybillingaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansValidateUpdateByBillingAccountSample.ts +[transactionsgettransactionsummarybyinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsGetTransactionSummaryByInvoiceSample.ts +[transactionslistbybillingprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByBillingProfileSample.ts +[transactionslistbycustomersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByCustomerSample.ts +[transactionslistbyinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByInvoiceSample.ts +[transactionslistbyinvoicesectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByInvoiceSectionSample.ts +[transactionstransactionsdownloadbyinvoicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsTransactionsDownloadByInvoiceSample.ts +[transferscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transfersCancelSample.ts +[transfersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transfersGetSample.ts +[transfersinitiatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transfersInitiateSample.ts +[transferslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billing/arm-billing/samples/v5/typescript/src/transfersListSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-billing?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billing/arm-billing/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/billing/arm-billing/samples/v4/typescript/package.json b/sdk/billing/arm-billing/samples/v5/typescript/package.json similarity index 100% rename from sdk/billing/arm-billing/samples/v4/typescript/package.json rename to sdk/billing/arm-billing/samples/v5/typescript/package.json diff --git a/sdk/billing/arm-billing/samples/v4/typescript/sample.env b/sdk/billing/arm-billing/samples/v5/typescript/sample.env similarity index 100% rename from sdk/billing/arm-billing/samples/v4/typescript/sample.env rename to sdk/billing/arm-billing/samples/v5/typescript/sample.env diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/addressValidateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/addressValidateSample.ts similarity index 64% rename from sdk/billing/arm-billing/samples/v4/typescript/src/addressValidateSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/addressValidateSample.ts index 40559ca6b5be..a7fcdaee3ade 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/addressValidateSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/addressValidateSample.ts @@ -10,49 +10,53 @@ // Licensed under the MIT License. import { AddressDetails, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. * * @summary Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressInvalid.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateInvalid.json */ -async function addressInvalid() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const address: AddressDetails = { +async function addressValidateInvalid() { + const parameters: AddressDetails = { addressLine1: "1 Test", city: "bellevue", country: "us", postalCode: "12345", - region: "wa" + region: "wa", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.address.validate(address); + const client = new BillingManagementClient(credential); + const result = await client.address.validate(parameters); console.log(result); } -addressInvalid().catch(console.error); - /** * This sample demonstrates how to Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. * * @summary Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressValid.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/addressValidateValid.json */ -async function addressValid() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const address: AddressDetails = { - addressLine1: "1 Test Address", +async function addressValidateValid() { + const parameters: AddressDetails = { + addressLine1: "1 Test", city: "bellevue", country: "us", postalCode: "12345", - region: "wa" + region: "wa", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.address.validate(address); + const client = new BillingManagementClient(credential); + const result = await client.address.validate(parameters); console.log(result); } -addressValid().catch(console.error); +async function main() { + addressValidateInvalid(); + addressValidateValid(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/agreementsGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/agreementsGetSample.ts similarity index 66% rename from sdk/billing/arm-billing/samples/v4/typescript/src/agreementsGetSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/agreementsGetSample.ts index adce5f1a5ee4..4bc72afb1a3f 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/agreementsGetSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/agreementsGetSample.ts @@ -10,21 +10,28 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an agreement by ID. * * @summary Gets an agreement by ID. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementByName.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementByName.json */ async function agreementByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const agreementName = "{agreementName}"; + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const agreementName = "ABC123"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.agreements.get(billingAccountName, agreementName); console.log(result); } -agreementByName().catch(console.error); +async function main() { + agreementByName(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/agreementsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/agreementsListByBillingAccountSample.ts similarity index 56% rename from sdk/billing/arm-billing/samples/v4/typescript/src/agreementsListByBillingAccountSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/agreementsListByBillingAccountSample.ts index 2a65d902201a..8c2616a5d341 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/agreementsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/agreementsListByBillingAccountSample.ts @@ -8,27 +8,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; +import { + AgreementsListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the agreements for a billing account. * * @summary Lists the agreements for a billing account. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/agreementsListByBillingAccount.json */ async function agreementsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const expand = "Participants"; + const options: AgreementsListByBillingAccountOptionalParams = { expand }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.agreements.listByBillingAccount( - billingAccountName + billingAccountName, + options, )) { resArray.push(item); } console.log(resArray); } -agreementsListByBillingAccount().catch(console.error); +async function main() { + agreementsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..5e472e7264ca --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AssociatedTenant, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update an associated tenant for the billing account. + * + * @summary Create or update an associated tenant for the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsCreateOrUpdate.json + */ +async function associatedTenantsCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const associatedTenantName = "11111111-1111-1111-1111-111111111111"; + const parameters: AssociatedTenant = { + properties: { + billingManagementState: "Active", + displayName: "Contoso Finance", + provisioningManagementState: "Pending", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.associatedTenants.beginCreateOrUpdateAndWait( + billingAccountName, + associatedTenantName, + parameters, + ); + console.log(result); +} + +async function main() { + associatedTenantsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsDeleteSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsDeleteSample.ts new file mode 100644 index 000000000000..7ea79852d50e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes an associated tenant for a billing account. + * + * @summary Deletes an associated tenant for a billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsDelete.json + */ +async function associatedTenantsDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const associatedTenantName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.associatedTenants.beginDeleteAndWait( + billingAccountName, + associatedTenantName, + ); + console.log(result); +} + +async function main() { + associatedTenantsDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsGetSample.ts new file mode 100644 index 000000000000..ba8048a2b301 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsGetSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets an associated tenant by ID. + * + * @summary Gets an associated tenant by ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsGet.json + */ +async function associatedTenantsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const associatedTenantName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.associatedTenants.get( + billingAccountName, + associatedTenantName, + ); + console.log(result); +} + +async function main() { + associatedTenantsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsListByBillingAccountSample.ts new file mode 100644 index 000000000000..ea933921e919 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/associatedTenantsListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the associated tenants that can collaborate with the billing account on commerce activities like viewing and downloading invoices, managing payments, making purchases, and managing or provisioning licenses. + * + * @summary Lists the associated tenants that can collaborate with the billing account on commerce activities like viewing and downloading invoices, managing payments, making purchases, and managing or provisioning licenses. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/associatedTenantsListByBillingAccount.json + */ +async function associatedTenantsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.associatedTenants.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + associatedTenantsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingAccountSample.ts new file mode 100644 index 000000000000..06bd9aa2fc58 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingAccountSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The Available Credit or Payment on Account Balance for a billing account. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Online Services Program. + * + * @summary The Available Credit or Payment on Account Balance for a billing account. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Online Services Program. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingAccount.json + */ +async function availableBalanceGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.availableBalances.getByBillingAccount(billingAccountName); + console.log(result); +} + +async function main() { + availableBalanceGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingProfileSample.ts new file mode 100644 index 000000000000..86b75a1c3b96 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/availableBalancesGetByBillingProfileSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be used to settle due or past due invoices and is supported for billing accounts with agreement type Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/availableBalanceGetByBillingProfile.json + */ +async function availableBalanceGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.availableBalances.getByBillingProfile( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + availableBalanceGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsAddPaymentTermsSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsAddPaymentTermsSample.ts new file mode 100644 index 000000000000..04d666172963 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsAddPaymentTermsSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PaymentTerm, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action. + * + * @summary Adds payment terms to all the billing profiles under the billing account. Currently, payment terms can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are authorized to add the payment terms and is not a self-serve action. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsAdd.json + */ +async function paymentTermsAdd() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: PaymentTerm[] = [ + { + endDate: new Date("2023-01-25T22:39:34.2606750Z"), + startDate: new Date("2023-01-05T22:39:34.2606750Z"), + term: "net10", + }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginAddPaymentTermsAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + paymentTermsAdd(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsCancelPaymentTermsSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsCancelPaymentTermsSample.ts new file mode 100644 index 000000000000..44cf645955ba --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsCancelPaymentTermsSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action. + * + * @summary Cancels all the payment terms on billing account that falls after the cancellation date in the request. Currently, cancel payment terms is only served by admin actions and is not a self-serve action. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermsCancel.json + */ +async function paymentTermsCancel() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: Date = new Date("2023-01-05T22:39:34.2606750Z"); + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginCancelPaymentTermsAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + paymentTermsCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsConfirmTransitionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsConfirmTransitionSample.ts new file mode 100644 index 000000000000..90ae8eeaf536 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsConfirmTransitionSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. + * + * @summary Gets the transition details for a billing account that has transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsConfirmTransition.json + */ +async function billingAccountsConfirmTransition() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingAccounts.confirmTransition(billingAccountName); + console.log(result); +} + +async function main() { + billingAccountsConfirmTransition(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsGetSample.ts new file mode 100644 index 000000000000..049f8ea3eda2 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsGetSample.ts @@ -0,0 +1,114 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithExpandForPONumber.json + */ +async function billingAccountWithExpandForPoNumber() { + const billingAccountName = "8608480"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithRegistrationNumberWithDefaultType.json + */ +async function billingAccountWithRegistrationNumberWithDefaultType() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountWithRegistrationNumberWithType.json + */ +async function billingAccountWithRegistrationNumberWithType() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGet.json + */ +async function billingAccountsGet() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGetEA.json + */ +async function billingAccountsGetEa() { + const billingAccountName = "6575495"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +/** + * This sample demonstrates how to Gets a billing account by its ID. + * + * @summary Gets a billing account by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsGetWithExpand.json + */ +async function billingAccountsGetWithExpand() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.get(billingAccountName); + console.log(result); +} + +async function main() { + billingAccountWithExpandForPoNumber(); + billingAccountWithRegistrationNumberWithDefaultType(); + billingAccountWithRegistrationNumberWithType(); + billingAccountsGet(); + billingAccountsGetEa(); + billingAccountsGetWithExpand(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts similarity index 68% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts index 880d33491f59..e74124e19809 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListWithCreateSubPermission.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsWithCreateSubscriptionPermissionList.json */ -async function invoiceSectionsListWithCreateSubPermission() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function invoiceSectionsWithCreateSubscriptionPermissionList() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingAccounts.listInvoiceSectionsByCreateSubscriptionPermission( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionsListWithCreateSubPermission().catch(console.error); +async function main() { + invoiceSectionsWithCreateSubscriptionPermissionList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsListSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsListSample.ts similarity index 58% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsListSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsListSample.ts index 764719e4784e..e68b46daed1a 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingAccountsListSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsListSample.ts @@ -10,20 +10,22 @@ // Licensed under the MIT License. import { BillingAccountsListOptionalParams, - BillingManagementClient + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the billing accounts that a user has access to. * * @summary Lists the billing accounts that a user has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountForLegacyAccountDetails.json */ -async function billingAccountsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; +async function billingAccountForLegacyAccountDetails() { const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingAccounts.list()) { resArray.push(item); @@ -31,41 +33,33 @@ async function billingAccountsList() { console.log(resArray); } -billingAccountsList().catch(console.error); - /** * This sample demonstrates how to Lists the billing accounts that a user has access to. * * @summary Lists the billing accounts that a user has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpand.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsList.json */ -async function billingAccountsListWithExpand() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "soldTo,billingProfiles,billingProfiles/invoiceSections"; - const options: BillingAccountsListOptionalParams = { expand }; +async function billingAccountsList() { const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingAccounts.list(options)) { + for await (let item of client.billingAccounts.list()) { resArray.push(item); } console.log(resArray); } -billingAccountsListWithExpand().catch(console.error); - /** * This sample demonstrates how to Lists the billing accounts that a user has access to. * * @summary Lists the billing accounts that a user has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpandForEnrollmentDetails.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsListWithExpandForPONumber.json */ -async function billingAccountsListWithExpandForEnrollmentDetails() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const expand = "enrollmentDetails,departments,enrollmentAccounts"; +async function billingAccountsListWithExpandForPoNumber() { + const expand = "soldTo,enrollmentDetails/poNumber"; const options: BillingAccountsListOptionalParams = { expand }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingAccounts.list(options)) { resArray.push(item); @@ -73,4 +67,10 @@ async function billingAccountsListWithExpandForEnrollmentDetails() { console.log(resArray); } -billingAccountsListWithExpandForEnrollmentDetails().catch(console.error); +async function main() { + billingAccountForLegacyAccountDetails(); + billingAccountsList(); + billingAccountsListWithExpandForPoNumber(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsUpdateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsUpdateSample.ts new file mode 100644 index 000000000000..7eecd8edd93a --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsUpdateSample.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingAccountPatch, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * + * @summary Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountUpdateWithPONumber.json + */ +async function billingAccountUpdateWithPoNumber() { + const billingAccountName = "6575495"; + const parameters: BillingAccountPatch = { + properties: { enrollmentDetails: { poNumber: "poNumber123" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginUpdateAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * + * @summary Updates the properties of a billing account. Currently, displayName and address can be updated for billing accounts with agreement type Microsoft Customer Agreement. Currently address and notification email address can be updated for billing accounts with agreement type Microsoft Online Services Agreement. Currently, purchase order number can be edited for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingAccountsUpdate.json + */ +async function billingAccountsUpdate() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: BillingAccountPatch = { + properties: { + displayName: "Test Account", + soldTo: { + addressLine1: "1 Microsoft Way", + city: "Redmond", + companyName: "Contoso", + country: "US", + postalCode: "98052-8300", + region: "WA", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.beginUpdateAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + billingAccountUpdateWithPoNumber(); + billingAccountsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsValidatePaymentTermsSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsValidatePaymentTermsSample.ts new file mode 100644 index 000000000000..3cbf3ca9be37 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingAccountsValidatePaymentTermsSample.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { PaymentTerm, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * + * @summary Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermInvalid.json + */ +async function paymentTermInvalid() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: PaymentTerm[] = [ + { + endDate: new Date("2023-01-25T22:39:34.2606750Z"), + startDate: new Date("2023-02-05T22:39:34.2606750Z"), + term: "net10", + }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.validatePaymentTerms( + billingAccountName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * + * @summary Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and account type 'Enterprise'. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentTermValid.json + */ +async function paymentTermValid() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: PaymentTerm[] = [ + { + endDate: new Date("2023-01-25T22:39:34.2606750Z"), + startDate: new Date("2023-01-05T22:39:34.2606750Z"), + term: "net10", + }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingAccounts.validatePaymentTerms( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + paymentTermInvalid(); + paymentTermValid(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingAccountSample.ts new file mode 100644 index 000000000000..511a516950bc --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingAccountSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a billing account. + * + * @summary Provides a list of check access response objects for a billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingAccount.json + */ +async function checkAccessByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByBillingAccount( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingProfileSample.ts new file mode 100644 index 000000000000..dd697f0a896b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByBillingProfileSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a billing profile. + * + * @summary Provides a list of check access response objects for a billing profile. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByBillingProfile.json + */ +async function checkAccessByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByBillingProfile( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByCustomerSample.ts new file mode 100644 index 000000000000..5c4935a3b925 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByCustomerSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a customer. + * + * @summary Provides a list of check access response objects for a customer. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByCustomer.json + */ +async function checkAccessByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByCustomer( + billingAccountName, + billingProfileName, + customerName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByDepartmentSample.ts new file mode 100644 index 000000000000..269641df9f54 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByDepartmentSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for a department. + * + * @summary Provides a list of check access response objects for a department. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByDepartment.json + */ +async function checkAccessByDepartment() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const departmentName = "12345"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByDepartment( + billingAccountName, + departmentName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..945abfc76c12 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByEnrollmentAccountSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for an enrollment account. + * + * @summary Provides a list of check access response objects for an enrollment account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByEnrollmentAccount.json + */ +async function checkAccessByEnrollmentAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const enrollmentAccountName = "123456"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByInvoiceSectionSample.ts new file mode 100644 index 000000000000..c4b87d49819f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsCheckAccessByInvoiceSectionSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CheckAccessRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Provides a list of check access response objects for an invoice section. + * + * @summary Provides a list of check access response objects for an invoice section. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/checkAccessByInvoiceSection.json + */ +async function checkAccessByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "Q7GV-UUVA-PJA-TGB"; + const parameters: CheckAccessRequest = { + actions: [ + "Microsoft.Billing/billingAccounts/read", + "Microsoft.Subscription/subscriptions/write", + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingPermissions.checkAccessByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + parameters, + ); + console.log(result); +} + +async function main() { + checkAccessByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByBillingAccountSample.ts similarity index 64% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByBillingAccountSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByBillingAccountSample.ts index 7c4af9d13da8..f414fe38902f 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByBillingAccountSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the billing permissions the caller has on a billing account. * * @summary Lists the billing permissions the caller has on a billing account. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountPermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingAccount.json */ -async function billingAccountPermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingPermissionsListByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingPermissions.listByBillingAccount( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -billingAccountPermissionsList().catch(console.error); +async function main() { + billingPermissionsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByBillingProfileSample.ts similarity index 62% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByBillingProfileSample.ts index d7e1896ff12b..fc8b76061da2 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the billing permissions the caller has on a billing profile. * * @summary Lists the billing permissions the caller has on a billing profile. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilePermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByBillingProfile.json */ -async function billingProfilePermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingPermissionsListByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingPermissions.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingProfilePermissionsList().catch(console.error); +async function main() { + billingPermissionsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByCustomerAtBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByCustomerAtBillingAccountSample.ts new file mode 100644 index 000000000000..857fef954195 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByCustomerAtBillingAccountSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billing permissions the caller has for a customer at billing account level. + * + * @summary Lists the billing permissions the caller has for a customer at billing account level. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomerAtBillingAccount.json + */ +async function billingPermissionsListByCustomerAtBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingPermissions.listByCustomerAtBillingAccount( + billingAccountName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingPermissionsListByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByCustomerSample.ts similarity index 59% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByCustomerSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByCustomerSample.ts index 408366edc7a8..7268ce0ea0cf 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingPermissionsListByCustomerSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByCustomerSample.ts @@ -10,27 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the billing permissions the caller has for a customer. * * @summary Lists the billing permissions the caller has for a customer. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByCustomer.json */ -async function billingProfilePermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; +async function billingPermissionsListByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingPermissions.listByCustomer( billingAccountName, - customerName + billingProfileName, + customerName, )) { resArray.push(item); } console.log(resArray); } -billingProfilePermissionsList().catch(console.error); +async function main() { + billingPermissionsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByDepartmentSample.ts new file mode 100644 index 000000000000..6920bc8cdda4 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByDepartmentSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billing permissions the caller has for a department. + * + * @summary Lists the billing permissions the caller has for a department. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByDepartment.json + */ +async function billingPermissionsListByDepartment() { + const billingAccountName = "6100092"; + const departmentName = "123456"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingPermissions.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingPermissionsListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..5fc496625281 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billing permissions the caller has for an enrollment account. + * + * @summary Lists the billing permissions the caller has for an enrollment account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByEnrollmentAccount.json + */ +async function billingPermissionsListByEnrollmentAccount() { + const billingAccountName = "6100092"; + const enrollmentAccountName = "123456"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingPermissions.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingPermissionsListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByInvoiceSectionsSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByInvoiceSectionSample.ts similarity index 53% rename from sdk/billing/arm-billing/samples-dev/billingPermissionsListByInvoiceSectionsSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByInvoiceSectionSample.ts index 38ae8df41b00..1ea4ca78c93c 100644 --- a/sdk/billing/arm-billing/samples-dev/billingPermissionsListByInvoiceSectionsSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPermissionsListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the billing permissions the caller has on an invoice section. + * This sample demonstrates how to Lists the billing permissions the caller has for an invoice section. * - * @summary Lists the billing permissions the caller has on an invoice section. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json + * @summary Lists the billing permissions the caller has for an invoice section. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPermissionsListByInvoiceSection.json */ -async function invoiceSectionPermissionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function billingPermissionsListByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "XXXX-XXXX-XXX-XXX"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingPermissions.listByInvoiceSections( + for await (let item of client.billingPermissions.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionPermissionsList().catch(console.error); +async function main() { + billingPermissionsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..9bdaca39956e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesCreateOrUpdateSample.ts @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingProfile, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. + * + * @summary Creates or updates a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesCreateOrUpdate.json + */ +async function billingProfilesCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const parameters: BillingProfile = { + properties: { + billTo: { + addressLine1: "Test Address1", + addressLine2: "Test Address2", + addressLine3: "Test Address3", + city: "City", + companyName: "Contoso", + country: "US", + email: "abc@contoso.com", + firstName: "Test", + isValidAddress: true, + lastName: "User", + phoneNumber: "000-000-0000", + postalCode: "00000", + region: "WA", + }, + displayName: "Billing Profile 1", + enabledAzurePlans: [{ skuId: "0001" }, { skuId: "0002" }], + invoiceEmailOptIn: true, + poNumber: "ABC12345", + shipTo: { + addressLine1: "Test Address1", + addressLine2: "Test Address2", + addressLine3: "Test Address3", + city: "City", + companyName: "Contoso", + country: "US", + email: "abc@contoso.com", + firstName: "Test", + isValidAddress: true, + lastName: "User", + phoneNumber: "000-000-0000", + postalCode: "00000", + region: "WA", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.beginCreateOrUpdateAndWait( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + billingProfilesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesDeleteSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesDeleteSample.ts new file mode 100644 index 000000000000..9c4bc74377e1 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Deletes a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesDelete.json + */ +async function billingProfilesDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.beginDeleteAndWait( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + billingProfilesDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesGetSample.ts new file mode 100644 index 000000000000..5629bbecf259 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesGetSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesGet.json + */ +async function billingProfilesGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.get( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + billingProfilesGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesListByBillingAccountSample.ts new file mode 100644 index 000000000000..bff24c0728d3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Lists the billing profiles that a user has access to. The operation is supported for billing accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesListByBillingAccount.json + */ +async function billingProfilesListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingProfiles.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingProfilesListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesValidateDeleteEligibilitySample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesValidateDeleteEligibilitySample.ts new file mode 100644 index 000000000000..d12626474c0f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingProfilesValidateDeleteEligibilitySample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilityFailure.json + */ +async function billingProfilesValidateDeleteEligibilityFailure() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.validateDeleteEligibility( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Validates if the billing profile can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingProfilesValidateDeleteEligibilitySuccess.json + */ +async function billingProfilesValidateDeleteEligibilitySuccess() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingProfiles.validateDeleteEligibility( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + billingProfilesValidateDeleteEligibilityFailure(); + billingProfilesValidateDeleteEligibilitySuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyGetSample.ts new file mode 100644 index 000000000000..1540619ac4c1 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyGetSample.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the billing properties for a subscription + * + * @summary Gets the billing properties for a subscription + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMCA.json + */ +async function billingPropertyGetMca() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.get(); + console.log(result); +} + +/** + * This sample demonstrates how to Gets the billing properties for a subscription + * + * @summary Gets the billing properties for a subscription + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMOSP.json + */ +async function billingPropertyGetMosp() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.get(); + console.log(result); +} + +/** + * This sample demonstrates how to Gets the billing properties for a subscription + * + * @summary Gets the billing properties for a subscription + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyGetMPA.json + */ +async function billingPropertyGetMpa() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.get(); + console.log(result); +} + +async function main() { + billingPropertyGetMca(); + billingPropertyGetMosp(); + billingPropertyGetMpa(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyUpdateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyUpdateSample.ts new file mode 100644 index 000000000000..b2e3c9543954 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingPropertyUpdateSample.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingProperty, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * + * @summary Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchCostCenter.json + */ +async function billingPropertyPatchCostCenter() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const parameters: BillingProperty = { properties: { costCenter: "1010" } }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.update(parameters); + console.log(result); +} + +/** + * This sample demonstrates how to Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * + * @summary Updates the billing property of a subscription. Currently, cost center can be updated for billing accounts with agreement type Microsoft Customer Agreement and subscription service usage address can be updated for billing accounts with agreement type Microsoft Online Service Program. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingPropertyPatchSubscriptionServiceUsageAddress.json + */ +async function billingPropertyPatchSubscriptionServiceUsageAddress() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const parameters: BillingProperty = { + properties: { + subscriptionServiceUsageAddress: { + addressLine1: "Address line 1", + addressLine2: "Address line 2", + city: "City", + country: "US", + firstName: "Jenny", + lastName: "Doe", + middleName: "Ann", + postalCode: "12345", + region: "State", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.billingPropertyOperations.update(parameters); + console.log(result); +} + +async function main() { + billingPropertyPatchCostCenter(); + billingPropertyPatchSubscriptionServiceUsageAddress(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..22228cc29fad --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingRequest, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update a billing request. + * + * @summary Create or update a billing request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsCreateOrUpdate.json + */ +async function billingRequestsCreateOrUpdate() { + const billingRequestName = "00000000-0000-0000-0000-000000000000"; + const parameters: BillingRequest = { + properties: { + type: "RoleAssignment", + additionalInformation: { roleId: "40000000-aaaa-bbbb-cccc-200000000006" }, + decisionReason: "New team member", + requestScope: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx", + status: "Pending", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRequests.beginCreateOrUpdateAndWait( + billingRequestName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRequestsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsGetSample.ts new file mode 100644 index 000000000000..99ded34a0a2c --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a billing request by its ID. + * + * @summary Gets a billing request by its ID. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsGet.json + */ +async function billingRequestsGet() { + const billingRequestName = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRequests.get(billingRequestName); + console.log(result); +} + +async function main() { + billingRequestsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingAccountSample.ts new file mode 100644 index 000000000000..f63f81c5b96f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the billing account. + * + * @summary The list of billing requests submitted for the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingAccount.json + */ +async function billingRequestsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingProfileSample.ts new file mode 100644 index 000000000000..22a3392c7e15 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByBillingProfileSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the billing profile. + * + * @summary The list of billing requests submitted for the billing profile. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByBillingProfile.json + */ +async function billingRequestsListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByCustomerSample.ts new file mode 100644 index 000000000000..71757effb9cb --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the customer. + * + * @summary The list of billing requests submitted for the customer. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByCustomer.json + */ +async function billingRequestsListByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByInvoiceSectionSample.ts new file mode 100644 index 000000000000..d8de94919baf --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByInvoiceSectionSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted for the invoice section. + * + * @summary The list of billing requests submitted for the invoice section. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByInvoiceSection.json + */ +async function billingRequestsListByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByUserSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByUserSample.ts new file mode 100644 index 000000000000..73cad45676ea --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRequestsListByUserSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRequestsListByUserOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to The list of billing requests submitted by a user. + * + * @summary The list of billing requests submitted by a user. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUser.json + */ +async function billingRequestsListByUser() { + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByUser()) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to The list of billing requests submitted by a user. + * + * @summary The list of billing requests submitted by a user. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRequestsListByUserWithFilter.json + */ +async function billingRequestsListByUserWithFilter() { + const filter = "properties/status eq 'Approved'"; + const options: BillingRequestsListByUserOptionalParams = { filter }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRequests.listByUser(options)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRequestsListByUser(); + billingRequestsListByUserWithFilter(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingAccountSample.ts new file mode 100644 index 000000000000..e976e8220c45 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingAccountSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignmentProperties, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingAccount.json + */ +async function billingRoleAssignmentCreateByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const parameters: BillingRoleAssignmentProperties = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateByBillingAccountAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingProfileSample.ts new file mode 100644 index 000000000000..a2220c7af760 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByBillingProfileSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignmentProperties, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByBillingProfile.json + */ +async function billingRoleAssignmentCreateByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const parameters: BillingRoleAssignmentProperties = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateByBillingProfileAndWait( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByCustomerSample.ts new file mode 100644 index 000000000000..dffe25ba06b0 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByCustomerSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignmentProperties, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Adds a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByCustomer.json + */ +async function billingRoleAssignmentCreateByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const parameters: BillingRoleAssignmentProperties = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfileName/BKM6-54VH-BG7-PGB/customers/703ab484-dda2-4402-827b-a74513b61e2d/billingRoleDefinitions/30000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateByCustomerAndWait( + billingAccountName, + billingProfileName, + customerName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByInvoiceSectionSample.ts new file mode 100644 index 000000000000..a0b063085006 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateByInvoiceSectionSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignmentProperties, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateByInvoiceSection.json + */ +async function billingRoleAssignmentCreateByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const parameters: BillingRoleAssignmentProperties = { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30/billingProfiles/BKM6-54VH-BG7-PGB/invoiceSections/xxxx-xxxx-xxx-xxx/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000", + userEmailAddress: "john@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateByInvoiceSectionAndWait( + billingAccountName, + billingProfileName, + invoiceSectionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..3cdec0ef4268 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByBillingAccountSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignment, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByBillingAccount.json + */ +async function billingRoleAssignmentCreateOrUpdateByBillingAccount() { + const billingAccountName = "7898901"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const parameters: BillingRoleAssignment = { + properties: { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/7898901/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db", + userEmailAddress: "john@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName, + billingRoleAssignmentName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateOrUpdateByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts new file mode 100644 index 000000000000..da024f8caa60 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByDepartmentSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignment, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByDepartment.json + */ +async function billingRoleAssignmentCreateOrUpdateByDepartment() { + const billingAccountName = "7898901"; + const departmentName = "12345"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const parameters: BillingRoleAssignment = { + properties: { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/7898901/departments/12345/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db", + userEmailAddress: "john@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateOrUpdateByDepartmentAndWait( + billingAccountName, + departmentName, + billingRoleAssignmentName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateOrUpdateByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..a1c4ea22baf2 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsCreateOrUpdateByEnrollmentAccountSample.ts @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingRoleAssignment, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Create or update a billing role assignment. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentCreateOrUpdateByEnrollmentAccount.json + */ +async function billingRoleAssignmentCreateOrUpdateByEnrollmentAccount() { + const billingAccountName = "7898901"; + const enrollmentAccountName = "123456"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const parameters: BillingRoleAssignment = { + properties: { + principalId: "00000000-0000-0000-0000-000000000000", + principalTenantId: "076915e7-de10-4323-bb34-a58c904068bb", + roleDefinitionId: + "/providers/Microsoft.Billing/billingAccounts/7898901/enrollmentAccounts/123456/billingRoleDefinitions/9f1983cb-2574-400c-87e9-34cf8e2280db", + userEmailAddress: "john@contoso.com", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginCreateOrUpdateByEnrollmentAccountAndWait( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + parameters, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentCreateOrUpdateByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts new file mode 100644 index 000000000000..5eba27cbaf4d --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Deletes a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingAccount.json + */ +async function billingRoleAssignmentDeleteByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByBillingAccount( + billingAccountName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts new file mode 100644 index 000000000000..002fe77e54aa --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByBillingProfileSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Deletes a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByBillingProfile.json + */ +async function billingRoleAssignmentDeleteByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByBillingProfile( + billingAccountName, + billingProfileName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByCustomerSample.ts new file mode 100644 index 000000000000..72e0db2af976 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Deletes a role assignment on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByCustomer.json + */ +async function billingRoleAssignmentDeleteByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const billingRoleAssignmentName = + "30000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByCustomer( + billingAccountName, + billingProfileName, + customerName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByDepartmentSample.ts new file mode 100644 index 000000000000..3caf755bdc87 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByDepartmentSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Deletes a role assignment on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByDepartment.json + */ +async function billingRoleAssignmentDeleteByDepartment() { + const billingAccountName = "8608480"; + const departmentName = "123456"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByDepartment( + billingAccountName, + departmentName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..4733265f550d --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByEnrollmentAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Deletes a role assignment on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByEnrollmentAccount.json + */ +async function billingRoleAssignmentDeleteByEnrollmentAccount() { + const billingAccountName = "8608480"; + const enrollmentAccountName = "123456"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts new file mode 100644 index 000000000000..5b74decf0e4f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsDeleteByInvoiceSectionSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Deletes a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentDeleteByInvoiceSection.json + */ +async function billingRoleAssignmentDeleteByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.deleteByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentDeleteByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByBillingAccountSample.ts similarity index 52% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByBillingAccountSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByBillingAccountSample.ts index 57ee39d9b111..18e79133fee2 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByBillingAccountSample.ts @@ -10,24 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json + * @summary Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingAccount.json */ -async function billingAccountRoleAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentId}"; +async function billingRoleAssignmentGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.getByBillingAccount( billingAccountName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -billingAccountRoleAssignment().catch(console.error); +async function main() { + billingRoleAssignmentGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByBillingProfileSample.ts similarity index 62% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByBillingProfileSample.ts index 7934b433f796..9bd564bad462 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByBillingProfileSample.ts @@ -10,26 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignment.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByBillingProfile.json */ -async function billingProfileRoleAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; +async function billingRoleAssignmentGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.getByBillingProfile( billingAccountName, billingProfileName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -billingProfileRoleAssignment().catch(console.error); +async function main() { + billingRoleAssignmentGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByCustomerSample.ts new file mode 100644 index 000000000000..38125293f9c2 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a role assignment for the caller on a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByCustomer.json + */ +async function billingRoleAssignmentGetByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const billingRoleAssignmentName = + "30000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.getByCustomer( + billingAccountName, + billingProfileName, + customerName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentGetByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByDepartmentSample.ts new file mode 100644 index 000000000000..e1ae159003d9 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByDepartmentSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a role assignment for the caller on a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByDepartment.json + */ +async function billingRoleAssignmentGetByDepartment() { + const billingAccountName = "7898901"; + const departmentName = "225314"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.getByDepartment( + billingAccountName, + departmentName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentGetByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..65e5802f4e17 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByEnrollmentAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a role assignment for the caller on a enrollment Account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByEnrollmentAccount.json + */ +async function billingRoleAssignmentGetByEnrollmentAccount() { + const billingAccountName = "7898901"; + const enrollmentAccountName = "225314"; + const billingRoleAssignmentName = "9dfd08c2-62a3-4d47-85bd-1cdba1408402"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleAssignments.getByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + ); + console.log(result); +} + +async function main() { + billingRoleAssignmentGetByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByInvoiceSectionSample.ts similarity index 60% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByInvoiceSectionSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByInvoiceSectionSample.ts index 83a803616be1..d9fb09ae6ca6 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsGetByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsGetByInvoiceSectionSample.ts @@ -10,28 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignment.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentGetByInvoiceSection.json */ -async function invoiceSectionRoleAssignment() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; - const billingRoleAssignmentName = "{billingRoleAssignmentName}"; +async function billingRoleAssignmentGetByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const billingRoleAssignmentName = + "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.billingRoleAssignments.getByInvoiceSection( billingAccountName, billingProfileName, invoiceSectionName, - billingRoleAssignmentName + billingRoleAssignmentName, ); console.log(result); } -invoiceSectionRoleAssignment().catch(console.error); +async function main() { + billingRoleAssignmentGetByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByBillingAccountSample.ts similarity index 61% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByBillingAccountSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByBillingAccountSample.ts index b0dc5ff4cc65..38869fac24fc 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByBillingAccountSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json + * @summary Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingAccount.json */ -async function billingAccountRoleAssignmentList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingRoleAssignmentListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingRoleAssignments.listByBillingAccount( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -billingAccountRoleAssignmentList().catch(console.error); +async function main() { + billingRoleAssignmentListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByBillingProfileSample.ts similarity index 57% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByBillingProfileSample.ts index 43ff4f59546f..8b29f2474507 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * - * @summary Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json + * @summary Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByBillingProfile.json */ -async function billingProfileRoleAssignmentList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingRoleAssignmentListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingRoleAssignments.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingProfileRoleAssignmentList().catch(console.error); +async function main() { + billingRoleAssignmentListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByCustomerSample.ts new file mode 100644 index 000000000000..20008cc4835e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the role assignments for the caller on customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByCustomer.json + */ +async function billingRoleAssignmentListByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleAssignments.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleAssignmentListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByDepartmentSample.ts new file mode 100644 index 000000000000..cfacc23f2f9e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByDepartmentSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement. + * + * @summary Lists the role assignments for the caller on a department. The operation is supported for billing accounts of type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByDepartment.json + */ +async function billingRoleAssignmentListByDepartment() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const departmentName = "12345"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleAssignments.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleAssignmentListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..4ddcf093ed9c --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement. + * + * @summary Lists the role assignments for the caller on a enrollment account. The operation is supported for billing accounts of type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByEnrollmentAccount.json + */ +async function billingRoleAssignmentListByEnrollmentAccount() { + const billingAccountName = "6100092"; + const enrollmentAccountName = "123456"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleAssignments.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleAssignmentListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByInvoiceSectionSample.ts similarity index 65% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByInvoiceSectionSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByInvoiceSectionSample.ts index 90cb75cf10c2..2f565c8d3843 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleAssignmentsListByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleAssignmentListByInvoiceSection.json */ -async function invoiceSectionRoleAssignmentList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function billingRoleAssignmentListByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingRoleAssignments.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionRoleAssignmentList().catch(console.error); +async function main() { + billingRoleAssignmentListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingAccountSample.ts new file mode 100644 index 000000000000..40576790479a --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingAccountSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Lists the role assignments for the caller on a billing account while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingAccount.json + */ +async function resolveBillingRoleAssignmentByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginResolveByBillingAccountAndWait( + billingAccountName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingProfileSample.ts new file mode 100644 index 000000000000..ac33a1a8ad9c --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByBillingProfileSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on an billing profile while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Lists the role assignments for the caller on an billing profile while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByBillingProfile.json + */ +async function resolveBillingRoleAssignmentByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginResolveByBillingProfileAndWait( + billingAccountName, + billingProfileName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByCustomerSample.ts new file mode 100644 index 000000000000..591db02a6e34 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByCustomerSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the role assignments for the caller on a customer while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByCustomer.json + */ +async function resolveBillingRoleAssignmentByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "703ab484-dda2-4402-827b-a74513b61e2d"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginResolveByCustomerAndWait( + billingAccountName, + billingProfileName, + customerName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByInvoiceSectionSample.ts new file mode 100644 index 000000000000..c09ea8111e78 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleAssignmentsResolveByInvoiceSectionSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role assignments for the caller on an invoice section while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists the role assignments for the caller on an invoice section while fetching user info for each role assignment. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/resolveBillingRoleAssignmentByInvoiceSection.json + */ +async function resolveBillingRoleAssignmentByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2018-09-30"; + const billingProfileName = "BKM6-54VH-BG7-PGB"; + const invoiceSectionName = "xxxx-xxxx-xxx-xxx"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleAssignments.beginResolveByInvoiceSectionAndWait( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +async function main() { + resolveBillingRoleAssignmentByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByBillingAccountSample.ts new file mode 100644 index 000000000000..fa03e7a78964 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Gets the definition for a role on a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingAccount.json + */ +async function billingRoleDefinitionGetByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const roleDefinitionName = "50000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleDefinitionOperations.getByBillingAccount( + billingAccountName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByBillingProfileSample.ts similarity index 56% rename from sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByBillingProfileSample.ts index a56808a90437..135693bd47a2 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsGetByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByBillingProfileSample.ts @@ -10,26 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Gets the definition for a role on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinition.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByBillingProfile.json */ -async function billingProfileRoleDefinition() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const billingRoleDefinitionName = "{billingRoleDefinitionName}"; +async function billingRoleDefinitionGetByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const roleDefinitionName = "40000000-aaaa-bbbb-cccc-100000000000"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleDefinitions.getByBillingProfile( - billingAccountName, - billingProfileName, - billingRoleDefinitionName - ); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleDefinitionOperations.getByBillingProfile( + billingAccountName, + billingProfileName, + roleDefinitionName, + ); console.log(result); } -billingProfileRoleDefinition().catch(console.error); +async function main() { + billingRoleDefinitionGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByCustomerSample.ts new file mode 100644 index 000000000000..dc8a0d52f40f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByCustomerSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the definition for a role on a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets the definition for a role on a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByCustomer.json + */ +async function billingRoleDefinitionGetByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const roleDefinitionName = "30000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByCustomer( + billingAccountName, + billingProfileName, + customerName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByDepartmentSample.ts new file mode 100644 index 000000000000..a7607aebe8b6 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByDepartmentSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the definition for a role on a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets the definition for a role on a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByDepartment.json + */ +async function billingRoleDefinitionGetByDepartment() { + const billingAccountName = "123456"; + const departmentName = "7368531"; + const roleDefinitionName = "50000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingRoleDefinitionOperations.getByDepartment( + billingAccountName, + departmentName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..b0097ae3075f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the definition for a role on an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets the definition for a role on an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByEnrollmentAccount.json + */ +async function billingRoleDefinitionGetByEnrollmentAccount() { + const billingAccountName = "123456"; + const enrollmentAccountName = "4568789"; + const roleDefinitionName = "50000000-aaaa-bbbb-cccc-100000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleDefinitionOperations.getByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + roleDefinitionName, + ); + console.log(result); +} + +async function main() { + billingRoleDefinitionGetByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByInvoiceSectionSample.ts similarity index 52% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByInvoiceSectionSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByInvoiceSectionSample.ts index 0ea2696f3823..72c47b18fdba 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsGetByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionGetByInvoiceSectionSample.ts @@ -10,28 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinition.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionGetByInvoiceSection.json */ -async function invoiceSectionRoleDefinition() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; - const billingRoleDefinitionName = "{billingRoleDefinitionName}"; +async function billingRoleDefinitionGetByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const roleDefinitionName = "30000000-aaaa-bbbb-cccc-100000000000"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingRoleDefinitions.getByInvoiceSection( - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleDefinitionName - ); + const client = new BillingManagementClient(credential); + const result = + await client.billingRoleDefinitionOperations.getByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + roleDefinitionName, + ); console.log(result); } -invoiceSectionRoleDefinition().catch(console.error); +async function main() { + billingRoleDefinitionGetByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByBillingAccountSample.ts similarity index 53% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByBillingAccountSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByBillingAccountSample.ts index 7f81f11cd3ba..fe658e921155 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingRoleDefinitionsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByBillingAccountSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json + * @summary Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingAccount.json */ -async function billingAccountRoleDefinitionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; +async function billingRoleDefinitionListByBillingAccount() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingRoleDefinitions.listByBillingAccount( - billingAccountName + for await (let item of client.billingRoleDefinitionOperations.listByBillingAccount( + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -billingAccountRoleDefinitionsList().catch(console.error); +async function main() { + billingRoleDefinitionListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByBillingProfileSample.ts similarity index 52% rename from sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByBillingProfileSample.ts index 33ff2faa3864..14c624b4612d 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * This sample demonstrates how to Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * - * @summary Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json + * @summary Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByBillingProfile.json */ -async function billingProfileRoleDefinitionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function billingRoleDefinitionListByBillingProfile() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingRoleDefinitions.listByBillingProfile( + for await (let item of client.billingRoleDefinitionOperations.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -billingProfileRoleDefinitionsList().catch(console.error); +async function main() { + billingRoleDefinitionListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByCustomerSample.ts new file mode 100644 index 000000000000..da7e25018add --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByCustomerSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the role definitions for a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the role definitions for a customer. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByCustomer.json + */ +async function billingRoleDefinitionListByCustomer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleDefinitionOperations.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleDefinitionListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByDepartmentSample.ts new file mode 100644 index 000000000000..35bf36da212f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByDepartmentSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List the definition for a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary List the definition for a department. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByDepartment.json + */ +async function billingRoleDefinitionListByDepartment() { + const billingAccountName = "123456"; + const departmentName = "7368531"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleDefinitionOperations.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleDefinitionListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..5142398e98b3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List the definition for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary List the definition for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByEnrollmentAccount.json + */ +async function billingRoleDefinitionListByEnrollmentAccount() { + const billingAccountName = "123456"; + const enrollmentAccountName = "4568789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingRoleDefinitionOperations.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingRoleDefinitionListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByInvoiceSectionSample.ts similarity index 61% rename from sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsListByInvoiceSectionSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByInvoiceSectionSample.ts index 138b94613e25..f51a75c1efe6 100644 --- a/sdk/billing/arm-billing/samples-dev/billingRoleDefinitionsListByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingRoleDefinitionListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinitionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingRoleDefinitionListByInvoiceSection.json */ -async function invoiceSectionRoleDefinitionsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function billingRoleDefinitionListByInvoiceSection() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.billingRoleDefinitions.listByInvoiceSection( + for await (let item of client.billingRoleDefinitionOperations.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionRoleDefinitionsList().catch(console.error); +async function main() { + billingRoleDefinitionListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..0a953558368b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesCreateOrUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingSubscriptionAlias, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Creates or updates a billing subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * + * @summary Creates or updates a billing subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasCreateOrUpdate.json + */ +async function billingSubscriptionAliasCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const aliasName = "c356b7c7-7545-4686-b843-c1a49cf853fc"; + const parameters: BillingSubscriptionAlias = { + billingFrequency: "P1M", + displayName: "Subscription 3", + quantity: 1, + skuId: "0001", + termDuration: "P1M", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.billingSubscriptionsAliases.beginCreateOrUpdateAndWait( + billingAccountName, + aliasName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionAliasCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesGetSample.ts new file mode 100644 index 000000000000..2766819c14c8 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesGetSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * + * @summary Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasGet.json + */ +async function billingSubscriptionAliasGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const aliasName = "c356b7c7-7545-4686-b843-c1a49cf853fc"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptionsAliases.get( + billingAccountName, + aliasName, + ); + console.log(result); +} + +async function main() { + billingSubscriptionAliasGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesListByBillingAccountSample.ts new file mode 100644 index 000000000000..fc0a67ce769e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsAliasesListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the subscription aliases for a billing account. The operation is supported for seat based billing subscriptions. + * + * @summary Lists the subscription aliases for a billing account. The operation is supported for seat based billing subscriptions. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionAliasList.json + */ +async function billingSubscriptionAliasList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptionsAliases.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionAliasList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsCancelSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsCancelSample.ts new file mode 100644 index 000000000000..c7d6ce2d4153 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsCancelSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CancelSubscriptionRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. + * + * @summary Cancels a usage-based subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsCancel.json + */ +async function billingSubscriptionsCancel() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters: CancelSubscriptionRequest = { + cancellationReason: "Compromise", + customerId: "11111111-1111-1111-1111-111111111111", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginCancelAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsDeleteSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsDeleteSample.ts new file mode 100644 index 000000000000..cee2ff823efb --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Cancels a billing subscription. This operation is supported only for billing accounts of type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsDelete.json + */ +async function billingSubscriptionsDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginDeleteAndWait( + billingAccountName, + billingSubscriptionName, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsGetByBillingProfileSample.ts new file mode 100644 index 000000000000..ffaf46aa3bb4 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsGetByBillingProfileSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a subscription by its billing profile and ID. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionGetByBillingProfile.json + */ +async function billingSubscriptionGetByBillingProfile() { + const billingAccountName = "pcn.94077792"; + const billingProfileName = "6478903"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.getByBillingProfile( + billingAccountName, + billingProfileName, + billingSubscriptionName, + ); + console.log(result); +} + +async function main() { + billingSubscriptionGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsGetSample.ts similarity index 51% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsGetSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsGetSample.ts index 31ad688b8d7b..4943eddecc9f 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsGetSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsGetSample.ts @@ -10,20 +10,31 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * This sample demonstrates how to Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. * - * @summary Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json + * @summary Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsGet.json */ -async function billingSubscription() { - const subscriptionId = "{subscriptionId}"; - const billingAccountName = "{billingAccountName}"; +async function billingSubscriptionsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.billingSubscriptions.get(billingAccountName); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.get( + billingAccountName, + billingSubscriptionName, + ); console.log(result); } -billingSubscription().catch(console.error); +async function main() { + billingSubscriptionsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingAccountSample.ts new file mode 100644 index 000000000000..000f29be1827 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingAccountSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingSubscriptionsListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the subscriptions for a billing account. + * + * @summary Lists the subscriptions for a billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingAccount.json + */ +async function billingSubscriptionsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const includeDeleted = false; + const includeTenantSubscriptions = false; + const options: BillingSubscriptionsListByBillingAccountOptionalParams = { + includeDeleted, + includeTenantSubscriptions, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByBillingAccount( + billingAccountName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingProfileSample.ts new file mode 100644 index 000000000000..2b4654bda71e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByBillingProfileSample.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * + * @summary Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileEA.json + */ +async function billingSubscriptionsListByBillingProfileEa() { + const billingAccountName = "pcn.94077792"; + const billingProfileName = "6478903"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * + * @summary Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByBillingProfileMCA.json + */ +async function billingSubscriptionsListByBillingProfileMca() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionsListByBillingProfileEa(); + billingSubscriptionsListByBillingProfileMca(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByCustomerAtBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByCustomerAtBillingAccountSample.ts new file mode 100644 index 000000000000..7a131ffbf082 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByCustomerAtBillingAccountSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the subscriptions for a customer at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomerAtBillingAccount.json + */ +async function billingSubscriptionsListByCustomerAtBillingAccount() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const customerName = "Q7GV-UUVA-PJA-TGB"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByCustomerAtBillingAccount( + billingAccountName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionsListByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByCustomerSample.ts similarity index 67% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByCustomerSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByCustomerSample.ts index 1abbb37b30b1..f4926c0831d5 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByCustomerSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByCustomerSample.ts @@ -10,27 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByCustomer.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByCustomer.json */ async function billingSubscriptionsListByCustomer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const customerName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingSubscriptions.listByCustomer( billingAccountName, - customerName + billingProfileName, + customerName, )) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByCustomer().catch(console.error); +async function main() { + billingSubscriptionsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByEnrollmentAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByEnrollmentAccountSample.ts new file mode 100644 index 000000000000..21c2df37a518 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByEnrollmentAccountSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the subscriptions for an enrollment account. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByEnrollmentAccount.json + */ +async function billingSubscriptionsListByEnrollmentAccount() { + const billingAccountName = "6564892"; + const enrollmentAccountName = "172988"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.billingSubscriptions.listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + billingSubscriptionsListByEnrollmentAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByInvoiceSectionSample.ts similarity index 69% rename from sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByInvoiceSectionSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByInvoiceSectionSample.ts index 72fd7ecb4fa1..40cbce5287c5 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/billingSubscriptionsListByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByInvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsListByInvoiceSection.json */ async function billingSubscriptionsListByInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const invoiceSectionName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.billingSubscriptions.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -billingSubscriptionsListByInvoiceSection().catch(console.error); +async function main() { + billingSubscriptionsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMergeSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMergeSample.ts new file mode 100644 index 000000000000..968357285c2e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMergeSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingSubscriptionMergeRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Merges the billing subscription provided in the request with a target billing subscription. + * + * @summary Merges the billing subscription provided in the request with a target billing subscription. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsMerge.json + */ +async function billingSubscriptionsMerge() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters: BillingSubscriptionMergeRequest = { + quantity: 1, + targetBillingSubscriptionName: "22222222-2222-2222-2222-222222222222", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginMergeAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsMerge(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMoveSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMoveSample.ts new file mode 100644 index 000000000000..f6dfadef2312 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsMoveSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MoveBillingSubscriptionRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Moves charges for a subscription to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionMove.json + */ +async function billingSubscriptionMove() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveBillingSubscriptionRequest = { + destinationInvoiceSectionId: + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginMoveAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionMove(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsSplitSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsSplitSample.ts new file mode 100644 index 000000000000..f4d322fa4a03 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsSplitSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingSubscriptionSplitRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. + * + * @summary Splits a subscription into a new subscription with quantity less than current subscription quantity and not equal to 0. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsSplit.json + */ +async function billingSubscriptionsSplit() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters: BillingSubscriptionSplitRequest = { + billingFrequency: "P1M", + quantity: 1, + targetProductTypeId: "XYZ56789", + targetSkuId: "0001", + termDuration: "P1M", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginSplitAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsSplit(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsUpdateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsUpdateSample.ts new file mode 100644 index 000000000000..654632050a23 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingSubscriptionPatch, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates the properties of a billing subscription. + * + * @summary Updates the properties of a billing subscription. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionsUpdate.json + */ +async function billingSubscriptionsUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingSubscriptionName = "11111111-1111-1111-1111-111111111111"; + const parameters: BillingSubscriptionPatch = { + consumptionCostCenter: "ABC1234", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.beginUpdateAndWait( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsValidateMoveEligibilitySample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsValidateMoveEligibilitySample.ts new file mode 100644 index 000000000000..3d714036f537 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/billingSubscriptionsValidateMoveEligibilitySample.ts @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MoveBillingSubscriptionRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveFailure.json + */ +async function billingSubscriptionValidateMoveFailure() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveBillingSubscriptionRequest = { + destinationInvoiceSectionId: + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.validateMoveEligibility( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if charges for a subscription can be moved to a new invoice section. This operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/billingSubscriptionValidateMoveSuccess.json + */ +async function billingSubscriptionValidateMoveSuccess() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingSubscriptionName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveBillingSubscriptionRequest = { + destinationInvoiceSectionId: + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.billingSubscriptions.validateMoveEligibility( + billingAccountName, + billingSubscriptionName, + parameters, + ); + console.log(result); +} + +async function main() { + billingSubscriptionValidateMoveFailure(); + billingSubscriptionValidateMoveSuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/customersGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/customersGetByBillingAccountSample.ts new file mode 100644 index 000000000000..7011606342f1 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/customersGetByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a customer by its ID at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a customer by its ID at billing account level. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGetByBillingAccount.json + */ +async function customersGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.customers.getByBillingAccount( + billingAccountName, + customerName, + ); + console.log(result); +} + +async function main() { + customersGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/customersGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/customersGetSample.ts new file mode 100644 index 000000000000..a8a6457d1969 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/customersGetSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersGet.json + */ +async function customersGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.customers.get( + billingAccountName, + billingProfileName, + customerName, + ); + console.log(result); +} + +async function main() { + customersGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/customersListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/customersListByBillingAccountSample.ts new file mode 100644 index 000000000000..f786b59ac088 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/customersListByBillingAccountSample.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomersListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingAccount.json + */ +async function customersListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.customers.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +/** + * This sample demonstrates how to Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the customers that are billed to a billing account. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingAccountWithExpand.json + */ +async function customersListByBillingAccountWithExpand() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const expand = "enabledAzurePlans,resellers"; + const options: CustomersListByBillingAccountOptionalParams = { expand }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.customers.listByBillingAccount( + billingAccountName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + customersListByBillingAccount(); + customersListByBillingAccountWithExpand(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/customersListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/customersListByBillingProfileSample.ts similarity index 71% rename from sdk/billing/arm-billing/samples/v4/typescript/src/customersListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/customersListByBillingProfileSample.ts index 1aad2d13f556..dd6226261973 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/customersListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/customersListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/customersListByBillingProfile.json */ async function customersListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.customers.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -customersListByBillingProfile().catch(console.error); +async function main() { + customersListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/departmentsGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/departmentsGetSample.ts new file mode 100644 index 000000000000..5bfd9e7863c0 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/departmentsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a department by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a department by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentGet.json + */ +async function departmentGet() { + const billingAccountName = "456598"; + const departmentName = "164821"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.departments.get( + billingAccountName, + departmentName, + ); + console.log(result); +} + +async function main() { + departmentGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/departmentsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/departmentsListByBillingAccountSample.ts new file mode 100644 index 000000000000..7e762d2b4371 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/departmentsListByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/departmentsListByBillingAccount.json + */ +async function departmentsListByBillingAccount() { + const billingAccountName = "456598"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.departments.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + departmentsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetByDepartmentSample.ts new file mode 100644 index 000000000000..ec08f7a84c72 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetByDepartmentSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets an enrollment account by department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets an enrollment account by department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountByDepartment.json + */ +async function enrollmentAccountByDepartment() { + const billingAccountName = "6564892"; + const departmentName = "164821"; + const enrollmentAccountName = "257698"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.enrollmentAccounts.getByDepartment( + billingAccountName, + departmentName, + enrollmentAccountName, + ); + console.log(result); +} + +async function main() { + enrollmentAccountByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetSample.ts new file mode 100644 index 000000000000..2ec371c37a7f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets an enrollment account by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets an enrollment account by ID. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountGet.json + */ +async function enrollmentAccountGet() { + const billingAccountName = "6564892"; + const enrollmentAccountName = "257698"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.enrollmentAccounts.get( + billingAccountName, + enrollmentAccountName, + ); + console.log(result); +} + +async function main() { + enrollmentAccountGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByBillingAccountSample.ts new file mode 100644 index 000000000000..856e235a6b7e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the enrollment accounts for a billing account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the enrollment accounts for a billing account. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByBillingAccount.json + */ +async function enrollmentAccountsListByBillingAccount() { + const billingAccountName = "6564892"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.enrollmentAccounts.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + enrollmentAccountsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByDepartmentSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByDepartmentSample.ts new file mode 100644 index 000000000000..fc6655fb690c --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/enrollmentAccountsListByDepartmentSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the enrollment accounts for a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * + * @summary Lists the enrollment accounts for a department. The operation is supported only for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/enrollmentAccountsListByDepartment.json + */ +async function enrollmentAccountsListByDepartment() { + const billingAccountName = "6564892"; + const departmentName = "164821"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.enrollmentAccounts.listByDepartment( + billingAccountName, + departmentName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + enrollmentAccountsListByDepartment(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsCreateOrUpdateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsCreateOrUpdateSample.ts similarity index 61% rename from sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsCreateOrUpdateSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsCreateOrUpdateSample.ts index 3327dd820cc2..d653bb560d03 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsCreateOrUpdateSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsCreateOrUpdateSample.ts @@ -10,31 +10,40 @@ // Licensed under the MIT License. import { InvoiceSection, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsCreateOrUpdate.json */ -async function putInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function invoiceSectionsCreateOrUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "invoice-section-1"; const parameters: InvoiceSection = { - displayName: "invoiceSection1", - labels: { costCategory: "Support", pcCode: "A123456" } + properties: { + displayName: "Invoice Section 1", + tags: { costCategory: "Support", pcCode: "A123456" }, + }, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.invoiceSections.beginCreateOrUpdateAndWait( billingAccountName, billingProfileName, invoiceSectionName, - parameters + parameters, ); console.log(result); } -putInvoiceSection().catch(console.error); +async function main() { + invoiceSectionsCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsDeleteSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsDeleteSample.ts new file mode 100644 index 000000000000..269822fd4345 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Deletes an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsDelete.json + */ +async function invoiceSectionsDelete() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoiceSections.beginDeleteAndWait( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +async function main() { + invoiceSectionsDelete(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsGetSample.ts similarity index 65% rename from sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsGetSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsGetSample.ts index bb44c01f8bfa..0a765bf9df24 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsGetSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsGetSample.ts @@ -10,26 +10,33 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsGet.json */ -async function invoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; +async function invoiceSectionsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.invoiceSections.get( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, ); console.log(result); } -invoiceSection().catch(console.error); +async function main() { + invoiceSectionsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsListByBillingProfileSample.ts similarity index 60% rename from sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsListByBillingProfileSample.ts index cafa192b3b8e..53dd633dda92 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/invoiceSectionsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsListByBillingProfileSample.ts @@ -8,29 +8,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { BillingManagementClient } from "@azure/arm-billing"; +import { + InvoiceSectionsListByBillingProfileOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsListByBillingProfile.json */ async function invoiceSectionsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const includeDeleted = true; + const options: InvoiceSectionsListByBillingProfileOptionalParams = { + includeDeleted, + }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.invoiceSections.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, + options, )) { resArray.push(item); } console.log(resArray); } -invoiceSectionsListByBillingProfile().catch(console.error); +async function main() { + invoiceSectionsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsValidateDeleteEligibilitySample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsValidateDeleteEligibilitySample.ts new file mode 100644 index 000000000000..67ec027455ec --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoiceSectionsValidateDeleteEligibilitySample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilityFailure.json + */ +async function invoiceSectionsValidateDeleteEligibilityFailure() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoiceSections.validateDeleteEligibility( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Validates if the invoice section can be deleted. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoiceSectionsValidateDeleteEligibilitySuccess.json + */ +async function invoiceSectionsValidateDeleteEligibilitySuccess() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoiceSections.validateDeleteEligibility( + billingAccountName, + billingProfileName, + invoiceSectionName, + ); + console.log(result); +} + +async function main() { + invoiceSectionsValidateDeleteEligibilityFailure(); + invoiceSectionsValidateDeleteEligibilitySuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesAmendSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesAmendSample.ts new file mode 100644 index 000000000000..6f4c95ae39d3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesAmendSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesAmend.json + */ +async function invoicesAmend() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.beginAmendAndWait( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + invoicesAmend(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingAccountSample.ts new file mode 100644 index 000000000000..a14bc79c0ecb --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingAccountSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InvoicesDownloadByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * + * @summary Gets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingAccount.json + */ +async function invoicesDownloadByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const documentName = "12345678"; + const options: InvoicesDownloadByBillingAccountOptionalParams = { + documentName, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.beginDownloadByBillingAccountAndWait( + billingAccountName, + invoiceName, + options, + ); + console.log(result); +} + +async function main() { + invoicesDownloadByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingSubscriptionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingSubscriptionSample.ts new file mode 100644 index 000000000000..50a16c03739e --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadByBillingSubscriptionSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InvoicesDownloadByBillingSubscriptionOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadByBillingSubscription.json + */ +async function invoicesDownloadByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const invoiceName = "E123456789"; + const documentName = "12345678"; + const options: InvoicesDownloadByBillingSubscriptionOptionalParams = { + documentName, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = + await client.invoices.beginDownloadByBillingSubscriptionAndWait( + invoiceName, + options, + ); + console.log(result); +} + +async function main() { + invoicesDownloadByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingAccountSample.ts new file mode 100644 index 000000000000..4f6db811d352 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingAccountSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DocumentDownloadRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingAccount.json + */ +async function invoicesDownloadDocumentsByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const parameters: DocumentDownloadRequest[] = [ + { documentName: "12345678", invoiceName: "G123456789" }, + { documentName: "12345678", invoiceName: "G987654321" }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.invoices.beginDownloadDocumentsByBillingAccountAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + invoicesDownloadDocumentsByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingSubscriptionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingSubscriptionSample.ts new file mode 100644 index 000000000000..9212dd3e78ad --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadDocumentsByBillingSubscriptionSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DocumentDownloadRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadDocumentsByBillingSubscription.json + */ +async function invoicesDownloadDocumentsByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const parameters: DocumentDownloadRequest[] = [ + { documentName: "12345678", invoiceName: "E123456789" }, + { documentName: "12345678", invoiceName: "E987654321" }, + ]; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = + await client.invoices.beginDownloadDocumentsByBillingSubscriptionAndWait( + parameters, + ); + console.log(result); +} + +async function main() { + invoicesDownloadDocumentsByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadSummaryByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadSummaryByBillingAccountSample.ts new file mode 100644 index 000000000000..5ec5766ceb07 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesDownloadSummaryByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesDownloadSummaryByBillingAccount.json + */ +async function invoicesDownloadSummaryByBillingAccount() { + const billingAccountName = "123456789"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.invoices.beginDownloadSummaryByBillingAccountAndWait( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + invoicesDownloadSummaryByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingAccountSample.ts new file mode 100644 index 000000000000..02cd7af9d246 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets an invoice by billing account name and ID. The operation is supported for all billing account types. + * + * @summary Gets an invoice by billing account name and ID. The operation is supported for all billing account types. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingAccount.json + */ +async function invoicesGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.invoices.getByBillingAccount( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + invoicesGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingSubscriptionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingSubscriptionSample.ts new file mode 100644 index 000000000000..0efc6d8cea72 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetByBillingSubscriptionSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGetByBillingSubscription.json + */ +async function invoicesGetByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const invoiceName = "E123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.invoices.getByBillingSubscription(invoiceName); + console.log(result); +} + +async function main() { + invoicesGetByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/invoicesGetByIdSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetSample.ts similarity index 71% rename from sdk/billing/arm-billing/samples-dev/invoicesGetByIdSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetSample.ts index 3279cc1d55d6..8a843e70a749 100644 --- a/sdk/billing/arm-billing/samples-dev/invoicesGetByIdSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesGetSample.ts @@ -10,20 +10,26 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * * @summary Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceById.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesGet.json */ -async function invoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const invoiceName = "{invoiceName}"; +async function invoicesGet() { + const invoiceName = "G123456789"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.invoices.getById(invoiceName); + const client = new BillingManagementClient(credential); + const result = await client.invoices.get(invoiceName); console.log(result); } -invoice().catch(console.error); +async function main() { + invoicesGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingAccountSample.ts new file mode 100644 index 000000000000..89705b58b9c3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingAccountSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InvoicesListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the invoices for a billing account for a given start date and end date. The operation is supported for all billing account types. + * + * @summary Lists the invoices for a billing account for a given start date and end date. The operation is supported for all billing account types. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingAccount.json + */ +async function invoicesListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const periodStartDate = new Date("2023-01-01"); + const periodEndDate = new Date("2023-06-30"); + const options: InvoicesListByBillingAccountOptionalParams = { + periodStartDate, + periodEndDate, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.invoices.listByBillingAccount( + billingAccountName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + invoicesListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingProfileSample.ts new file mode 100644 index 000000000000..55cf14bd8665 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingProfileSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InvoicesListByBillingProfileOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Lists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingProfile.json + */ +async function invoicesListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const periodStartDate = new Date("2023-01-01"); + const periodEndDate = new Date("2023-06-30"); + const options: InvoicesListByBillingProfileOptionalParams = { + periodStartDate, + periodEndDate, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.invoices.listByBillingProfile( + billingAccountName, + billingProfileName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + invoicesListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingSubscriptionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingSubscriptionSample.ts new file mode 100644 index 000000000000..018cb26e46fa --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/invoicesListByBillingSubscriptionSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InvoicesListByBillingSubscriptionOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * + * @summary Lists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/invoicesListByBillingSubscription.json + */ +async function invoicesListByBillingSubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "11111111-1111-1111-1111-111111111111"; + const periodStartDate = new Date("2023-01-01"); + const periodEndDate = new Date("2023-06-30"); + const options: InvoicesListByBillingSubscriptionOptionalParams = { + periodStartDate, + periodEndDate, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.invoices.listByBillingSubscription(options)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + invoicesListByBillingSubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/enrollmentAccountsListSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/operationsListSample.ts similarity index 57% rename from sdk/billing/arm-billing/samples/v4/typescript/src/enrollmentAccountsListSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/operationsListSample.ts index 57fce163a92c..c790edee1579 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/enrollmentAccountsListSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/operationsListSample.ts @@ -10,22 +10,31 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the enrollment accounts the caller has access to. + * This sample demonstrates how to List of operations supported by provider. * - * @summary Lists the enrollment accounts the caller has access to. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json + * @summary List of operations supported by provider. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/operationsList.json */ -async function enrollmentAccountsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; +async function operationsList() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new BillingManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.enrollmentAccounts.list()) { + for await (let item of client.operations.list()) { resArray.push(item); } console.log(resArray); } -enrollmentAccountsList().catch(console.error); +async function main() { + operationsList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersCancelSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersCancelSample.ts new file mode 100644 index 000000000000..e7d14d81fff0 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersCancelSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersCancel.json + */ +async function partnerTransferCancel() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.partnerTransfers.cancel( + billingAccountName, + billingProfileName, + customerName, + transferName, + ); + console.log(result); +} + +async function main() { + partnerTransferCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersGetSample.ts new file mode 100644 index 000000000000..d4eafd19627f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersGet.json + */ +async function partnerTransferGet() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.partnerTransfers.get( + billingAccountName, + billingProfileName, + customerName, + transferName, + ); + console.log(result); +} + +async function main() { + partnerTransferGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersInitiateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersInitiateSample.ts new file mode 100644 index 000000000000..0e7a9600b2c3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersInitiateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PartnerInitiateTransferRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Sends a request to a user in a customer's billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Sends a request to a user in a customer's billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersInitiate.json + */ +async function initiatePartnerTransfer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const transferName = "aabb123"; + const parameters: PartnerInitiateTransferRequest = { + recipientEmailId: "user@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.partnerTransfers.initiate( + billingAccountName, + billingProfileName, + customerName, + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + initiatePartnerTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersListSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersListSample.ts new file mode 100644 index 000000000000..1d57eb44299c --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/partnerTransfersListSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the transfer requests sent to a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the transfer requests sent to a customer. The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/partnerTransfersList.json + */ +async function partnerTransfersList() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.partnerTransfers.list( + billingAccountName, + billingProfileName, + customerName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + partnerTransfersList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsDeleteByUserSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsDeleteByUserSample.ts new file mode 100644 index 000000000000..4cc97666db08 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsDeleteByUserSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Deletes a payment method owned by the caller. + * + * @summary Deletes a payment method owned by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsDeleteByUser.json + */ +async function deletePaymentMethodOwnedByUser() { + const paymentMethodName = "ABCDABCDABC0"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.deleteByUser(paymentMethodName); + console.log(result); +} + +async function main() { + deletePaymentMethodOwnedByUser(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingAccountSample.ts new file mode 100644 index 000000000000..0575dff89d64 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingAccount.json + */ +async function paymentMethodGetAtBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const paymentMethodName = "21dd9edc-af71-4d62-80ce-37151d475326"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.getByBillingAccount( + billingAccountName, + paymentMethodName, + ); + console.log(result); +} + +async function main() { + paymentMethodGetAtBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingProfileSample.ts new file mode 100644 index 000000000000..c8aadec228f9 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByBillingProfileSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByBillingProfile.json + */ +async function paymentMethodsGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const billingProfileName = "ABC1-A1CD-AB1-BP1"; + const paymentMethodName = "ABCDABCDABC0"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.getByBillingProfile( + billingAccountName, + billingProfileName, + paymentMethodName, + ); + console.log(result); +} + +async function main() { + paymentMethodsGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByUserSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByUserSample.ts new file mode 100644 index 000000000000..bf4cb0cdecf7 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsGetByUserSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a payment method owned by the caller. + * + * @summary Gets a payment method owned by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsGetByUser.json + */ +async function getPaymentMethodOwnedByUser() { + const paymentMethodName = "ABCDABCDABC0"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.paymentMethods.getByUser(paymentMethodName); + console.log(result); +} + +async function main() { + getPaymentMethodOwnedByUser(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingAccountSample.ts new file mode 100644 index 000000000000..5d1ca643e0c8 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the payment methods available for a billing account. Along with the payment methods owned by the caller, these payment methods can be attached to a billing profile to make payments. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists the payment methods available for a billing account. Along with the payment methods owned by the caller, these payment methods can be attached to a billing profile to make payments. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingAccount.json + */ +async function paymentMethodsListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.paymentMethods.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + paymentMethodsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingProfileSample.ts new file mode 100644 index 000000000000..9f35135d7b8f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByBillingProfileSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists payment methods attached to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists payment methods attached to a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByBillingProfile.json + */ +async function paymentMethodsListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31"; + const billingProfileName = "ABC1-A1CD-AB1-BP1"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.paymentMethods.listByBillingProfile( + billingAccountName, + billingProfileName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + paymentMethodsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByUserSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByUserSample.ts new file mode 100644 index 000000000000..e82bc7b4082d --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/paymentMethodsListByUserSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the payment methods owned by the caller. + * + * @summary Lists the payment methods owned by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/paymentMethodsListByUser.json + */ +async function listPaymentMethodOwnedByUser() { + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.paymentMethods.listByUser()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + listPaymentMethodOwnedByUser(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..8b71e24a4ebb --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingAccountSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingAccountPolicy, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update the policies for a billing account of Enterprise Agreement type. + * + * @summary Update the policies for a billing account of Enterprise Agreement type. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingAccount.json + */ +async function policiesPutByBillingAccount() { + const billingAccountName = "1234567"; + const parameters: BillingAccountPolicy = { + properties: { + enterpriseAgreementPolicies: { + authenticationType: "OrganizationalAccountOnly", + }, + marketplacePurchases: "AllAllowed", + reservationPurchases: "Allowed", + savingsPlanPurchases: "NotAllowed", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.policies.beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName, + parameters, + ); + console.log(result); +} + +async function main() { + policiesPutByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingProfileSample.ts new file mode 100644 index 000000000000..27fb777d0fd8 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByBillingProfileSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BillingProfilePolicy, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByBillingProfile.json + */ +async function policiesPutByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const parameters: BillingProfilePolicy = { + properties: { + invoiceSectionLabelManagement: "Allowed", + marketplacePurchases: "AllAllowed", + reservationPurchases: "Allowed", + savingsPlanPurchases: "Allowed", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.policies.beginCreateOrUpdateByBillingProfileAndWait( + billingAccountName, + billingProfileName, + parameters, + ); + console.log(result); +} + +async function main() { + policiesPutByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts new file mode 100644 index 000000000000..6908e5bfad4b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByCustomerAtBillingAccountSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CustomerPolicy, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomerAtBillingAccount.json + */ +async function policiesPutByCustomerAtBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const parameters: CustomerPolicy = { properties: { viewCharges: "Allowed" } }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.policies.beginCreateOrUpdateByCustomerAtBillingAccountAndWait( + billingAccountName, + customerName, + parameters, + ); + console.log(result); +} + +async function main() { + policiesPutByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/policiesUpdateCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByCustomerSample.ts similarity index 56% rename from sdk/billing/arm-billing/samples/v4/typescript/src/policiesUpdateCustomerSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByCustomerSample.ts index a58aa66243af..c6d3be5eca24 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/policiesUpdateCustomerSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesCreateOrUpdateByCustomerSample.ts @@ -10,26 +10,35 @@ // Licensed under the MIT License. import { CustomerPolicy, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateCustomerPolicy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesPutByCustomer.json */ -async function updateCustomer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; - const parameters: CustomerPolicy = { viewCharges: "NotAllowed" }; +async function policiesPutByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const parameters: CustomerPolicy = { properties: { viewCharges: "Allowed" } }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.policies.updateCustomer( + const client = new BillingManagementClient(credential); + const result = await client.policies.beginCreateOrUpdateByCustomerAndWait( billingAccountName, + billingProfileName, customerName, - parameters + parameters, ); console.log(result); } -updateCustomer().catch(console.error); +async function main() { + policiesPutByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByBillingAccountSample.ts new file mode 100644 index 000000000000..2c2f5e573653 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByBillingAccountSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the policies for a billing account of Enterprise Agreement type. + * + * @summary Get the policies for a billing account of Enterprise Agreement type. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingAccount.json + */ +async function policiesGetByBillingAccount() { + const billingAccountName = "1234567"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.policies.getByBillingAccount(billingAccountName); + console.log(result); +} + +async function main() { + policiesGetByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/policiesGetByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByBillingProfileSample.ts similarity index 66% rename from sdk/billing/arm-billing/samples/v4/typescript/src/policiesGetByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByBillingProfileSample.ts index add4d27e7c67..14a0df488a9e 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/policiesGetByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByBillingProfileSample.ts @@ -10,24 +10,31 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Policy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByBillingProfile.json */ -async function policyByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function policiesGetByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.policies.getByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, ); console.log(result); } -policyByBillingProfile().catch(console.error); +async function main() { + policiesGetByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByCustomerAtBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByCustomerAtBillingAccountSample.ts new file mode 100644 index 000000000000..64847b524eba --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByCustomerAtBillingAccountSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * + * @summary Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomerAtBillingAccount.json + */ +async function policiesGetByCustomerAtBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.policies.getByCustomerAtBillingAccount( + billingAccountName, + customerName, + ); + console.log(result); +} + +async function main() { + policiesGetByCustomerAtBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/policiesGetByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByCustomerSample.ts similarity index 61% rename from sdk/billing/arm-billing/samples/v4/typescript/src/policiesGetByCustomerSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByCustomerSample.ts index 401b469eb6e8..6f4e264e10b2 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/policiesGetByCustomerSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetByCustomerSample.ts @@ -10,24 +10,35 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPolicy.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetByCustomer.json */ -async function policyByCustomer() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; +async function policiesGetByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "11111111-1111-1111-1111-111111111111"; + const policyName = "default"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.policies.getByCustomer( billingAccountName, - customerName + billingProfileName, + customerName, + policyName, ); console.log(result); } -policyByCustomer().catch(console.error); +async function main() { + policiesGetByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetBySubscriptionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetBySubscriptionSample.ts new file mode 100644 index 000000000000..0435f633437b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/policiesGetBySubscriptionSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. + * + * @summary Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/policiesGetBySubscription.json + */ +async function policiesGetBySubscription() { + const subscriptionId = + process.env["BILLING_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential, subscriptionId); + const result = await client.policies.getBySubscription(); + console.log(result); +} + +async function main() { + policiesGetBySubscription(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/productsGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/productsGetSample.ts similarity index 67% rename from sdk/billing/arm-billing/samples/v4/typescript/src/productsGetSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/productsGetSample.ts index 6e6e8e6515e9..6c37643450b0 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/productsGetSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/productsGetSample.ts @@ -10,21 +10,28 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Product.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsGet.json */ -async function product() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; +async function productsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const productName = "11111111-1111-1111-1111-111111111111"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.products.get(billingAccountName, productName); console.log(result); } -product().catch(console.error); +async function main() { + productsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByBillingAccountSample.ts similarity index 75% rename from sdk/billing/arm-billing/samples/v4/typescript/src/productsListByBillingAccountSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/productsListByBillingAccountSample.ts index 9ab120752cca..acfb1f1c54ff 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByBillingAccountSample.ts @@ -10,25 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. * * @summary Lists the products for a billing account. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingAccount.json */ async function productsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByBillingAccount( - billingAccountName + billingAccountName, )) { resArray.push(item); } console.log(resArray); } -productsListByBillingAccount().catch(console.error); +async function main() { + productsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByBillingProfileSample.ts similarity index 73% rename from sdk/billing/arm-billing/samples/v4/typescript/src/productsListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/productsListByBillingProfileSample.ts index f7a611730f1a..0bdd38a14d85 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByBillingProfileSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. * * @summary Lists the products for a billing profile. These don't include products billed based on usage. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByBillingProfile.json */ async function productsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByBillingProfile( billingAccountName, - billingProfileName + billingProfileName, )) { resArray.push(item); } console.log(resArray); } -productsListByBillingProfile().catch(console.error); +async function main() { + productsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByCustomerSample.ts similarity index 70% rename from sdk/billing/arm-billing/samples/v4/typescript/src/productsListByCustomerSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/productsListByCustomerSample.ts index 8563cc1696ee..7322e339dfdc 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByCustomerSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByCustomerSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. * * @summary Lists the products for a customer. These don't include products billed based on usage.The operation is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByCustomer.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByCustomer.json */ -async function productsListByInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const customerName = "{customerName}"; +async function productsListByCustomer() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const customerName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByCustomer( billingAccountName, - customerName + customerName, )) { resArray.push(item); } console.log(resArray); } -productsListByInvoiceSection().catch(console.error); +async function main() { + productsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByInvoiceSectionSample.ts similarity index 70% rename from sdk/billing/arm-billing/samples/v4/typescript/src/productsListByInvoiceSectionSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/productsListByInvoiceSectionSample.ts index 4dbfdc8ffdeb..7ed2b73a3e76 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/productsListByInvoiceSectionSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/productsListByInvoiceSectionSample.ts @@ -10,29 +10,36 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Lists the products for an invoice section. These don't include products billed based on usage. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByInvoiceSection.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsListByInvoiceSection.json */ async function productsListByInvoiceSection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const invoiceSectionName = "{invoiceSectionName}"; + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const billingProfileName = "ea36e548-1505-41db-bebc-46fff3d37998"; + const invoiceSectionName = "Q7GV-UUVA-PJA-TGB"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.products.listByInvoiceSection( billingAccountName, billingProfileName, - invoiceSectionName + invoiceSectionName, )) { resArray.push(item); } console.log(resArray); } -productsListByInvoiceSection().catch(console.error); +async function main() { + productsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/productsMoveSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/productsMoveSample.ts similarity index 60% rename from sdk/billing/arm-billing/samples/v4/typescript/src/productsMoveSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/productsMoveSample.ts index a1077a70b099..fb37db5168d8 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/productsMoveSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/productsMoveSample.ts @@ -9,33 +9,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - TransferProductRequestProperties, - BillingManagementClient + MoveProductRequest, + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing profile as the existing invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveProduct.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productMove.json */ -async function moveProduct() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; - const parameters: TransferProductRequestProperties = { +async function productMove() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const productName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveProductRequest = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.products.move( + const client = new BillingManagementClient(credential); + const result = await client.products.beginMoveAndWait( billingAccountName, productName, - parameters + parameters, ); console.log(result); } -moveProduct().catch(console.error); +async function main() { + productMove(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/productsUpdateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/productsUpdateSample.ts similarity index 61% rename from sdk/billing/arm-billing/samples/v4/typescript/src/productsUpdateSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/productsUpdateSample.ts index 392b745b6936..6100ab1618ee 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/productsUpdateSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/productsUpdateSample.ts @@ -8,28 +8,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { Product, BillingManagementClient } from "@azure/arm-billing"; +import { ProductPatch, BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateProduct.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productsUpdate.json */ -async function updateBillingProperty() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; - const parameters: Product = { autoRenew: "Off" }; +async function productsUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const productName = "11111111-1111-1111-1111-111111111111"; + const parameters: ProductPatch = { properties: { autoRenew: "On" } }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const result = await client.products.update( billingAccountName, productName, - parameters + parameters, ); console.log(result); } -updateBillingProperty().catch(console.error); +async function main() { + productsUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples-dev/productsValidateMoveSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/productsValidateMoveEligibilitySample.ts similarity index 54% rename from sdk/billing/arm-billing/samples-dev/productsValidateMoveSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/productsValidateMoveEligibilitySample.ts index a6730ebf35e0..0bf5bf566280 100644 --- a/sdk/billing/arm-billing/samples-dev/productsValidateMoveSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/productsValidateMoveEligibilitySample.ts @@ -9,59 +9,65 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - TransferProductRequestProperties, - BillingManagementClient + MoveProductRequest, + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveFailure.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveFailure.json */ -async function subscriptionMoveValidateFailure() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; - const parameters: TransferProductRequestProperties = { +async function productValidateMoveFailure() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const productName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveProductRequest = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.products.validateMove( + const client = new BillingManagementClient(credential); + const result = await client.products.validateMoveEligibility( billingAccountName, productName, - parameters + parameters, ); console.log(result); } -subscriptionMoveValidateFailure().catch(console.error); - /** * This sample demonstrates how to Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. * * @summary Validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveSuccess.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/productValidateMoveSuccess.json */ -async function subscriptionMoveValidateSuccess() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const productName = "{productName}"; - const parameters: TransferProductRequestProperties = { +async function productValidateMoveSuccess() { + const billingAccountName = + "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31"; + const productName = "6b96d3f2-9008-4a9d-912f-f87744185aa3"; + const parameters: MoveProductRequest = { destinationInvoiceSectionId: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" + "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB", }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); - const result = await client.products.validateMove( + const client = new BillingManagementClient(credential); + const result = await client.products.validateMoveEligibility( billingAccountName, productName, - parameters + parameters, ); console.log(result); } -subscriptionMoveValidateSuccess().catch(console.error); +async function main() { + productValidateMoveFailure(); + productValidateMoveSuccess(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersAcceptSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersAcceptSample.ts new file mode 100644 index 000000000000..c5365f989b58 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersAcceptSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AcceptTransferRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Accepts a transfer request. + * + * @summary Accepts a transfer request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersAccept.json + */ +async function acceptTransfer() { + const transferName = "aabb123"; + const parameters: AcceptTransferRequest = { + productDetails: [ + { productId: "subscriptionId", productType: "AzureSubscription" }, + { productId: "reservedInstanceId", productType: "AzureReservation" }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.accept( + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + acceptTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersDeclineSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersDeclineSample.ts new file mode 100644 index 000000000000..a6d3113a1c15 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersDeclineSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Declines a transfer request. + * + * @summary Declines a transfer request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersDecline.json + */ +async function declineTransfer() { + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.decline(transferName); + console.log(result); +} + +async function main() { + declineTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersGetSample.ts new file mode 100644 index 000000000000..82fa1021eeb0 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a transfer request by ID. The caller must be the recipient of the transfer request. + * + * @summary Gets a transfer request by ID. The caller must be the recipient of the transfer request. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersGet.json + */ +async function recipientTransferGet() { + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.get(transferName); + console.log(result); +} + +async function main() { + recipientTransferGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersListSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersListSample.ts new file mode 100644 index 000000000000..ab50513a59aa --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersListSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the transfer requests received by the caller. + * + * @summary Lists the transfer requests received by the caller. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersList.json + */ +async function recipientTransfersList() { + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.recipientTransfers.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + recipientTransfersList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersValidateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersValidateSample.ts new file mode 100644 index 000000000000..d6bbefd90a7a --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/recipientTransfersValidateSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AcceptTransferRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validates if a subscription or a reservation can be transferred. Use this operation to validate your subscriptions or reservation before using the accept transfer operation. + * + * @summary Validates if a subscription or a reservation can be transferred. Use this operation to validate your subscriptions or reservation before using the accept transfer operation. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/recipientTransfersValidate.json + */ +async function validateTransfer() { + const transferName = "aabb123"; + const parameters: AcceptTransferRequest = { + productDetails: [ + { productId: "subscriptionId", productType: "AzureSubscription" }, + { productId: "reservedInstanceId", productType: "AzureReservation" }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.recipientTransfers.validate( + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + validateTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersGetByBillingAccountSample.ts new file mode 100644 index 000000000000..4634d18fcf44 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersGetByBillingAccountSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get the details of the ReservationOrder in the billing account. + * + * @summary Get the details of the ReservationOrder in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccount.json + */ +async function reservationOrderGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservationOrders.getByBillingAccount( + billingAccountName, + reservationOrderId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get the details of the ReservationOrder in the billing account. + * + * @summary Get the details of the ReservationOrder in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrderGetByBillingAccountWithExpandPlanInformation.json + */ +async function reservationOrderGetByBillingAccountWithExpandPlanInformation() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservationOrders.getByBillingAccount( + billingAccountName, + reservationOrderId, + ); + console.log(result); +} + +async function main() { + reservationOrderGetByBillingAccount(); + reservationOrderGetByBillingAccountWithExpandPlanInformation(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersListByBillingAccountSample.ts new file mode 100644 index 000000000000..8cbb4870936b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationOrdersListByBillingAccountSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List all the `ReservationOrders in the billing account. + * + * @summary List all the `ReservationOrders in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationOrdersListByBillingAccount.json + */ +async function reservationOrderListByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.reservationOrders.listByBillingAccount( + billingAccountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + reservationOrderListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsGetByReservationOrderSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsGetByReservationOrderSample.ts new file mode 100644 index 000000000000..e95b6ebdfa8f --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsGetByReservationOrderSample.ts @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccount.json + */ +async function reservationGetByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountManagementGroup.json + */ +async function reservationGetByBillingAccountManagementGroup() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountSingleResourceGroup.json + */ +async function reservationGetByBillingAccountSingleResourceGroup() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get specific Reservation details in the billing account. + * + * @summary Get specific Reservation details in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationGetByBillingAccountSingleScope.json + */ +async function reservationGetByBillingAccountSingleScope() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.getByReservationOrder( + billingAccountName, + reservationOrderId, + reservationId, + ); + console.log(result); +} + +async function main() { + reservationGetByBillingAccount(); + reservationGetByBillingAccountManagementGroup(); + reservationGetByBillingAccountSingleResourceGroup(); + reservationGetByBillingAccountSingleScope(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/reservationsListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByBillingAccountSample.ts similarity index 54% rename from sdk/billing/arm-billing/samples/v4/typescript/src/reservationsListByBillingAccountSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByBillingAccountSample.ts index ab03abe94582..d278319eb23b 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/reservationsListByBillingAccountSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByBillingAccountSample.ts @@ -10,37 +10,40 @@ // Licensed under the MIT License. import { ReservationsListByBillingAccountOptionalParams, - BillingManagementClient + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * This sample demonstrates how to Lists the reservations in the billing account and the roll up counts of reservations group by provisioning states. * - * @summary Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.json + * @summary Lists the reservations in the billing account and the roll up counts of reservations group by provisioning states. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingAccount.json */ async function reservationsListByBillingAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const filter = "properties/reservedResourceType eq 'VirtualMachines'"; - const orderby = "properties/userFriendlyAppliedScopeType asc"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const selectedState = "Succeeded"; const options: ReservationsListByBillingAccountOptionalParams = { - filter, - orderby, - selectedState + selectedState, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.reservations.listByBillingAccount( billingAccountName, - options + options, )) { resArray.push(item); } console.log(resArray); } -reservationsListByBillingAccount().catch(console.error); +async function main() { + reservationsListByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/reservationsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByBillingProfileSample.ts similarity index 68% rename from sdk/billing/arm-billing/samples/v4/typescript/src/reservationsListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByBillingProfileSample.ts index 91fea4a7d3ec..70bb8a0a8436 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/reservationsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByBillingProfileSample.ts @@ -10,39 +10,42 @@ // Licensed under the MIT License. import { ReservationsListByBillingProfileOptionalParams, - BillingManagementClient + BillingManagementClient, } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @summary Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsListByBillingProfile.json */ async function reservationsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; - const filter = "properties/reservedResourceType eq 'VirtualMachines'"; - const orderby = "properties/userFriendlyAppliedScopeType asc"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "AAAA-AAAA-AAA-AAA"; const selectedState = "Succeeded"; const options: ReservationsListByBillingProfileOptionalParams = { - filter, - orderby, - selectedState + selectedState, }; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.reservations.listByBillingProfile( billingAccountName, billingProfileName, - options + options, )) { resArray.push(item); } console.log(resArray); } -reservationsListByBillingProfile().catch(console.error); +async function main() { + reservationsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByReservationOrderSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByReservationOrderSample.ts new file mode 100644 index 000000000000..827f0e104532 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsListByReservationOrderSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List Reservations within a single ReservationOrder in the billing account. + * + * @summary List Reservations within a single ReservationOrder in the billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationsGetFromOrderByBillingAccount.json + */ +async function reservationsGetFromOrderByBillingAccount() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.reservations.listByReservationOrder( + billingAccountName, + reservationOrderId, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + reservationsGetFromOrderByBillingAccount(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..6587732341cc --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/reservationsUpdateByBillingAccountSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Patch, BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update reservation by billing account. + * + * @summary Update reservation by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/reservationUpdateByBillingAccount.json + */ +async function reservationUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const reservationOrderId = "20000000-0000-0000-0000-000000000000"; + const reservationId = "30000000-0000-0000-0000-000000000000"; + const body: Patch = { displayName: "NewName" }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.reservations.beginUpdateByBillingAccountAndWait( + billingAccountName, + reservationOrderId, + reservationId, + body, + ); + console.log(result); +} + +async function main() { + reservationUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlanOrdersGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlanOrdersGetByBillingAccountSample.ts new file mode 100644 index 000000000000..75db1560fb06 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlanOrdersGetByBillingAccountSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get a savings plan order by billing account. + * + * @summary Get a savings plan order by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderGetByBillingAccount.json + */ +async function savingsPlanOrderGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlanOrders.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get a savings plan order by billing account. + * + * @summary Get a savings plan order by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderExpandedScheduleGetByBillingAccount.json + */ +async function savingsPlanOrderWithExpandedPaymentsGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlanOrders.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + ); + console.log(result); +} + +async function main() { + savingsPlanOrderGet(); + savingsPlanOrderWithExpandedPaymentsGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlanOrdersListByBillingAccountSample.ts similarity index 50% rename from sdk/billing/arm-billing/samples/v4/typescript/src/instructionsListByBillingProfileSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlanOrdersListByBillingAccountSample.ts index 1dc4299effcd..0c457b8b02b6 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/instructionsListByBillingProfileSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlanOrdersListByBillingAccountSample.ts @@ -10,27 +10,32 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** - * This sample demonstrates how to Lists the instructions by billing profile id. + * This sample demonstrates how to List all Savings plan orders by billing account. * - * @summary Lists the instructions by billing profile id. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json + * @summary List all Savings plan orders by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanOrderListByBillingAccount.json */ -async function instructionsListByBillingProfile() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const billingProfileName = "{billingProfileName}"; +async function savingsPlanOrderList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); - for await (let item of client.instructions.listByBillingProfile( + for await (let item of client.savingsPlanOrders.listByBillingAccount( billingAccountName, - billingProfileName )) { resArray.push(item); } console.log(resArray); } -instructionsListByBillingProfile().catch(console.error); +async function main() { + savingsPlanOrderList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansGetByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansGetByBillingAccountSample.ts new file mode 100644 index 000000000000..e8d29ee95dc3 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansGetByBillingAccountSample.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Get savings plan by billing account. + * + * @summary Get savings plan by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetByBillingAccount.json + */ +async function savingsPlanGet() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Get savings plan by billing account. + * + * @summary Get savings plan by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanGetExpandRenewPropertiesByBillingAccount.json + */ +async function savingsPlanGetExpandRenewProperties() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.getByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + ); + console.log(result); +} + +async function main() { + savingsPlanGet(); + savingsPlanGetExpandRenewProperties(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListByBillingAccountSample.ts new file mode 100644 index 000000000000..c5aeed42fad7 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListByBillingAccountSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SavingsPlansListByBillingAccountOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List savings plans by billing account. + * + * @summary List savings plans by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListByBillingAccount.json + */ +async function savingsPlansList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const take = 3; + const selectedState = "Succeeded"; + const refreshSummary = "true"; + const options: SavingsPlansListByBillingAccountOptionalParams = { + take, + selectedState, + refreshSummary, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.savingsPlans.listByBillingAccount( + billingAccountName, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + savingsPlansList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListBySavingsPlanOrderSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListBySavingsPlanOrderSample.ts new file mode 100644 index 000000000000..ac22acece5bc --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansListBySavingsPlanOrderSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to List savings plans in an order by billing account. + * + * @summary List savings plans in an order by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlansListBySavingsPlanOrders.json + */ +async function savingsPlansInOrderList() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.savingsPlans.listBySavingsPlanOrder( + billingAccountName, + savingsPlanOrderId, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + savingsPlansInOrderList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..210c41a46aeb --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansUpdateByBillingAccountSample.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SavingsPlanUpdateRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Update savings plan by billing account. + * + * @summary Update savings plan by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanUpdateByBillingAccount.json + */ +async function savingsPlanUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const body: SavingsPlanUpdateRequest = { + properties: { + appliedScopeProperties: { + managementGroupId: + "/providers/Microsoft.Management/managementGroups/mg1", + tenantId: "80000000-0000-0000-0000-000000000000", + }, + appliedScopeType: "ManagementGroup", + displayName: "sp_newName", + renew: true, + renewProperties: { + purchaseProperties: { + appliedScopeProperties: { + managementGroupId: + "/providers/Microsoft.Management/managementGroups/mg1", + tenantId: "80000000-0000-0000-0000-000000000000", + }, + appliedScopeType: "ManagementGroup", + billingPlan: "P1M", + billingScopeId: "/subscriptions/50000000-0000-0000-0000-000000000000", + commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" }, + displayName: "sp_newName_renewed", + sku: { name: "Compute_Savings_Plan" }, + term: "P3Y", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.beginUpdateByBillingAccountAndWait( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + body, + ); + console.log(result); +} + +async function main() { + savingsPlanUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansValidateUpdateByBillingAccountSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansValidateUpdateByBillingAccountSample.ts new file mode 100644 index 000000000000..18dec86111ec --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/savingsPlansValidateUpdateByBillingAccountSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SavingsPlanUpdateValidateRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Validate savings plan patch by billing account. + * + * @summary Validate savings plan patch by billing account. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/savingsPlanValidateUpdateByBillingAccount.json + */ +async function savingsPlanValidateUpdate() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; + const savingsPlanId = "30000000-0000-0000-0000-000000000000"; + const body: SavingsPlanUpdateValidateRequest = { + benefits: [ + { + appliedScopeProperties: { + subscriptionId: "/subscriptions/50000000-0000-0000-0000-000000000000", + }, + appliedScopeType: "Single", + }, + ], + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.savingsPlans.validateUpdateByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + body, + ); + console.log(result); +} + +async function main() { + savingsPlanValidateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsGetTransactionSummaryByInvoiceSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsGetTransactionSummaryByInvoiceSample.ts new file mode 100644 index 000000000000..980362f0269b --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsGetTransactionSummaryByInvoiceSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges. + * + * @summary Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionSummaryGetByInvoice.json + */ +async function transactionSummaryGetByInvoice() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transactions.getTransactionSummaryByInvoice( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + transactionSummaryGetByInvoice(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByBillingProfileSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByBillingProfileSample.ts new file mode 100644 index 000000000000..92ad172a2f0d --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByBillingProfileSample.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TransactionsListByBillingProfileOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * + * @summary Lists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByBillingProfile.json + */ +async function transactionsListByBillingProfile() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const periodStartDate = new Date("2024-04-01"); + const periodEndDate = new Date("2023-05-30"); + const typeParam = "Billed"; + const filter = "properties/date gt '2020-10-01'"; + const search = "storage"; + const options: TransactionsListByBillingProfileOptionalParams = { + filter, + search, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transactions.listByBillingProfile( + billingAccountName, + billingProfileName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transactionsListByBillingProfile(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByCustomerSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByCustomerSample.ts new file mode 100644 index 000000000000..ae5dab890733 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByCustomerSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TransactionsListByCustomerOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * + * @summary Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByCustomer.json + */ +async function transactionsListByCustomer() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const customerName = "22000000-0000-0000-0000-000000000000"; + const periodStartDate = new Date("2024-04-01"); + const periodEndDate = new Date("2023-05-30"); + const typeParam = "Billed"; + const filter = "properties/date gt '2020-10-01'"; + const search = "storage"; + const options: TransactionsListByCustomerOptionalParams = { filter, search }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transactions.listByCustomer( + billingAccountName, + billingProfileName, + customerName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transactionsListByCustomer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/src/transactionsListByInvoiceSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByInvoiceSample.ts similarity index 70% rename from sdk/billing/arm-billing/samples/v4/typescript/src/transactionsListByInvoiceSample.ts rename to sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByInvoiceSample.ts index 0a3884b140d1..73b659b31ef0 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/src/transactionsListByInvoiceSample.ts +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByInvoiceSample.ts @@ -10,27 +10,34 @@ // Licensed under the MIT License. import { BillingManagementClient } from "@azure/arm-billing"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. * * @summary Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/TransactionsListByInvoice.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoice.json */ async function transactionsListByInvoice() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const billingAccountName = "{billingAccountName}"; - const invoiceName = "{invoiceName}"; + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; const credential = new DefaultAzureCredential(); - const client = new BillingManagementClient(credential, subscriptionId); + const client = new BillingManagementClient(credential); const resArray = new Array(); for await (let item of client.transactions.listByInvoice( billingAccountName, - invoiceName + invoiceName, )) { resArray.push(item); } console.log(resArray); } -transactionsListByInvoice().catch(console.error); +async function main() { + transactionsListByInvoice(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByInvoiceSectionSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByInvoiceSectionSample.ts new file mode 100644 index 000000000000..32e73cd2dc69 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsListByInvoiceSectionSample.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TransactionsListByInvoiceSectionOptionalParams, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * + * @summary Lists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsListByInvoiceSection.json + */ +async function transactionsListByInvoiceSection() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "22000000-0000-0000-0000-000000000000"; + const periodStartDate = new Date("2024-04-01"); + const periodEndDate = new Date("2023-05-30"); + const typeParam = "Billed"; + const filter = "properties/date gt '2020-10-01'"; + const search = "storage"; + const options: TransactionsListByInvoiceSectionOptionalParams = { + filter, + search, + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transactions.listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transactionsListByInvoiceSection(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsTransactionsDownloadByInvoiceSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsTransactionsDownloadByInvoiceSample.ts new file mode 100644 index 000000000000..cfd458275051 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transactionsTransactionsDownloadByInvoiceSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * + * @summary Gets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transactionsDownloadByInvoice.json + */ +async function transactionsDownloadByInvoice() { + const billingAccountName = + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const invoiceName = "G123456789"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = + await client.transactions.beginTransactionsDownloadByInvoiceAndWait( + billingAccountName, + invoiceName, + ); + console.log(result); +} + +async function main() { + transactionsDownloadByInvoice(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/transfersCancelSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transfersCancelSample.ts new file mode 100644 index 000000000000..ee03c0156764 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transfersCancelSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Cancels a transfer request. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersCancel.json + */ +async function transferCancel() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transfers.cancel( + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + ); + console.log(result); +} + +async function main() { + transferCancel(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/transfersGetSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transfersGetSample.ts new file mode 100644 index 000000000000..523b297eb915 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transfersGetSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Gets a transfer request by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersGet.json + */ +async function transferGet() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const transferName = "aabb123"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transfers.get( + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + ); + console.log(result); +} + +async function main() { + transferGet(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/transfersInitiateSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transfersInitiateSample.ts new file mode 100644 index 000000000000..daf7372bbe26 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transfersInitiateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + InitiateTransferRequest, + BillingManagementClient, +} from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Sends a request to a user in another billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Sends a request to a user in another billing account to transfer billing ownership of their subscriptions. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersInitiate.json + */ +async function initiateTransfer() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const transferName = "aabb123"; + const parameters: InitiateTransferRequest = { + recipientEmailId: "user@contoso.com", + }; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const result = await client.transfers.initiate( + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + parameters, + ); + console.log(result); +} + +async function main() { + initiateTransfer(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v5/typescript/src/transfersListSample.ts b/sdk/billing/arm-billing/samples/v5/typescript/src/transfersListSample.ts new file mode 100644 index 000000000000..72aa697d9ee9 --- /dev/null +++ b/sdk/billing/arm-billing/samples/v5/typescript/src/transfersListSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { BillingManagementClient } from "@azure/arm-billing"; +import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); + +/** + * This sample demonstrates how to Lists the transfer requests for an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * + * @summary Lists the transfer requests for an invoice section. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2024-04-01/examples/transfersList.json + */ +async function transfersList() { + const billingAccountName = + "10000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31"; + const billingProfileName = "xxxx-xxxx-xxx-xxx"; + const invoiceSectionName = "yyyy-yyyy-yyy-yyy"; + const credential = new DefaultAzureCredential(); + const client = new BillingManagementClient(credential); + const resArray = new Array(); + for await (let item of client.transfers.list( + billingAccountName, + billingProfileName, + invoiceSectionName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + transfersList(); +} + +main().catch(console.error); diff --git a/sdk/billing/arm-billing/samples/v4/typescript/tsconfig.json b/sdk/billing/arm-billing/samples/v5/typescript/tsconfig.json similarity index 92% rename from sdk/billing/arm-billing/samples/v4/typescript/tsconfig.json rename to sdk/billing/arm-billing/samples/v5/typescript/tsconfig.json index ad5ff9a19d36..984eed535aa8 100644 --- a/sdk/billing/arm-billing/samples/v4/typescript/tsconfig.json +++ b/sdk/billing/arm-billing/samples/v5/typescript/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2018", + "target": "ES2020", "module": "commonjs", "moduleResolution": "node", "resolveJsonModule": true, diff --git a/sdk/billing/arm-billing/src/billingManagementClient.ts b/sdk/billing/arm-billing/src/billingManagementClient.ts index fadcf564aa66..54ad036a883b 100644 --- a/sdk/billing/arm-billing/src/billingManagementClient.ts +++ b/sdk/billing/arm-billing/src/billingManagementClient.ts @@ -8,75 +8,113 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { + AgreementsImpl, + AssociatedTenantsImpl, + AvailableBalancesImpl, BillingAccountsImpl, AddressImpl, - AvailableBalancesImpl, - InstructionsImpl, - BillingProfilesImpl, - CustomersImpl, - InvoiceSectionsImpl, BillingPermissionsImpl, + BillingProfilesImpl, + BillingPropertyOperationsImpl, + BillingRequestsImpl, + BillingRoleAssignmentsImpl, + BillingRoleDefinitionOperationsImpl, + SavingsPlanOrdersImpl, + SavingsPlansImpl, BillingSubscriptionsImpl, - ProductsImpl, + BillingSubscriptionsAliasesImpl, + CustomersImpl, + DepartmentsImpl, + EnrollmentAccountsImpl, InvoicesImpl, - TransactionsImpl, - PoliciesImpl, - BillingPropertyOperationsImpl, + InvoiceSectionsImpl, OperationsImpl, - BillingRoleDefinitionsImpl, - BillingRoleAssignmentsImpl, - AgreementsImpl, + PaymentMethodsImpl, + PoliciesImpl, + ProductsImpl, ReservationsImpl, - EnrollmentAccountsImpl, - BillingPeriodsImpl + ReservationOrdersImpl, + TransactionsImpl, + TransfersImpl, + PartnerTransfersImpl, + RecipientTransfersImpl, } from "./operations"; import { + Agreements, + AssociatedTenants, + AvailableBalances, BillingAccounts, Address, - AvailableBalances, - Instructions, - BillingProfiles, - Customers, - InvoiceSections, BillingPermissions, + BillingProfiles, + BillingPropertyOperations, + BillingRequests, + BillingRoleAssignments, + BillingRoleDefinitionOperations, + SavingsPlanOrders, + SavingsPlans, BillingSubscriptions, - Products, + BillingSubscriptionsAliases, + Customers, + Departments, + EnrollmentAccounts, Invoices, - Transactions, - Policies, - BillingPropertyOperations, + InvoiceSections, Operations, - BillingRoleDefinitions, - BillingRoleAssignments, - Agreements, + PaymentMethods, + Policies, + Products, Reservations, - EnrollmentAccounts, - BillingPeriods + ReservationOrders, + Transactions, + Transfers, + PartnerTransfers, + RecipientTransfers, } from "./operationsInterfaces"; import { BillingManagementClientOptionalParams } from "./models"; export class BillingManagementClient extends coreClient.ServiceClient { $host: string; - subscriptionId: string; + apiVersion: string; + subscriptionId?: string; /** * Initializes a new instance of the BillingManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID that uniquely identifies an Azure subscription. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: BillingManagementClientOptionalParams + options?: BillingManagementClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: BillingManagementClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: BillingManagementClientOptionalParams | string, + options?: BillingManagementClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -85,10 +123,10 @@ export class BillingManagementClient extends coreClient.ServiceClient { } const defaults: BillingManagementClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; - const packageDetails = `azsdk-js-arm-billing/4.1.1`; + const packageDetails = `azsdk-js-arm-billing/5.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -98,20 +136,21 @@ export class BillingManagementClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -121,7 +160,7 @@ export class BillingManagementClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -131,9 +170,9 @@ export class BillingManagementClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -141,48 +180,99 @@ export class BillingManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2024-04-01"; + this.agreements = new AgreementsImpl(this); + this.associatedTenants = new AssociatedTenantsImpl(this); + this.availableBalances = new AvailableBalancesImpl(this); this.billingAccounts = new BillingAccountsImpl(this); this.address = new AddressImpl(this); - this.availableBalances = new AvailableBalancesImpl(this); - this.instructions = new InstructionsImpl(this); - this.billingProfiles = new BillingProfilesImpl(this); - this.customers = new CustomersImpl(this); - this.invoiceSections = new InvoiceSectionsImpl(this); this.billingPermissions = new BillingPermissionsImpl(this); + this.billingProfiles = new BillingProfilesImpl(this); + this.billingPropertyOperations = new BillingPropertyOperationsImpl(this); + this.billingRequests = new BillingRequestsImpl(this); + this.billingRoleAssignments = new BillingRoleAssignmentsImpl(this); + this.billingRoleDefinitionOperations = + new BillingRoleDefinitionOperationsImpl(this); + this.savingsPlanOrders = new SavingsPlanOrdersImpl(this); + this.savingsPlans = new SavingsPlansImpl(this); this.billingSubscriptions = new BillingSubscriptionsImpl(this); - this.products = new ProductsImpl(this); + this.billingSubscriptionsAliases = new BillingSubscriptionsAliasesImpl( + this, + ); + this.customers = new CustomersImpl(this); + this.departments = new DepartmentsImpl(this); + this.enrollmentAccounts = new EnrollmentAccountsImpl(this); this.invoices = new InvoicesImpl(this); - this.transactions = new TransactionsImpl(this); - this.policies = new PoliciesImpl(this); - this.billingPropertyOperations = new BillingPropertyOperationsImpl(this); + this.invoiceSections = new InvoiceSectionsImpl(this); this.operations = new OperationsImpl(this); - this.billingRoleDefinitions = new BillingRoleDefinitionsImpl(this); - this.billingRoleAssignments = new BillingRoleAssignmentsImpl(this); - this.agreements = new AgreementsImpl(this); + this.paymentMethods = new PaymentMethodsImpl(this); + this.policies = new PoliciesImpl(this); + this.products = new ProductsImpl(this); this.reservations = new ReservationsImpl(this); - this.enrollmentAccounts = new EnrollmentAccountsImpl(this); - this.billingPeriods = new BillingPeriodsImpl(this); + this.reservationOrders = new ReservationOrdersImpl(this); + this.transactions = new TransactionsImpl(this); + this.transfers = new TransfersImpl(this); + this.partnerTransfers = new PartnerTransfersImpl(this); + this.recipientTransfers = new RecipientTransfersImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); } + agreements: Agreements; + associatedTenants: AssociatedTenants; + availableBalances: AvailableBalances; billingAccounts: BillingAccounts; address: Address; - availableBalances: AvailableBalances; - instructions: Instructions; - billingProfiles: BillingProfiles; - customers: Customers; - invoiceSections: InvoiceSections; billingPermissions: BillingPermissions; + billingProfiles: BillingProfiles; + billingPropertyOperations: BillingPropertyOperations; + billingRequests: BillingRequests; + billingRoleAssignments: BillingRoleAssignments; + billingRoleDefinitionOperations: BillingRoleDefinitionOperations; + savingsPlanOrders: SavingsPlanOrders; + savingsPlans: SavingsPlans; billingSubscriptions: BillingSubscriptions; - products: Products; + billingSubscriptionsAliases: BillingSubscriptionsAliases; + customers: Customers; + departments: Departments; + enrollmentAccounts: EnrollmentAccounts; invoices: Invoices; - transactions: Transactions; - policies: Policies; - billingPropertyOperations: BillingPropertyOperations; + invoiceSections: InvoiceSections; operations: Operations; - billingRoleDefinitions: BillingRoleDefinitions; - billingRoleAssignments: BillingRoleAssignments; - agreements: Agreements; + paymentMethods: PaymentMethods; + policies: Policies; + products: Products; reservations: Reservations; - enrollmentAccounts: EnrollmentAccounts; - billingPeriods: BillingPeriods; + reservationOrders: ReservationOrders; + transactions: Transactions; + transfers: Transfers; + partnerTransfers: PartnerTransfers; + recipientTransfers: RecipientTransfers; } diff --git a/sdk/billing/arm-billing/src/lroImpl.ts b/sdk/billing/arm-billing/src/lroImpl.ts index 518d5f053b4e..b27f5ac7209b 100644 --- a/sdk/billing/arm-billing/src/lroImpl.ts +++ b/sdk/billing/arm-billing/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike }, + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; } diff --git a/sdk/billing/arm-billing/src/models/index.ts b/sdk/billing/arm-billing/src/models/index.ts index 307984f5a9f9..1548bdf90bcf 100644 --- a/sdk/billing/arm-billing/src/models/index.ts +++ b/sdk/billing/arm-billing/src/models/index.ts @@ -8,2839 +8,9032 @@ import * as coreClient from "@azure/core-client"; -/** The list of billing accounts. */ -export interface BillingAccountListResult { - /** - * The list of billing accounts. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: BillingAccount[]; - /** - * The link (url) to the next page of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Address details. */ -export interface AddressDetails { - /** First name. */ - firstName?: string; - /** Middle name. */ - middleName?: string; - /** Last name. */ - lastName?: string; - /** Company name. */ - companyName?: string; - /** Address line 1. */ - addressLine1: string; - /** Address line 2. */ - addressLine2?: string; - /** Address line 3. */ - addressLine3?: string; - /** Address city. */ - city?: string; - /** Address district. */ - district?: string; - /** Address region. */ - region?: string; - /** Country code uses ISO2, 2-digit format. */ - country: string; - /** Postal code. */ - postalCode?: string; - /** Email address. */ - email?: string; - /** Phone number. */ - phoneNumber?: string; -} - -/** The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand. */ -export interface BillingProfilesOnExpand { +/** An agreement. */ +export interface AgreementProperties { /** - * Indicates whether there are more billing profiles than the ones listed in this collection. The collection lists a maximum of 50 billing profiles. To get all billing profiles, use the list billing profiles API. + * The mode of acceptance for an agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly hasMoreResults?: boolean; - /** The billing profiles associated with the billing account. */ - value?: BillingProfile[]; -} - -/** The billing profile details of the partner of the customer for an indirect motion. */ -export interface IndirectRelationshipInfo { - /** The billing account name of the partner or the customer for an indirect motion. */ - billingAccountName?: string; - /** The billing profile name of the partner or the customer for an indirect motion. */ - billingProfileName?: string; - /** The display name of the partner or customer for an indirect motion. */ - displayName?: string; -} - -/** Details of the Azure plan. */ -export interface AzurePlan { - /** The sku id. */ - skuId?: string; + readonly acceptanceMode?: AcceptanceMode; /** - * The sku description. + * The URL to download the agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuDescription?: string; -} - -/** The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in $expand. */ -export interface InvoiceSectionsOnExpand { + readonly agreementLink?: string; /** - * Indicates whether there are more invoice sections than the ones listed in this collection. The collection lists a maximum of 50 invoice sections. To get all invoice sections, use the list invoice sections API. + * 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 hasMoreResults?: boolean; - /** The invoice sections associated to the billing profile. */ - value?: InvoiceSection[]; -} - -/** The Resource model definition. */ -export interface Resource { + readonly billingProfileInfo?: BillingProfileInfo[]; /** - * Resource Id. + * The category of the agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly category?: Category; /** - * Resource name. + * The name of the agreement signed by a customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly displayName?: string; /** - * Resource type. + * The date from which the agreement is effective. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; -} - -/** The properties of an enrollment. */ -export interface Enrollment { - /** The start date of the enrollment. */ - startDate?: Date; - /** The end date of the enrollment. */ - endDate?: Date; + readonly effectiveDate?: Date; /** - * The billing currency for the enrollment. + * The date when the agreement expires. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; + readonly expirationDate?: Date; /** - * The channel type of the enrollment. + * The list of participants that participates in acceptance of an agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly channel?: string; + readonly participants?: Participant[]; /** - * The policies for Enterprise Agreement enrollments. + * The current status of the agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly policies?: EnrollmentPolicies; + readonly status?: string; /** - * The language for the enrollment. + * The ID of the lead billing account if this agreement is part of the Customer Affiliate Purchase Terms. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly language?: string; + readonly leadBillingAccountName?: string; +} + +/** Details about billing profile associated with agreement and available only for specific agreements. */ +export interface BillingProfileInfo { + /** The fully qualified ID that uniquely identifies a billing account. */ + billingAccountId?: string; + /** The name of the billing profile. */ + billingProfileDisplayName?: string; + /** The friendly ID that uniquely identifies a billing profile. */ + billingProfileId?: string; + /** The fully qualified ID that uniquely identifies a billing profile. */ + billingProfileSystemId?: string; + /** Billing account name. Available for a specific type of agreement. */ + indirectRelationshipOrganizationName?: string; +} + +/** Billing account name. Available for a specific type of agreement. */ +export interface Participant { /** - * The country code of the enrollment. + * The email address of the participant. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly countryCode?: string; + readonly email?: string; /** - * The current status of the enrollment. + * The acceptance status of the participant. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: string; /** - * The billing cycle for the enrollment. + * The date when the status got changed. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingCycle?: string; + readonly statusDate?: Date; } -/** The policies for Enterprise Agreement enrollments. */ -export interface EnrollmentPolicies { +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * The policy that controls whether Account Owners can view charges. + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountOwnerViewCharges?: boolean; + readonly id?: string; /** - * The policy that controls whether Department Administrators can view charges. + * The name of the resource * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly departmentAdminViewCharges?: boolean; + readonly name?: string; /** - * The policy that controls whether Azure marketplace purchases are allowed in the enrollment. + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly marketplaceEnabled?: boolean; + readonly type?: string; /** - * The policy that controls whether Azure reservation purchases are allowed in the enrollment. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservedInstancesEnabled?: boolean; + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; } -/** Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. */ +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ export interface ErrorResponse { - /** The details of the error. */ - error?: ErrorDetails; + /** The error object. */ + error?: ErrorDetail; } -/** The details of the error. */ -export interface ErrorDetails { +/** The error detail. */ +export interface ErrorDetail { /** - * Error code. + * The 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. + * The error message. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly message?: string; /** - * The target of the particular error. + * The error target. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly target?: string; /** - * The sub details of the error. + * The error details. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorSubDetailsItem[]; -} - -export interface ErrorSubDetailsItem { + readonly details?: ErrorDetail[]; /** - * Error code. + * The error additional info. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly code?: string; + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { /** - * Error message indicating why the operation failed. + * The additional info type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly message?: string; + readonly type?: string; /** - * The target of the particular error. + * The additional info. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly target?: string; + readonly info?: Record; } -/** The request properties of the billing account that can be updated. */ -export interface BillingAccountUpdateRequest { - /** The billing account name. */ - displayName?: string; - /** The address of the individual or organization that is responsible for the billing account. */ - soldTo?: AddressDetails; - /** - * The type of agreement. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly agreementType?: AgreementType; +/** A container for a list of resources */ +export interface AgreementListResult { /** - * The type of customer. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountType?: AccountType; + readonly nextLink?: string; /** - * The current status of the billing account. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountStatus?: AccountStatus; - /** The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand. */ - billingProfiles?: BillingProfilesOnExpand; + readonly value?: Agreement[]; +} + +/** An associated tenant. */ +export interface AssociatedTenantProperties { /** - * The details about the associated legacy enrollment. By default this is not populated, unless it's specified in $expand. + * The provisioning state of the resource during a long-running operation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly enrollmentDetails?: Enrollment; - /** The departments associated to the enrollment. */ - departments?: Department[]; - /** The accounts associated to the enrollment. */ - enrollmentAccounts?: EnrollmentAccount[]; + readonly provisioningState?: ProvisioningState; + /** The name of the associated tenant. */ + displayName?: string; + /** The ID that uniquely identifies a tenant. */ + tenantId?: string; + /** The state determines whether users from the associated tenant can be assigned roles for commerce activities like viewing and downloading invoices, managing payments, and making purchases. */ + billingManagementState?: BillingManagementTenantState; + /** The state determines whether subscriptions and licenses can be provisioned in the associated tenant. It can be set to 'Pending' to initiate a billing request. */ + provisioningManagementState?: ProvisioningTenantState; /** - * Indicates whether user has read access to the billing account. + * The unique identifier for the billing request that is created when enabling provisioning for an associated tenant. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly hasReadAccess?: boolean; - /** Notification email address, only for legacy accounts */ - notificationEmailAddress?: string; + readonly provisioningBillingRequestId?: string; } -/** The list of invoice section properties with create subscription permission. */ -export interface InvoiceSectionListWithCreateSubPermissionResult { - /** The list of invoice section properties with create subscription permission. */ - value?: InvoiceSectionWithCreateSubPermission[]; +/** A container for a list of resources */ +export interface AssociatedTenantListResult { /** * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nextLink?: string; + /** + * The list of resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: AssociatedTenant[]; } -/** Invoice section properties with create subscription permission. */ -export interface InvoiceSectionWithCreateSubPermission { +/** The Available Credit or Payment on Account Balance. The credit balance can be used to settle due or past due invoices. */ +export interface AvailableBalanceProperties { + /** Credit amount for immediate payment. */ + amount?: AvailableBalancePropertiesAmount; /** - * The ID of the invoice section. + * The list of payments on accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceSectionId?: string; + readonly paymentsOnAccount?: PaymentOnAccount[]; + /** Total amount of payments on accounts. */ + totalPaymentsOnAccount?: AvailableBalancePropertiesTotalPaymentsOnAccount; +} + +/** The amount. */ +export interface Amount { /** - * The name of the invoice section. + * The currency for the amount value. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceSectionDisplayName?: string; + readonly currency?: string; /** - * The system generated unique identifier for an invoice section. + * The amount value. For example, if the currency is USD, then a value of 600 would be $600.00. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceSectionSystemId?: string; + readonly value?: number; +} + +/** A Payment on Account. */ +export interface PaymentOnAccount { + /** Payment on Account amount. */ + amount?: PaymentOnAccountAmount; /** - * The ID of the billing profile for the invoice section. + * The ID of the billing profile for the payments on account. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly billingProfileId?: string; /** - * The name of the billing profile for the invoice section. + * The name of the billing profile for the payments on account. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly billingProfileDisplayName?: string; /** - * The status of the billing profile. + * The ID of the invoice for which the payments on account was generated. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileStatus?: BillingProfileStatus; + readonly invoiceId?: string; /** - * Reason for the specified billing profile status. + * The name of the invoice for the payments on account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileStatusReasonCode?: StatusReasonCodeForBillingProfile; + readonly invoiceName?: string; /** - * The billing profile spending limit. + * The date of the payments on account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileSpendingLimit?: SpendingLimitForBillingProfile; + readonly date?: Date; /** - * The system generated unique identifier for a billing profile. + * Payment on Account type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileSystemId?: string; - /** Enabled azure plans for the associated billing profile. */ - enabledAzurePlans?: AzurePlan[]; -} - -/** Result of the address validation */ -export interface ValidateAddressResponse { - /** status of the address validation. */ - status?: AddressValidationStatus; - /** The list of suggested addresses. */ - suggestedAddresses?: AddressDetails[]; - /** Validation error message. */ - validationMessage?: string; + readonly paymentMethodType?: PaymentMethodFamily; } -/** The amount. */ -export interface Amount { +/** The properties of payment term. */ +export interface PaymentTerm { + /** Represents duration in netXX format. Always in days. */ + term?: string; + /** The date on when the defined 'Payment Term' will be effective from and is always in UTC. */ + startDate?: Date; + /** The date on when the defined 'Payment Term' will end and is always in UTC. */ + endDate?: Date; /** - * The currency for the amount value. + * Indicates payment term is the standard payment term. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; - /** Amount value. */ - value?: number; + readonly isDefault?: boolean; } -/** The list of billing instructions used during invoice generation. */ -export interface InstructionListResult { +/** A billing account. */ +export interface BillingAccountProperties { /** - * The list of billing instructions used during invoice generation. + * The provisioning state of the resource during a long-running operation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Instruction[]; + readonly provisioningState?: ProvisioningState; /** - * The link (url) to the next page of results. + * The current status of the billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** The list of billing profiles. */ -export interface BillingProfileListResult { + readonly accountStatus?: AccountStatus; /** - * The list of billing profiles. + * The type of customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: BillingProfile[]; + readonly accountType?: AccountType; /** - * The link (url) to the next page of results. + * The tier of the account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** The list of customers. */ -export interface CustomerListResult { + readonly accountSubType?: AccountSubType; /** - * The list of customers. + * Reason for the specified billing account status. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Customer[]; + readonly accountStatusReasonCode?: BillingAccountStatusReasonCode; /** - * Total number of records. + * The type of agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalCount?: number; + readonly agreementType?: AgreementType; + /** The billing account name. */ + displayName?: string; + /** The properties of an enrollment. */ + enrollmentDetails?: BillingAccountPropertiesEnrollmentDetails; + /** Indicates whether user has read access to the billing account. */ + hasReadAccess?: boolean; + /** Indicates whether or not the billing account has any billing profiles. */ + hasNoBillingProfiles?: boolean; + /** Notification email address for legacy account. Available for agreement type Microsoft Online Services Program. */ + notificationEmailAddress?: string; + /** The tenant that was used to set up the billing account. By default, only users from this tenant can get role assignments on the billing account and all purchases are provisioned in this tenant. */ + primaryBillingTenantId?: string; + /** The address of the individual or organization that is responsible for the billing account. */ + soldTo?: BillingAccountPropertiesSoldTo; + /** Describes the registration number of the organization linked with the billing account. */ + registrationNumber?: BillingAccountPropertiesRegistrationNumber; /** - * The link (url) to the next page of results. + * Identifies the billing relationships represented by a billing account. The billing relationship may be between Microsoft, the customer, and/or a third-party. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** Details of the reseller. */ -export interface Reseller { + readonly billingRelationshipTypes?: BillingRelationshipType[]; /** - * The MPN ID of the reseller. + * Qualifications for pricing on a billing account. Values may be Commercial, Education, Charity or Government. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resellerId?: string; + readonly qualifications?: string[]; + /** A list of tax identifiers for the billing account. */ + taxIds?: TaxIdentifier[]; +} + +/** The properties of an enrollment. */ +export interface EnrollmentDetails { + /** The start date of the enrollment. */ + startDate?: Date; + /** The end date of the enrollment. */ + endDate?: Date; /** - * The name of the reseller. + * The billing currency for the enrollment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly description?: string; -} - -/** The list of invoice sections. */ -export interface InvoiceSectionListResult { + readonly currency?: string; /** - * The list of invoice sections. + * The channel type of the enrollment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: InvoiceSection[]; + readonly channel?: string; /** - * Total number of records. + * The language for the enrollment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalCount?: number; + readonly language?: string; /** - * The link (url) to the next page of results. + * The country code of the enrollment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** Result of list billingPermissions a caller has on a billing account. */ -export interface BillingPermissionsListResult { + readonly countryCode?: string; /** - * The list of billingPermissions a caller has on a billing account. + * The billing cycle for the enrollment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: BillingPermissionsProperties[]; + readonly billingCycle?: string; /** - * The link (url) to the next page of results. + * The billing account extension opted by the company. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** The set of allowed action and not allowed actions a caller has on a billing account */ -export interface BillingPermissionsProperties { + readonly extendedTermOption?: ExtendedTermOption; /** - * The set of actions that the caller is allowed to perform. + * The support level offer associated with an enrollment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly actions?: string[]; + readonly supportLevel?: SupportLevel; /** - * The set of actions that the caller is not allowed to perform. + * The support coverage period for the enrollment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly notActions?: string[]; -} - -/** The list of billing subscriptions. */ -export interface BillingSubscriptionsListResult { + readonly supportCoverage?: string; /** - * The list of billing subscriptions. + * The cloud of the enrollment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: BillingSubscription[]; + readonly cloud?: string; + /** The purchase order number of the enrollment. */ + poNumber?: string; /** - * Total number of records. + * Markup status of enrollment, applicable only for indirect enrollments. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalCount?: number; + readonly markupStatus?: MarkupStatus; + /** The properties of an enrollment which are applicable only for indirect enrollments. */ + indirectRelationshipInfo?: EnrollmentDetailsIndirectRelationshipInfo; /** - * The link (url) to the next page of results. + * The contact who receives invoices of the enrollment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly invoiceRecipient?: string; } -/** The list of products. It contains a list of available product summaries in reverse chronological order by purchase date. */ -export interface ProductsListResult { - /** - * The list of products. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Product[]; +/** Identifies the billing profile that is linked to another billing profile in indirect purchase motion. */ +export interface IndirectRelationshipInfo { + /** The billing account name of the partner or the customer for an indirect motion. */ + billingAccountName?: string; + /** The billing profile name of the partner or the customer for an indirect motion. */ + billingProfileName?: string; + /** The display name of the partner or customer for an indirect motion. */ + displayName?: string; +} + +/** Address details. */ +export interface AddressDetails { + /** Address line 1. */ + addressLine1: string; + /** Address line 2. */ + addressLine2?: string; + /** Address line 3. */ + addressLine3?: string; + /** Address city. */ + city?: string; + /** Company name. Optional for MCA Individual (Pay-as-you-go). */ + companyName?: string; + /** Country code uses ISO 3166-1 Alpha-2 format. */ + country: string; + /** Address district. */ + district?: string; + /** Email address. */ + email?: string; + /** First name. Optional for MCA Enterprise. */ + firstName?: string; + /** Last name. Optional for MCA Enterprise. */ + lastName?: string; + /** Middle name. */ + middleName?: string; + /** Phone number. */ + phoneNumber?: string; + /** Postal code. */ + postalCode?: string; + /** Address region. */ + region?: string; + /** Indicates if the address is incomplete. */ + isValidAddress?: boolean; +} + +/** Describes the registration number of the organization linked with the billing account. */ +export interface RegistrationNumber { + /** The unique identification number of the organization linked with the billing account. */ + id?: string; /** - * Total number of records. + * Identifies if the registration number is required for the billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalCount?: number; + readonly required?: boolean; /** - * The link (url) to the next page of results. + * The types of registration number allowed based on the country of the billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly type?: string[]; } -/** The list of invoices. */ -export interface InvoiceListResult { - /** - * The list of invoices. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Invoice[]; +/** A tax identifier for the billing account. */ +export interface TaxIdentifier { + /** The id of the tax identifier. */ + id?: string; + /** The type of the tax identifier. */ + type?: TaxIdentifierType; + /** The scope of the tax identifier. */ + scope?: string; + /** The country of the tax identifier. */ + country?: string; + /** The status of the tax identifier. */ + status?: TaxIdentifierStatus; +} + +/** The details for a billing account transitioned from agreement type Microsoft Online Services Program to agreement type Microsoft Customer Agreement. */ +export interface TransitionDetails { /** - * The link (url) to the next page of results. + * The transition completion date. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly transitionDate?: Date; /** - * Total number of records. + * The anniversary day of the pre-transitioned account of type Microsoft Online Services Program. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalCount?: number; + readonly anniversaryDay?: number; } -/** The properties of a document. */ -export interface Document { +/** A container for a list of resources */ +export interface InvoiceSectionWithCreateSubPermissionListResult { /** - * The type of the document. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly kind?: DocumentType; + readonly nextLink?: string; /** - * Document URL. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly url?: string; + readonly value?: InvoiceSectionWithCreateSubPermission[]; +} + +/** Invoice section properties with create subscription permission. */ +export interface InvoiceSectionWithCreateSubPermission { /** - * The source of the document. ENF for Brazil and DRS for rest of the world. + * The name of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly source?: DocumentSource; -} - -/** The properties of a payment. */ -export interface PaymentProperties { + readonly billingProfileDisplayName?: string; /** - * The type of payment. + * The fully qualified ID that uniquely identifies a billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly paymentType?: string; + readonly billingProfileId?: string; /** - * The paid amount. + * The system generated unique identifier for a billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly amount?: Amount; + readonly billingProfileSystemId?: string; /** - * The date when the payment was made. + * The status of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly date?: Date; - /** The family of payment method. */ - paymentMethodFamily?: PaymentMethodFamily; + readonly billingProfileStatus?: BillingProfileStatus; /** - * The type of payment method. + * Reason for the specified billing profile status. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly paymentMethodType?: string; -} - -/** The rebill details of an invoice. */ -export interface RebillDetails { + readonly billingProfileStatusReasonCode?: BillingProfileStatusReasonCode; /** - * The ID of credit note. + * The billing profile spending limit. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly creditNoteDocumentId?: string; + readonly billingProfileSpendingLimit?: SpendingLimit; /** - * The ID of invoice. + * Enabled azure plans for the associated billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceDocumentId?: string; + readonly enabledAzurePlans?: AzurePlan[]; /** - * Rebill details for an invoice. + * The name of the invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly rebillDetails?: { [propertyName: string]: RebillDetails }; -} - -/** A secure URL that can be used to download a an entity until the URL expires. */ -export interface DownloadUrl { + readonly invoiceSectionDisplayName?: string; /** - * The time in UTC when the download URL will expire. + * The fully qualified ID that uniquely identifies an invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly expiryTime?: Date; + readonly invoiceSectionId?: string; /** - * The URL to the PDF file. + * The system generated unique identifier for an invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly url?: string; + readonly invoiceSectionSystemId?: string; } -/** Request parameters to transfer billing subscription. */ -export interface TransferBillingSubscriptionRequestProperties { - /** The destination invoice section id. */ - destinationInvoiceSectionId: string; +/** Details of the Azure plan. */ +export interface AzurePlan { + /** The ID that uniquely identifies a product. */ + productId?: string; + /** The ID that uniquely identifies a sku. */ + skuId?: string; + /** The sku description. */ + skuDescription?: string; } -/** Result of the transfer eligibility validation. */ -export interface ValidateSubscriptionTransferEligibilityResult { - /** - * Specifies whether the subscription is eligible to be transferred. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isMoveEligible?: boolean; - /** Validation error details. */ - errorDetails?: ValidateSubscriptionTransferEligibilityError; +/** Result of the payment terms eligibility. */ +export interface PaymentTermsEligibilityResult { + /** Indicates the eligibility status of the payment terms. */ + eligibilityStatus?: PaymentTermsEligibilityStatus; + /** Details of the payment terms eligibility. */ + eligibilityDetails?: PaymentTermsEligibilityDetail[]; } -/** Error details of the transfer eligibility validation */ -export interface ValidateSubscriptionTransferEligibilityError { - /** Error code for the product transfer validation. */ - code?: SubscriptionTransferValidationErrorCode; - /** The error message. */ +/** Details of the payment terms eligibility. */ +export interface PaymentTermsEligibilityDetail { + /** Indicates the reason for the ineligibility of the payment terms. */ + code?: PaymentTermsEligibilityCode; + /** Indicates the message for the ineligibility of the payment terms. */ message?: string; - /** Detailed error message explaining the error. */ - details?: string; -} - -/** The properties of the product to initiate a transfer. */ -export interface TransferProductRequestProperties { - /** The destination invoice section id. */ - destinationInvoiceSectionId?: string; } -/** Result of the product transfer eligibility validation. */ -export interface ValidateProductTransferEligibilityResult { +/** A container for a list of resources */ +export interface BillingAccountListResult { /** - * Specifies whether the transfer is eligible or not. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isMoveEligible?: boolean; - /** Validation error details. */ - errorDetails?: ValidateProductTransferEligibilityError; -} - -/** Error details of the product transfer eligibility validation. */ -export interface ValidateProductTransferEligibilityError { - /** Error code for the product transfer validation. */ - code?: ProductTransferValidationErrorCode; - /** The error message. */ - message?: string; - /** Detailed error message explaining the error. */ - details?: string; + readonly nextLink?: string; + /** + * The list of resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: BillingAccount[]; } -/** The list of transactions. */ -export interface TransactionListResult { +/** Result of the address validation. */ +export interface AddressValidationResponse { /** - * The list of transactions. + * Status of the address validation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Transaction[]; + readonly status?: AddressValidationStatus; /** - * Total number of records. + * The list of suggested addresses. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalCount?: number; + readonly suggestedAddresses?: AddressDetails[]; /** - * The link (url) to the next page of results. + * Validation error message. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly validationMessage?: string; } -/** The list of billing operations and a URL link to get the next set of results. */ -export interface OperationListResult { +/** A container for a list of resources */ +export interface BillingPermissionListResult { /** - * The list of billing operations supported by the Microsoft.Billing resource provider. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Operation[]; + readonly nextLink?: string; /** - * URL to get the next set of operation list results if there are any. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; + readonly value?: BillingPermission[]; } -/** A Billing REST API operation. */ -export interface Operation { +/** The set of allowed action and not allowed actions a caller has on a resource. */ +export interface BillingPermission { /** - * Operation name: {provider}/{resource}/{operation}. + * The set of actions that the caller is allowed to perform. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly actions?: string[]; /** - * Identifies if the operation is a data operation. + * The set of actions that the caller is not allowed to perform. * 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; + readonly notActions?: string[]; } -/** The object that represents the operation. */ -export interface OperationDisplay { +/** Request to check access. */ +export interface CheckAccessRequest { + /** List of actions passed in the request body against which the permissions will be checked. */ + actions?: string[]; +} + +/** The properties of a check access response. */ +export interface CheckAccessResponse { /** - * Service provider: Microsoft.Billing. + * Access Decision, specifies access is allowed or not. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provider?: string; + readonly accessDecision?: AccessDecision; /** - * Resource on which the operation is performed such as invoice and billing subscription. + * Gets or sets an action. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly resource?: string; + readonly action?: string; +} + +/** Eligibility to delete a billing profile result. */ +export interface DeleteBillingProfileEligibilityResult { + /** Status describing if billing profile is eligible to be deleted. */ + eligibilityStatus?: DeleteBillingProfileEligibilityStatus; + /** Validation details of delete billing profile eligibility. */ + eligibilityDetails?: DeleteBillingProfileEligibilityDetail[]; +} + +/** Validation details of delete billing profile eligibility. */ +export interface DeleteBillingProfileEligibilityDetail { + /** Code of the delete invoice section eligibility response. */ + code?: DeleteBillingProfileEligibilityCode; + /** Validation message. */ + message?: string; +} + +/** A billing profile. */ +export interface BillingProfileProperties { /** - * Operation type such as read, write and delete. + * The provisioning state of the resource during a long-running operation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operation?: string; + readonly provisioningState?: ProvisioningState; /** - * Description of operation. + * Identifies the billing relationship represented by the billing profile. The billing relationship may be between Microsoft, the customer, and/or a third-party. * 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 { + readonly billingRelationshipType?: BillingRelationshipType; + /** Billing address. */ + billTo?: BillingProfilePropertiesBillTo; /** - * The role definitions. + * The currency in which the charges for the billing profile are billed. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: BillingRoleDefinition[]; + readonly currency?: string; + /** The name of the billing profile. */ + displayName?: string; + /** Information about the enabled azure plans. */ + enabledAzurePlans?: AzurePlan[]; /** - * The link (url) to the next page of results. + * Indicates whether user has read access to the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** The list of role assignments. */ -export interface BillingRoleAssignmentListResult { + readonly hasReadAccess?: boolean; + /** Identifies the billing profile that is linked to another billing profile in indirect purchase motion. */ + indirectRelationshipInfo?: BillingProfilePropertiesIndirectRelationshipInfo; + /** + * The day of the month when the invoice for the billing profile is generated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceDay?: number; + /** Flag controlling whether the invoices for the billing profile are sent through email. */ + invoiceEmailOptIn?: boolean; + /** The list of email addresses to receive invoices by email for the billing profile. */ + invoiceRecipients?: string[]; + /** The default purchase order number that will appear on the invoices generated for the billing profile. */ + poNumber?: string; + /** The default address where the products are shipped, or the services are being used. If a ship to is not specified for a product or a subscription, then this address will be used. */ + shipTo?: BillingProfilePropertiesShipTo; + /** The address of the individual or organization that is responsible for the billing account. */ + soldTo?: BillingProfilePropertiesSoldTo; /** - * The list of role assignments. + * The billing profile spending limit. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: BillingRoleAssignment[]; + readonly spendingLimit?: SpendingLimit; /** - * The link (url) to the next page of results. + * The details of billing profile spending limit. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** Result of listing agreements. */ -export interface AgreementListResult { + readonly spendingLimitDetails?: SpendingLimitDetails[]; /** - * The list of agreements. + * The status of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Agreement[]; + readonly status?: BillingProfileStatus; /** - * The link (url) to the next page of results. + * Reason for the specified billing profile status. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** The details about a participant. */ -export interface Participants { + readonly statusReasonCode?: BillingProfileStatusReasonCode; /** - * The acceptance status of the participant. + * The system generated unique identifier for a billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: string; + readonly systemId?: string; + /** Dictionary of metadata associated with the resource. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / */ + tags?: { [propertyName: string]: string }; /** - * The date when the status got changed. + * Identifies the cloud environments that are associated with a billing profile. This is a system managed optional field and gets updated as the billing profile gets associated with accounts in various clouds. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly statusDate?: Date; + readonly targetClouds?: string[]; + /** The current payment term of the billing profile. */ + currentPaymentTerm?: BillingProfilePropertiesCurrentPaymentTerm; /** - * The email address of the participant. + * The other payment terms of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly email?: string; + readonly otherPaymentTerms?: PaymentTerm[]; } -/** The list of reservations and summary of roll out count of reservations in each state. */ -export interface ReservationsListResult { +/** The billing profile spending limit. */ +export interface SpendingLimitDetails { + /** The initial amount for the billing profile. */ + amount?: number; + /** The currency in which the charges for the billing profile are billed. */ + currency?: string; + /** The date when this spending limit goes into effect. */ + startDate?: Date; + /** The date when this spending limit is no longer in effect. */ + endDate?: Date; + /** The type of spending limit. */ + type?: SpendingLimitType; + /** The status of current spending limit. */ + status?: SpendingLimitStatus; +} + +/** A container for a list of resources */ +export interface BillingProfileListResult { /** - * The list of reservations. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: Reservation[]; + readonly nextLink?: string; /** - * The link (url) to the next page of results. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; - /** The roll out count summary of the reservations */ - summary?: ReservationSummary; + readonly value?: BillingProfile[]; } -/** The definition of the reservation. */ -export interface Reservation { +/** A billing property. */ +export interface BillingPropertyProperties { /** - * The id of the reservation. + * The type of agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly billingAccountAgreementType?: AgreementType; /** - * The name of the reservation. + * The name of the billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly billingAccountDisplayName?: string; /** - * The type of the reservation. + * The fully qualified ID that uniquely identifies a billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly billingAccountId?: string; /** - * The location of the reservation. + * Notification email address for legacy account. Available for agreement type Microsoft Online Services Program. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly location?: string; - /** The sku information associated to this reservation */ - sku?: ReservationSkuProperty; - /** The array of applied scopes of a reservation. Will be null if the reservation is in Shared scope */ - appliedScopes?: string[]; + readonly accountAdminNotificationEmailAddress?: string; /** - * The applied scope type of the reservation. + * The country of the individual or organization that is responsible for the billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly appliedScopeType?: string; + readonly billingAccountSoldToCountry?: string; /** - * The reserved source type of the reservation, e.g. virtual machine. + * The current status of the billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reservedResourceType?: string; + readonly billingAccountStatus?: AccountStatus; /** - * The number of the reservation. + * Reason for the specified billing account status. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly quantity?: number; + readonly billingAccountStatusReasonCode?: BillingAccountStatusReasonCode; /** - * The provisioning state of the reservation, e.g. Succeeded + * The type of customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly billingAccountType?: AccountType; /** - * The expiry date of the reservation + * The tier of the account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly expiryDate?: string; + readonly billingAccountSubType?: AccountSubType; /** - * The provisioning state of the reservation, e.g. Succeeded + * The billing currency for the subscription. Available for billing accounts with agreement type Enterprise Agreement * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningSubState?: string; + readonly billingCurrency?: string; /** - * The display name of the reservation + * The name of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly displayName?: string; + readonly billingProfileDisplayName?: string; /** - * The provisioning state of the reservation for display, e.g. Succeeded + * The fully qualified ID that uniquely identifies a billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly displayProvisioningState?: string; + readonly billingProfileId?: string; /** - * The renew state of the reservation for display, e.g. On + * The billing profile spending limit. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly userFriendlyRenewState?: string; + readonly billingProfileSpendingLimit?: SpendingLimit; /** - * The applied scope type of the reservation for display, e.g. Shared + * The details of billing profile spending limit. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly userFriendlyAppliedScopeType?: string; + readonly billingProfileSpendingLimitDetails?: SpendingLimitDetails[]; /** - * The effective date time of the reservation + * The status of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly effectiveDateTime?: string; + readonly billingProfileStatus?: BillingProfileStatus; /** - * The sku description of the reservation + * Reason for the specified billing profile status. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuDescription?: string; + readonly billingProfileStatusReasonCode?: BillingProfileStatusReasonCode; /** - * The term of the reservation, e.g. P1Y + * The payment method family of the primary payment method for the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly term?: string; + readonly billingProfilePaymentMethodFamily?: PaymentMethodFamily; /** - * The renew state of the reservation + * The payment method type of the primary payment method for the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly renew?: boolean; + readonly billingProfilePaymentMethodType?: string; /** - * The renew source of the reservation + * The Azure AD tenant ID of the billing account for the subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly renewSource?: string; + readonly billingTenantId?: string; + /** The cost center applied to the subscription. Available for agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. This property can be updated via patch. */ + costCenter?: string; /** - * Reservation utilization + * The name of the customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly utilization?: ReservationPropertyUtilization; -} - -/** The property of reservation sku object. */ -export interface ReservationSkuProperty { + readonly customerDisplayName?: string; /** - * The name of the reservation sku. + * The fully qualified ID that uniquely identifies a customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; -} - -/** Reservation utilization */ -export interface ReservationPropertyUtilization { + readonly customerId?: string; /** - * The number of days trend for a reservation + * Identifies the status of an customer. This is an upcoming property that will be populated in the future. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly trend?: string; - /** The array of aggregates of a reservation's utilization */ - aggregates?: ReservationUtilizationAggregates[]; -} - -/** The aggregate values of reservation utilization */ -export interface ReservationUtilizationAggregates { + readonly customerStatus?: CustomerStatus; /** - * The grain of the aggregate + * The name of the invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly grain?: number; + readonly invoiceSectionDisplayName?: string; /** - * The grain unit of the aggregate + * The fully qualified ID that uniquely identifies an invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly grainUnit?: string; + readonly invoiceSectionId?: string; /** - * The aggregate value + * Identifies the status of an invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: number; + readonly invoiceSectionStatus?: InvoiceSectionState; /** - * The aggregate value unit + * Reason for the specified invoice section status. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly valueUnit?: string; -} - -/** The roll up count summary of reservations in each state */ -export interface ReservationSummary { + readonly invoiceSectionStatusReasonCode?: InvoiceSectionStateReasonCode; /** - * The number of reservation in Succeeded state + * Specifies if the billing account for the subscription is transitioned from a Microsoft Online Service Program to a Microsoft Customer Agreement (MCA) account. Will be present and value will be true if its a transitioned billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly succeededCount?: number; + readonly isTransitionedBillingAccount?: boolean; /** - * The number of reservation in Failed state + * The sku description. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly failedCount?: number; + readonly skuDescription?: string; /** - * The number of reservation in Expiring state + * The ID that uniquely identifies a sku. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly expiringCount?: number; + readonly skuId?: string; /** - * The number of reservation in Expired state + * The subscription status. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly expiredCount?: number; + readonly subscriptionBillingStatus?: BillingSubscriptionStatus; /** - * The number of reservation in Pending state + * The reason codes for the subscription status. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly pendingCount?: number; + readonly subscriptionBillingStatusDetails?: BillingSubscriptionStatusDetails[]; /** - * The number of reservation in Cancelled state + * The type of billing subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly cancelledCount?: number; -} - -/** Result of listing enrollment accounts. */ -export interface EnrollmentAccountListResult { + readonly subscriptionBillingType?: SubscriptionBillingType; + /** The address of the individual or organization where service subscription is being used. Available for agreement type Microsoft Online Services Program. This property can be updated via patch. */ + subscriptionServiceUsageAddress?: BillingPropertyPropertiesSubscriptionServiceUsageAddress; /** - * The list of enrollment accounts. + * The Azure workload type of the subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: EnrollmentAccountSummary[]; + readonly subscriptionWorkloadType?: SubscriptionWorkloadType; + /** The enrollment details for the subscription. Available for billing accounts with agreement type Enterprise Agreement. */ + enrollmentDetails?: BillingPropertyPropertiesEnrollmentDetails; /** - * The link (url) to the next page of results. + * Indicates whether user is the account admin. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** Result of listing billing periods. It contains a list of available billing periods in reverse chronological order. */ -export interface BillingPeriodsListResult { + readonly isAccountAdmin?: boolean; /** - * The list of billing periods. + * The ID that uniquely identifies a product. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: BillingPeriod[]; + readonly productId?: string; /** - * The link (url) to the next page of results. + * The ID that uniquely identifies a product. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly nextLink?: string; -} - -/** The request parameters for creating a new billing profile. */ -export interface BillingProfileCreationRequest { - /** The name of the billing profile. */ - displayName?: string; - /** The purchase order name that will appear on the invoices generated for the billing profile. */ - poNumber?: string; - /** The address of the individual or organization that is responsible for the billing profile. */ - billTo?: AddressDetails; - /** Flag controlling whether the invoices for the billing profile are sent through email. */ - invoiceEmailOptIn?: boolean; - /** Enabled azure plans for the billing profile. */ - enabledAzurePlans?: AzurePlan[]; -} - -/** The properties of the invoice section. */ -export interface InvoiceSectionCreationRequest { - /** The name of the invoice section. */ - displayName?: string; -} - -/** The enrollment account context */ -export interface EnrollmentAccountContext { - /** The cost center associated with the enrollment account. */ - costCenter?: string; - /** The start date of the enrollment account. */ - startDate?: Date; - /** The end date of the enrollment account. */ - endDate?: Date; - /** The ID of the enrollment account. */ - enrollmentAccountName?: string; + readonly productName?: string; } -/** An invoice section. */ -export interface InvoiceSection extends Resource { - /** The name of the invoice section. */ - displayName?: string; - /** Dictionary of metadata associated with the invoice section. */ - labels?: { [propertyName: string]: string }; - /** - * Identifies the state of an invoice section. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly state?: InvoiceSectionState; +/** The suspension details for a subscription. This field is not available for Enterprise Agreement billing accounts. */ +export interface BillingSubscriptionStatusDetails { /** - * The system generated unique identifier for an invoice section. + * The suspension effective date for a subscription. This field is not available for Enterprise Agreement billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly systemId?: string; - /** Dictionary of metadata associated with the invoice section. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / */ - tags?: { [propertyName: string]: string }; + readonly effectiveDate?: Date; /** - * Identifies the cloud environments that are associated with an invoice section. This is a system managed optional field and gets updated as the invoice section gets associated with accounts in various clouds. + * The suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly targetCloud?: TargetCloud; + readonly reason?: SubscriptionStatusReason; } -/** A billing profile. */ -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. */ - poNumber?: string; +/** The enrollment details for the subscription. Available for billing accounts with agreement type Enterprise Agreement. */ +export interface SubscriptionEnrollmentDetails { + /** The name of the department */ + departmentDisplayName?: string; + /** The ID that uniquely identifies the department. */ + departmentId?: string; + /** The status of the enrollment account. */ + enrollmentAccountStatus?: string; + /** The name of the enrollment account. */ + enrollmentAccountDisplayName?: string; + /** The ID that uniquely identifies an enrollment account. */ + enrollmentAccountId?: string; +} + +/** A container for a list of resources */ +export interface BillingRequestListResult { /** - * Identifies which services and purchases are paid by a billing profile. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingRelationshipType?: BillingRelationshipType; - /** Billing address. */ - billTo?: AddressDetails; + readonly nextLink?: string; /** - * Identifies the billing profile that is linked to another billing profile in indirect purchase motion. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly indirectRelationshipInfo?: IndirectRelationshipInfo; - /** Flag controlling whether the invoices for the billing profile are sent through email. */ - invoiceEmailOptIn?: boolean; + readonly value?: BillingRequest[]; +} + +/** A request submitted by a user to manage billing. Users with an owner role on the scope can approve or decline these requests. */ +export interface BillingRequestProperties { /** - * The day of the month when the invoice for the billing profile is generated. + * The provisioning state of the resource during a long-running operation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceDay?: number; + readonly provisioningState?: ProvisioningState; + /** Additional information for the billing request. */ + additionalInformation?: { [propertyName: string]: string }; + /** The principal of the request reviewer. Will only be set if request is approved. */ + reviewedBy?: BillingRequestPropertiesReviewedBy; /** - * The currency in which the charges for the billing profile are billed. + * The date and time when the request was reviewed. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly currency?: string; - /** Information about the enabled azure plans. */ - enabledAzurePlans?: AzurePlan[]; - /** The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in $expand. */ - invoiceSections?: InvoiceSectionsOnExpand; + readonly reviewalDate?: Date; /** - * Indicates whether user has read access to the billing profile. + * The fully qualified ID that uniquely identifies a billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly hasReadAccess?: boolean; + readonly billingAccountId?: string; /** - * The system generated unique identifier for a billing profile. + * The ID that uniquely identifies a billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly systemId?: string; + readonly billingAccountName?: string; /** - * The status of the billing profile. + * The name of the billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: BillingProfileStatus; + readonly billingAccountDisplayName?: string; /** - * Reason for the specified billing profile status. + * The primary tenant ID of the billing account for which the billing request was submitted. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly statusReasonCode?: StatusReasonCode; + readonly billingAccountPrimaryBillingTenantId?: string; /** - * The billing profile spending limit. + * The fully qualified ID that uniquely identifies a billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly spendingLimit?: SpendingLimit; + readonly billingProfileId?: string; /** - * Identifies the cloud environments that are associated with a billing profile. This is a system managed optional field and gets updated as the billing profile gets associated with accounts in various clouds. + * The ID that uniquely identifies a billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly targetClouds?: TargetCloud[]; - /** Tags of billing profiles. */ - tags?: { [propertyName: string]: string }; -} - -/** An enrollment account. */ -export interface EnrollmentAccount extends Resource { - /** The name of the enrollment account. */ - accountName?: string; - /** The cost center associated with the enrollment account. */ - costCenter?: string; - /** The owner of the enrollment account. */ - accountOwner?: string; - /** The enrollment account owner email address. */ - accountOwnerEmail?: string; - /** The status of the enrollment account. */ - status?: string; - /** The start date of the enrollment account. */ - startDate?: Date; - /** The end date of the enrollment account. */ - endDate?: Date; - /** Associated department. By default this is not populated, unless it's specified in $expand. */ - department?: Department; -} - -/** A department. */ -export interface Department extends Resource { - /** The name of the department. */ - departmentName?: string; - /** The cost center associated with the department. */ - costCenter?: string; - /** The status of the department. */ - status?: string; - /** Associated enrollment accounts. By default this is not populated, unless it's specified in $expand. */ - enrollmentAccounts?: EnrollmentAccount[]; -} - -/** A billing account. */ -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. */ - soldTo?: AddressDetails; + readonly billingProfileName?: string; /** - * The type of agreement. + * The name of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly agreementType?: AgreementType; + readonly billingProfileDisplayName?: string; + /** The principal of the entity who created the request. */ + createdBy?: BillingRequestPropertiesCreatedBy; /** - * The type of customer. + * The date and time when the request was created. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountType?: AccountType; + readonly creationDate?: Date; /** - * The current status of the billing account. + * The date and time when the request expires. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountStatus?: AccountStatus; - /** The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand. */ - billingProfiles?: BillingProfilesOnExpand; + readonly expirationDate?: Date; + /** The reason to approve or decline the request. */ + decisionReason?: string; /** - * The details about the associated legacy enrollment. By default this is not populated, unless it's specified in $expand. + * The fully qualified ID that uniquely identifies an invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly enrollmentDetails?: Enrollment; - /** The departments associated to the enrollment. */ - departments?: Department[]; - /** The accounts associated to the enrollment. */ - enrollmentAccounts?: EnrollmentAccount[]; + readonly invoiceSectionId?: string; /** - * Indicates whether user has read access to the billing account. + * The ID that uniquely identifies an invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - 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 interface AvailableBalance extends Resource { + readonly invoiceSectionName?: string; /** - * Balance amount. + * The name of the invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly amount?: Amount; -} - -/** An instruction. */ -export interface Instruction extends Resource { - /** The amount budgeted for this billing instruction. */ - amount?: number; - /** The date this billing instruction goes into effect. */ - startDate?: Date; - /** The date this billing instruction is no longer in effect. */ - endDate?: Date; - /** The date this billing instruction was created. */ - creationDate?: Date; -} - -/** A partner's customer. */ -export interface Customer extends Resource { + readonly invoiceSectionDisplayName?: string; /** - * The ID of the billing profile for the invoice section. + * The fully qualified ID that uniquely identifies a customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileId?: string; + readonly customerId?: string; /** - * The name of the billing profile for the invoice section. + * The ID that uniquely identifies a customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileDisplayName?: string; - /** The name of the customer. */ - displayName?: string; - /** Azure plans enabled for the customer. */ - enabledAzurePlans?: AzurePlan[]; - /** The list of resellers for which an Azure plan is enabled for the customer. */ - resellers?: Reseller[]; -} - -/** A billing subscription. */ -export interface BillingSubscription extends Resource { + readonly customerName?: string; /** - * The name of the subscription. + * The name of the customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly displayName?: string; + readonly customerDisplayName?: string; /** - * The ID of the subscription. + * The fully qualified ID that uniquely identifies a billing subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly subscriptionId?: string; - /** The current billing status of the subscription. */ - subscriptionBillingStatus?: BillingSubscriptionStatusType; /** - * The last month charges. + * The ID that uniquely identifies a billing subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastMonthCharges?: Amount; + readonly subscriptionName?: string; /** - * The current month to date charges. + * The name of the billing subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly monthToDateCharges?: Amount; + readonly subscriptionDisplayName?: string; + /** Justification for submitting request. */ + justification?: string; + /** The recipients of the billing request. */ + recipients?: Principal[]; + /** The billing scope for which the request was submitted (ex. '/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}'). */ + requestScope?: string; /** - * The ID of the billing profile to which the subscription is billed. + * The billing scope for which the request will be applied. This is a read only property derived by the service. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileId?: string; + readonly billingScope?: string; + /** Status of billing request. */ + status?: BillingRequestStatus; + /** Type of billing request. */ + type?: BillingRequestType; + /** The principal of the entity who last updated the request. */ + lastUpdatedBy?: BillingRequestPropertiesLastUpdatedBy; /** - * The name of the billing profile to which the subscription is billed. + * Date and time of last update. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileDisplayName?: string; - /** The cost center applied to the subscription. */ - costCenter?: string; + readonly lastUpdatedDate?: Date; +} + +/** A principal who has interacted with a billing entity. */ +export interface Principal { + /** The tenant id of the principal who has interacted with a billing entity. */ + tenantId?: string; + /** The object id of the principal who has interacted with a billing entity. */ + objectId?: string; + /** The user principal name of the principal who has interacted with a billing entity. */ + upn?: string; +} + +/** The properties of the billing role assignment. */ +export interface BillingRoleAssignmentProperties { /** - * The ID of the customer for whom the subscription was created. The field is applicable only for Microsoft Partner Agreement billing account. + * The provisioning state of the resource during a long-running operation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly customerId?: string; + readonly provisioningState?: ProvisioningState; /** - * The name of the customer for whom the subscription was created. The field is applicable only for Microsoft Partner Agreement billing account. + * The date the role assignment was created. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly customerDisplayName?: string; + readonly createdOn?: Date; /** - * The ID of the invoice section to which the subscription is billed. + * The tenant Id of the user who created the role assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceSectionId?: string; + readonly createdByPrincipalTenantId?: string; /** - * The name of the invoice section to which the subscription is billed. + * The object ID of the user who created the role assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceSectionDisplayName?: string; + readonly createdByPrincipalId?: string; /** - * Reseller for this subscription. + * The principal PUID of the user who created the role assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reseller?: Reseller; - /** The sku ID of the Azure plan for the subscription. */ - skuId?: string; + readonly createdByPrincipalPuid?: string; /** - * The sku description of the Azure plan for the subscription. + * The email address of the user who created the role assignment. This is supported only for billing accounts with agreement type Enterprise Agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuDescription?: string; + readonly createdByUserEmailAddress?: string; /** - * The suspension reason for a subscription. Applies only to subscriptions in Microsoft Online Services Program billing accounts. + * The date the role assignment was modified. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly suspensionReasons?: string[]; -} - -/** A product. */ -export interface Product extends Resource { - /** Indicates whether auto renewal is turned on or off for a product. */ - autoRenew?: AutoRenew; + readonly modifiedOn?: Date; /** - * The display name of the product. + * The principal PUID of the user who modified the role assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly displayName?: string; + readonly modifiedByPrincipalPuid?: string; /** - * The date when the product was purchased. + * The email address of the user who modified the role assignment. This is supported only for billing accounts with agreement type Enterprise Agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly purchaseDate?: Date; + readonly modifiedByUserEmailAddress?: string; /** - * The ID of the type of product. + * The principal PUID of the user who modified the role assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly productTypeId?: string; + readonly modifiedByPrincipalId?: string; /** - * The description of the type of product. + * The tenant Id of the user who modified the role assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly productType?: string; - /** The current status of the product. */ - status?: ProductStatusType; + readonly modifiedByPrincipalTenantId?: string; + /** The principal PUID of the user to whom the role was assigned. */ + principalPuid?: string; + /** The object id of the user to whom the role was assigned. */ + principalId?: string; + /** The principal tenant id of the user to whom the role was assigned. */ + principalTenantId?: string; + /** The ID of the role definition. */ + roleDefinitionId: string; + /** The scope at which the role was assigned. */ + scope?: string; + /** The authentication type of the user, whether Organization or MSA, of the user to whom the role was assigned. This is supported only for billing accounts with agreement type Enterprise Agreement. */ + userAuthenticationType?: string; + /** The email address of the user to whom the role was assigned. This is supported only for billing accounts with agreement type Enterprise Agreement. */ + userEmailAddress?: string; /** - * The date when the product will be renewed or canceled. + * The friendly name of the tenant of the user to whom the role was assigned. This will be 'Primary Tenant' for the primary tenant of the billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly endDate?: Date; - /** The frequency at which the product will be billed. */ - billingFrequency?: BillingFrequency; + readonly principalTenantName?: string; /** - * The last month charges. + * The display name of the principal to whom the role was assigned. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastCharge?: Amount; + readonly principalDisplayName?: string; /** - * The date of the last charge. + * The type of a role Assignment. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastChargeDate?: Date; + readonly principalType?: PrincipalType; /** - * The quantity purchased for the product. + * The ID of the billing request that was created for the role assignment. This is only applicable to cross tenant role assignments or role assignments created through the billing request. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly quantity?: number; + readonly billingRequestId?: string; /** - * The sku ID of the product. + * The fully qualified ID that uniquely identifies a billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuId?: string; + readonly billingAccountId?: string; /** - * The sku description of the product. + * The name of the billing account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuDescription?: string; + readonly billingAccountDisplayName?: string; /** - * The id of the tenant in which the product is used. + * The fully qualified ID that uniquely identifies a billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly tenantId?: string; + readonly billingProfileId?: string; /** - * The availability of the product. + * The name of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly availabilityId?: string; + readonly billingProfileDisplayName?: string; /** - * The ID of the invoice section to which the product is billed. + * The fully qualified ID that uniquely identifies an invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly invoiceSectionId?: string; /** - * The name of the invoice section to which the product is billed. + * The name of the invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly invoiceSectionDisplayName?: string; /** - * The ID of the billing profile to which the product is billed. + * The fully qualified ID that uniquely identifies a customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileId?: string; + readonly customerId?: string; /** - * The name of the billing profile to which the product is billed. + * The name of the customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileDisplayName?: string; + readonly customerDisplayName?: string; +} + +/** A container for a list of resources */ +export interface BillingRoleAssignmentListResult { /** - * The ID of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner Agreement billing account. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly customerId?: string; + readonly nextLink?: string; /** - * The name of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner Agreement billing account. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly customerDisplayName?: string; + readonly value?: BillingRoleAssignment[]; +} + +/** The properties of a role definition. */ +export interface BillingRoleDefinitionProperties { /** - * Reseller for this product. + * The role description. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly reseller?: Reseller; -} - -/** An invoice. */ -export interface Invoice extends Resource { + readonly description?: string; /** - * The due date for the invoice. + * The billingPermissions the role has. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly dueDate?: Date; + readonly permissions?: BillingPermission[]; + /** The name of the role. */ + roleName: string; +} + +/** A container for a list of resources */ +export interface BillingRoleDefinitionListResult { /** - * The date when the invoice was generated. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceDate?: Date; + readonly nextLink?: string; /** - * The current status of the invoice. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: InvoiceStatus; + readonly value?: BillingRoleDefinition[]; +} + +/** The SKU to be applied for this resource */ +export interface Sku { + /** Name of the SKU to be applied */ + name?: string; +} + +/** Information describing the type of billing plan for this savings plan. */ +export interface BillingPlanInformation { + /** Amount of money to be paid for the Order. Tax is not included. */ + pricingCurrencyTotal?: Price; + /** Date when the billing plan has started. */ + startDate?: Date; + /** For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. */ + nextPaymentDueDate?: Date; + transactions?: PaymentDetail[]; +} + +/** The price. */ +export interface Price { + /** The ISO 4217 3-letter currency code for the currency used by this purchase record. */ + currencyCode?: string; + amount?: number; +} + +/** Information about payment related to a savings plan order. */ +export interface PaymentDetail { + /** Date when the payment needs to be done. */ + dueDate?: Date; + /** Date when the transaction is completed. Null when it is scheduled. */ + paymentDate?: Date; + /** Amount in pricing currency. Tax not included. */ + pricingCurrencyTotal?: Price; + /** Amount charged in Billing currency. Tax not included. Is null for future payments */ + billingCurrencyTotal?: Price; + /** Describes whether the payment is completed, failed, pending, cancelled or scheduled in the future. */ + status?: PaymentStatus; /** - * The amount due as of now. + * Extended status information * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly amountDue?: Amount; + readonly extendedStatusInfo?: ExtendedStatusInfo; +} + +/** Extended status information */ +export interface ExtendedStatusInfo { + /** Status code providing additional information. */ + statusCode?: string; + /** The message giving detailed information about the status code. */ + message?: string; + /** The subscription that has failed credit line check. */ + subscriptionId?: string; +} + +/** List of savings plan orders */ +export interface SavingsPlanOrderModelList { + value?: SavingsPlanOrderModel[]; + /** Url to get the next page. */ + nextLink?: string; +} + +/** List of savings plans */ +export interface SavingsPlanModelList { + value?: SavingsPlanModel[]; + /** Url to get the next page. */ + nextLink?: string; +} + +/** Properties specific to renew. */ +export interface RenewProperties { + /** Purchase request. */ + purchaseProperties?: PurchaseRequest; +} + +/** Purchase request. */ +export interface PurchaseRequest { + /** The SKU to be applied for this resource */ + sku?: Sku; + /** Friendly name of the savings plan */ + displayName?: string; + /** Subscription that will be charged for purchasing SavingsPlan */ + billingScopeId?: string; + /** Represents the Savings plan term in ISO 8601 format. */ + term?: SavingsPlanTerm; + /** Represents the billing plan in ISO 8601 format. Required only for monthly purchases. */ + billingPlan?: BillingPlan; + /** Type of the Applied Scope. */ + appliedScopeType?: AppliedScopeType; + /** Commitment towards the benefit. */ + commitment?: Commitment; + /** Setting this to true will automatically purchase a new benefit on the expiration date time. */ + renew?: boolean; + /** Properties specific to applied scope type. Not required if not applicable. */ + appliedScopeProperties?: AppliedScopeProperties; +} + +/** Properties specific to applied scope type. Not required if not applicable. */ +export interface AppliedScopeProperties { + /** Tenant ID where the savings plan where the benefit is applied. */ + tenantId?: string; + /** Fully-qualified identifier of the management group where the benefit is applied. */ + managementGroupId?: string; + /** Fully-qualified identifier of the subscription where the benefit is applied. */ + subscriptionId?: string; + /** Fully-qualified identifier of the resource group where the benefit is applied. */ + resourceGroupId?: string; + /** Display name */ + displayName?: string; +} + +/** Savings plan utilization */ +export interface Utilization { /** - * The amount of Azure prepayment applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + * The trend for a savings plan's utilization * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly azurePrepaymentApplied?: Amount; + readonly trend?: string; + /** The array of aggregates of a savings plan's utilization */ + aggregates?: UtilizationAggregates[]; +} + +/** The aggregate values of savings plan utilization */ +export interface UtilizationAggregates { /** - * The total charges for the invoice billing period. + * The grain of the aggregate * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billedAmount?: Amount; + readonly grain?: number; /** - * The total refund for returns and cancellations during the invoice billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + * The grain unit of the aggregate * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly creditAmount?: Amount; + readonly grainUnit?: string; /** - * The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + * The aggregate value * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly freeAzureCreditApplied?: Amount; + readonly value?: number; /** - * The pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + * The aggregate value unit * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subTotal?: Amount; + readonly valueUnit?: string; +} + +/** List of savings plans */ +export interface SavingsPlanModelListResult { + value?: SavingsPlanModel[]; + /** Url to get the next page. */ + nextLink?: string; + /** The roll out count summary of the savings plans */ + summary?: SavingsPlanSummaryCount; +} + +/** The roll up count summary of savings plans in each state */ +export interface SavingsPlanSummaryCount { /** - * The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + * The number of savings plans in Succeeded state * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly taxAmount?: Amount; + readonly succeededCount?: number; /** - * The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + * The number of savings plans in Failed state * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalAmount?: Amount; + readonly failedCount?: number; /** - * The start date of the billing period for which the invoice is generated. + * The number of savings plans in Expiring state * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoicePeriodStartDate?: Date; + readonly expiringCount?: number; /** - * The end date of the billing period for which the invoice is generated. + * The number of savings plans in Expired state * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoicePeriodEndDate?: Date; + readonly expiredCount?: number; /** - * Invoice type. + * The number of savings plans in Pending state * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceType?: InvoiceType; + readonly pendingCount?: number; /** - * Specifies if the invoice is generated as part of monthly invoicing cycle or not. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + * The number of savings plans in Cancelled state * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isMonthlyInvoice?: boolean; + readonly cancelledCount?: number; /** - * The ID of the billing profile for which the invoice is generated. + * The number of savings plans in Processing state * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileId?: string; + readonly processingCount?: number; /** - * The name of the billing profile for which the invoice is generated. + * The number of savings plans in No Benefit state * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileDisplayName?: string; + readonly noBenefitCount?: number; /** - * An optional purchase order number for the invoice. + * The number of savings plans in Warning state * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly purchaseOrderNumber?: string; + readonly warningCount?: number; +} + +/** Savings plan patch request */ +export interface SavingsPlanUpdateRequest { + /** Savings plan patch request */ + properties?: SavingsPlanUpdateRequestProperties; + /** The SKU to be applied for this resource */ + sku?: Sku; + /** Tags for this reservation */ + tags?: { [propertyName: string]: string }; +} + +/** Savings plan patch request */ +export interface SavingsPlanUpdateRequestProperties { + /** Display name */ + displayName?: string; + /** Type of the Applied Scope. */ + appliedScopeType?: AppliedScopeType; + /** Properties specific to applied scope type. Not required if not applicable. */ + appliedScopeProperties?: AppliedScopeProperties; + /** Setting this to true will automatically purchase a new benefit on the expiration date time. */ + renew?: boolean; + /** Properties specific to renew. */ + renewProperties?: RenewProperties; +} + +/** Savings plan update validate request. */ +export interface SavingsPlanUpdateValidateRequest { + /** The benefits of a savings plan. */ + benefits?: SavingsPlanUpdateRequestProperties[]; +} + +/** Savings plan update validate response. */ +export interface SavingsPlanValidateResponse { + benefits?: SavingsPlanValidResponseProperty[]; + /** Url to get the next page. */ + nextLink?: string; +} + +/** Benefit scope response property */ +export interface SavingsPlanValidResponseProperty { + /** Indicates if the provided input is valid */ + valid?: boolean; + /** Failure reason code if the provided input is invalid */ + reasonCode?: string; + /** Failure reason if the provided input is invalid */ + reason?: string; +} + +/** The billing properties of a subscription. */ +export interface BillingSubscriptionProperties { + /** Indicates whether auto renewal is turned on or off for a product. */ + autoRenew?: AutoRenew; + /** The provisioning tenant of the subscription. */ + beneficiaryTenantId?: string; + /** The beneficiary of the billing subscription. */ + beneficiary?: Beneficiary; + /** The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y */ + billingFrequency?: string; + /** The fully qualified ID that uniquely identifies a billing profile. */ + billingProfileId?: string; /** - * List of documents available to download such as invoice and tax receipt. + * Dictionary of billing policies associated with the subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly documents?: Document[]; + readonly billingPolicies?: { [propertyName: string]: string }; /** - * List of payments. + * The name of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly payments?: PaymentProperties[]; + readonly billingProfileDisplayName?: string; /** - * Rebill details for an invoice. + * The ID that uniquely identifies a billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly rebillDetails?: { [propertyName: string]: RebillDetails }; + readonly billingProfileName?: string; + /** The cost center applied to the subscription. This field is only available for consumption subscriptions of Microsoft Customer Agreement or Enterprise Agreement Type billing accounts. */ + consumptionCostCenter?: string; + /** The fully qualified ID that uniquely identifies a customer. */ + customerId?: string; /** - * The type of the document. + * The name of the customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly documentType?: InvoiceDocumentType; + readonly customerDisplayName?: string; /** - * The Id of the active invoice which is originally billed after this invoice was voided. This field is applicable to the void invoices only. + * The ID that uniquely identifies a customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billedDocumentId?: string; + readonly customerName?: string; + /** The name of the billing subscription. */ + displayName?: string; /** - * The Id of the invoice which got voided and this credit note was issued as a result. This field is applicable to the credit notes only. + * The enrollment Account ID associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly creditForDocumentId?: string; + readonly enrollmentAccountId?: string; /** - * The ID of the subscription for which the invoice is generated. + * The enrollment Account name associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionId?: string; -} - -/** A transaction. */ -export interface Transaction extends Resource { - /** The kind of transaction. Options are all or reservation. */ - kind?: TransactionTypeKind; + readonly enrollmentAccountDisplayName?: string; + /** The fully qualified ID that uniquely identifies an invoice section. */ + invoiceSectionId?: string; /** - * The date of transaction. + * The name of the invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly date?: Date; + readonly invoiceSectionDisplayName?: string; /** - * Invoice on which the transaction was billed or 'pending' if the transaction is not billed. + * The ID that uniquely identifies an invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoice?: string; + readonly invoiceSectionName?: string; /** - * The ID of the invoice on which the transaction was billed. This field is only applicable for transactions which are billed. + * The last month's charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceId?: string; + readonly lastMonthCharges?: Amount; /** - * The order ID of the reservation. The field is only applicable for transaction of kind reservation. + * The current month to date charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly orderId?: string; + readonly monthToDateCharges?: Amount; /** - * The name of the reservation order. The field is only applicable for transactions of kind reservation. + * Next billing cycle details of the subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly orderName?: string; + readonly nextBillingCycleDetails?: NextBillingCycleDetails; /** - * The family of the product for which the transaction took place. + * The offer ID for the subscription. This field is only available for the Microsoft Online Services Program billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly productFamily?: string; + readonly offerId?: string; /** - * The ID of the product type for which the transaction took place. + * The category of the product for which the subscription is purchased. Possible values include: AzureSupport, Hardware, ReservationOrder, SaaS, SavingsPlanOrder, Software, UsageBased, Other. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly productTypeId?: string; + readonly productCategory?: string; /** - * The type of the product for which the transaction took place. + * Type of the product for which the subscription is purchased. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly productType?: string; + /** Id of the product for which the subscription is purchased. */ + productTypeId?: string; /** - * The description of the product for which the transaction took place. + * Purchase date of the product in UTC time. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly productDescription?: string; - /** The type of transaction. */ - transactionType?: ReservationType; + readonly purchaseDate?: Date; + /** The quantity of licenses or fulfillment units for the subscription. */ + quantity?: number; /** - * The charge associated with the transaction. + * Reseller for this subscription. The fields is not available for Microsoft Partner Agreement billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly transactionAmount?: Amount; + readonly reseller?: Reseller; /** - * The quantity purchased in the transaction. + * Details for the next renewal term of a subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly quantity?: number; + readonly renewalTermDetails?: RenewalTermDetails; + /** The SKU ID of the product for which the subscription is purchased. This field is is only available for Microsoft Customer Agreement billing accounts. */ + skuId?: string; /** - * The ID of the invoice section which will be billed for the transaction. + * The SKU description of the product for which the subscription is purchased. This field is is only available for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceSectionId?: string; + readonly skuDescription?: string; + /** System imposed policies that regulate behavior of the subscription. */ + systemOverrides?: SystemOverrides; /** - * The name of the invoice section which will be billed for the transaction. + * Unique identifier of the linked resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceSectionDisplayName?: string; + readonly resourceUri?: string; + /** The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y */ + termDuration?: string; /** - * The ID of the billing profile which will be billed for the transaction. + * Start date of the term in UTC time. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileId?: string; + readonly termStartDate?: Date; /** - * The name of the billing profile which will be billed for the transaction. + * End date of the term in UTC time. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileDisplayName?: string; + readonly termEndDate?: Date; + /** The tenant in which the subscription is provisioned. */ + provisioningTenantId?: string; /** - * The ID of the customer for which the transaction took place. The field is applicable only for Microsoft Partner Agreement billing account. + * The status of the subscription. This field is not available for Enterprise Agreement billing accounts * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly customerId?: string; + readonly status?: BillingSubscriptionStatus; /** - * The name of the customer for which the transaction took place. The field is applicable only for Microsoft Partner Agreement billing account. + * The status of an operation on the subscription. When None, there is no ongoing operation. When LockedForUpdate, write operations will be blocked on the Billing Subscription. Other is the default value and you may need to refer to the latest API version for more details. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly customerDisplayName?: string; + readonly operationStatus?: BillingSubscriptionOperationStatus; /** - * The ID of the subscription that was used for the transaction. The field is only applicable for transaction of kind reservation. + * The provisioning state of the resource during a long-running operation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionId?: string; + readonly provisioningState?: ProvisioningState; /** - * The name of the subscription that was used for the transaction. The field is only applicable for transaction of kind reservation. + * The ID of the subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subscriptionName?: string; + readonly subscriptionId?: string; /** - * The type of azure plan of the subscription that was used for the transaction. + * The suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly azurePlan?: string; + readonly suspensionReasons?: string[]; /** - * The amount of any Azure credits automatically applied to this transaction. + * The suspension details for a subscription. This field is not available for Enterprise Agreement billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly azureCreditApplied?: Amount; + readonly suspensionReasonDetails?: BillingSubscriptionStatusDetails[]; /** - * The ISO 4217 code for the currency in which this transaction is billed. + * The enrollment Account and the subscription association start date. This field is available only for the Enterprise Agreement Type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingCurrency?: string; + readonly enrollmentAccountStartDate?: Date; /** - * The percentage discount, if any, applied to this transaction. + * The current enrollment account status of the subscription. This field is available only for the Enterprise Agreement Type. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly discount?: number; + readonly subscriptionEnrollmentAccountStatus?: SubscriptionEnrollmentAccountStatus; +} + +/** Details of the beneficiary. */ +export interface Beneficiary { + /** The ID that uniquely identifies a tenant. */ + tenantId?: string; + /** The ID that uniquely identifies a user in a tenant. */ + objectId?: string; +} + +/** Billing cycle details of the product. */ +export interface NextBillingCycleDetails { /** - * The price of the product after applying any discounts. + * Billing frequency of the product under the subscription. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly effectivePrice?: Amount; + readonly billingFrequency?: string; +} + +/** Details of the reseller. */ +export interface Reseller { /** - * The exchange rate used to convert charged amount to billing currency, if applicable. + * The MPN ID of the reseller. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly exchangeRate?: number; + readonly resellerId?: string; /** - * The retail price of the product. + * The name of the reseller. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly marketPrice?: Amount; + readonly description?: string; +} + +/** Details for the next renewal term of a subscription. */ +export interface RenewalTermDetails { /** - * The ISO 4217 code for the currency in which the product is priced. + * The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly pricingCurrency?: string; + readonly billingFrequency?: string; /** - * The date of the purchase of the product, or the start date of the month in which usage started. + * Id of the product for which the subscription is purchased. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly servicePeriodStartDate?: Date; + readonly productId?: string; /** - * The end date of the product term, or the end date of the month in which usage ended. + * Type Id of the product for which the subscription is purchased. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly servicePeriodEndDate?: Date; + readonly productTypeId?: string; /** - * The pre-tax charged amount for the transaction. + * The SKU ID of the product for which the subscription is purchased. This field is is only available for Microsoft Customer Agreement billing accounts. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly subTotal?: Amount; + readonly skuId?: string; /** - * The tax amount applied to the transaction. + * The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly tax?: Amount; + readonly termDuration?: string; + /** The quantity of licenses or fulfillment units for the subscription. */ + quantity?: number; /** - * The unit of measure used to bill for the product. For example, compute services are billed per hour. + * End date of the term in UTC time. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unitOfMeasure?: string; + readonly termEndDate?: Date; +} + +/** System imposed policies that regulate behavior of the subscription. */ +export interface SystemOverrides { /** - * The number of units used for a given product. + * The policy override for the subscription indicates whether the self-serve cancellation or seat reduction is allowed. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly units?: number; + readonly cancellation?: Cancellation; /** - * The description for the unit of measure for a given product. + * The end date in UTC time by when the self-serve cancellation ends. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unitType?: string; -} - -/** A policy. */ -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 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; + readonly cancellationAllowedEndDate?: Date; } -/** A billing property. */ -export interface BillingProperty extends Resource { +/** A container for a list of resources */ +export interface BillingSubscriptionListResult { /** - * The email address on which the account admin gets all Azure notifications. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly accountAdminNotificationEmailAddress?: string; + readonly nextLink?: string; /** - * The Azure AD tenant ID of the billing account for the subscription. + * Total number of records. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingTenantId?: string; + readonly totalCount?: number; /** - * The ID of the billing account to which the subscription is billed. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingAccountId?: string; + readonly value?: BillingSubscription[]; +} + +/** A container for a list of resources */ +export interface BillingSubscriptionAliasListResult { /** - * The name of the billing account to which the subscription is billed. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingAccountDisplayName?: string; + readonly nextLink?: string; /** - * The ID of the billing profile to which the subscription is billed. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileId?: string; + readonly value?: BillingSubscriptionAlias[]; +} + +/** Request parameters for cancel customer subscription. */ +export interface CancelSubscriptionRequest { + /** Cancellation reason. */ + cancellationReason: CancellationReason; + /** The fully qualified ID that uniquely identifies a customer. */ + customerId?: string; +} + +/** Request parameters that are provided to merge the two billing subscriptions. */ +export interface BillingSubscriptionMergeRequest { + /** The ID of the target billing subscription that will be merged with the source subscription provided in the request. */ + targetBillingSubscriptionName?: string; + /** The quantity of the source billing subscription that will be merged with the target billing subscription. */ + quantity?: number; +} + +/** Request parameters to transfer billing subscription. */ +export interface MoveBillingSubscriptionRequest { + /** The destination invoice section id. */ + destinationInvoiceSectionId?: string; + /** The destination enrollment account id. */ + destinationEnrollmentAccountId?: string; +} + +/** Request parameters that are provided to split the billing subscription. */ +export interface BillingSubscriptionSplitRequest { + /** The ID of the target product to which the subscription needs to be split into. This value is not same as the value returned in Get API call and can be retrieved from Catalog API to know the product id to split into. */ + targetProductTypeId?: string; + /** The ID of the target product to which the subscription needs to be split into. This value is not same as the value returned in Get API call and can be retrieved from Catalog API to know the sku id to split into. */ + targetSkuId?: string; + /** The quantity of the target product to which the subscription needs to be split into. */ + quantity?: number; + /** The term duration of the target in ISO8601 format product to which the subscription needs to be split into. Example: P1M, P1Y */ + termDuration?: string; + /** The billing frequency of the target subscription in the ISO8601 format. Example: P1M, P3M, P1Y" */ + billingFrequency?: string; +} + +/** Result of the transfer eligibility validation. */ +export interface MoveBillingSubscriptionEligibilityResult { /** - * The name of the billing profile to which the subscription is billed. + * Specifies whether the subscription is eligible to be transferred. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileDisplayName?: string; + readonly isMoveEligible?: boolean; + /** Error details of the transfer eligibility validation. */ + errorDetails?: MoveBillingSubscriptionErrorDetails; +} + +/** Error details of the transfer eligibility validation. */ +export interface MoveBillingSubscriptionErrorDetails { + /** Error code of the transfer validation response. */ + code?: SubscriptionTransferValidationErrorCode; + /** The error message. */ + message?: string; + /** Detailed error message explaining the error. */ + details?: string; +} + +/** A partner's customer. */ +export interface CustomerProperties { /** - * The status of the billing profile. + * The name of the billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileStatus?: BillingProfileStatus; + readonly billingProfileDisplayName?: string; /** - * Reason for the specified billing profile status. + * The fully qualified ID that uniquely identifies a billing profile. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileStatusReasonCode?: BillingProfileStatusReasonCode; + readonly billingProfileId?: string; /** - * The billing profile spending limit. + * The name of the customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingProfileSpendingLimit?: BillingProfileSpendingLimit; - /** The cost center applied to the subscription. */ - costCenter?: string; + readonly displayName?: string; /** - * The ID of the invoice section to which the subscription is billed. + * The system generated unique identifier for a customer. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceSectionId?: string; + readonly systemId?: string; /** - * The name of the invoice section to which the subscription is billed. + * Identifies the status of an customer. This is an upcoming property that will be populated in the future. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly invoiceSectionDisplayName?: string; + readonly status?: CustomerStatus; + /** Azure plans enabled for the customer. */ + enabledAzurePlans?: AzurePlan[]; + /** The list of resellers for which an Azure plan is enabled for the customer. */ + resellers?: Reseller[]; + /** Dictionary of metadata associated with the resource. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / */ + tags?: { [propertyName: string]: string }; +} + +/** A container for a list of resources */ +export interface CustomerListResult { /** - * Indicates whether user is the account admin. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isAccountAdmin?: boolean; + readonly nextLink?: string; /** - * The product ID of the Azure plan. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly productId?: string; + readonly value?: Customer[]; +} + +/** Optional grouping of enrollment accounts to segment costs into logical groupings and set budgets. */ +export interface DepartmentProperties { + /** The cost center associated with the department. */ + costCenter?: string; + /** The name of the department. */ + displayName?: string; /** - * The product name of the Azure plan. + * The ID that uniquely identifies the department. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly productName?: string; + readonly id?: string; /** - * The sku ID of the Azure plan for the subscription. + * The status of the department. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuId?: string; + readonly status?: string; +} + +/** A container for a list of resources */ +export interface DepartmentListResult { /** - * The sku description of the Azure plan for the subscription. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly skuDescription?: string; + readonly nextLink?: string; + /** + * The list of resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Department[]; } -/** The properties of a role definition. */ -export interface BillingRoleDefinition extends Resource { +/** It is an organizational hierarchy within a billing account to administer and manage azure costs. */ +export interface EnrollmentAccountProperties { + /** The cost center associated with the enrollment account. */ + costCenter?: string; + /** The name of the enrollment account. */ + displayName?: string; /** - * The role description + * The name of the department under which the enrollment account exists. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly description?: string; - /** The billingPermissions the role has */ - permissions?: BillingPermissionsProperties[]; + readonly departmentDisplayName?: string; + /** + * The ID that uniquely identifies the department. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly departmentId?: string; + /** Boolean flag which enables subscribers to run development and testing workloads on Azure at special Dev/Test rates. */ + isDevTestEnabled?: boolean; + /** + * The owner of the enrollment account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountOwner?: string; /** - * The name of the role + * The authorization type of the enrollment account. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly roleName?: string; + readonly authType?: string; + /** + * The status of the enrollment account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The date from which the enrollment account became valid and functional. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startDate?: Date; + /** + * The date of expiration of the enrollment account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endDate?: Date; } -/** The role assignment */ -export interface BillingRoleAssignment extends Resource { +/** A container for a list of resources */ +export interface EnrollmentAccountListResult { /** - * The date the role assignment was created. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdOn?: string; + readonly nextLink?: string; /** - * The tenant Id of the user who created the role assignment. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdByPrincipalTenantId?: string; + readonly value?: EnrollmentAccount[]; +} + +/** A container for a list of resources */ +export interface InvoiceListResult { /** - * The principal Id of the user who created the role assignment. + * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdByPrincipalId?: string; + readonly nextLink?: string; /** - * The email address of the user who created the role assignment. + * The list of resources. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdByUserEmailAddress?: string; - /** The principal id of the user to whom the role was assigned. */ - principalId?: string; - /** The principal tenant id of the user to whom the role was assigned. */ - principalTenantId?: string; - /** The ID of the role definition. */ - roleDefinitionId?: string; + readonly value?: Invoice[]; +} + +/** An invoice. */ +export interface InvoiceProperties { + /** The amount due as of now. */ + amountDue?: InvoicePropertiesAmountDue; + /** The amount of Azure prepayment applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ + azurePrepaymentApplied?: InvoicePropertiesAzurePrepaymentApplied; + /** The total charges for the invoice billing period. */ + billedAmount?: InvoicePropertiesBilledAmount; /** - * The scope at which the role was assigned. + * The Id of the active invoice which is originally billed after this invoice was voided. This field is applicable to the void invoices only. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly scope?: string; - /** The authentication type. */ - userAuthenticationType?: string; - /** The email address of the user. */ - userEmailAddress?: string; + readonly billedDocumentId?: string; + /** + * The name of the billing profile for which the invoice is generated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileDisplayName?: string; + /** + * The ID of the billing profile for which the invoice is generated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileId?: string; + /** The total refund for returns and cancellations during the invoice billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ + creditAmount?: InvoicePropertiesCreditAmount; + /** + * The Id of the invoice which got voided and this credit note was issued as a result. This field is applicable to the credit notes only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creditForDocumentId?: string; + /** + * List of documents available to download and view such as invoice, credit note, or tax receipt. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly documents?: InvoiceDocument[]; + /** + * The type of the document. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly documentType?: InvoiceDocumentType; + /** + * The due date for the invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dueDate?: Date; + /** + * List of failed payments. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failedPayments?: FailedPayment[]; + /** The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ + freeAzureCreditApplied?: InvoicePropertiesFreeAzureCreditApplied; + /** + * The date when the invoice was generated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceDate?: Date; + /** + * The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoicePeriodEndDate?: Date; + /** + * The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoicePeriodStartDate?: Date; + /** + * Invoice type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceType?: InvoiceType; + /** + * Specifies if the invoice is generated as part of monthly invoicing cycle or not. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isMonthlyInvoice?: boolean; + /** + * List of payments. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly payments?: Payment[]; + /** + * An optional purchase order number for the invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly purchaseOrderNumber?: string; + /** Rebill details for an invoice. */ + rebillDetails?: InvoicePropertiesRebillDetails; + /** + * The current status of the invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: InvoiceStatus; + /** + * The name of the billing subscription for which the invoice is generated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionDisplayName?: string; + /** + * The ID of the subscription for which the invoice is generated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** + * Identifies the type of tax calculation used for the invoice. The field is applicable only to invoices with special tax calculation logic. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly specialTaxationType?: SpecialTaxationType; + /** The pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ + subTotal?: InvoicePropertiesSubTotal; + /** The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ + taxAmount?: InvoicePropertiesTaxAmount; + /** The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ + totalAmount?: InvoicePropertiesTotalAmount; + /** The details of a refund request. */ + refundDetails?: InvoicePropertiesRefundDetails; } -/** An agreement. */ -export interface Agreement extends Resource { +/** The properties of a document. */ +export interface InvoiceDocument { /** - * The URL to download the agreement. + * The document numbers for the invoice document. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly agreementLink?: string; + readonly documentNumbers?: string[]; /** - * The category of the agreement signed by a customer. + * The URL to download the invoice document if the source is external to Microsoft.Billing. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly category?: Category; + readonly externalUrl?: string; /** - * The mode of acceptance for an agreement. + * The type of the document. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly acceptanceMode?: AcceptanceMode; + readonly kind?: InvoiceDocumentType; /** - * The date from which the agreement is effective. + * The ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit note, or a tax receipt. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly effectiveDate?: Date; + readonly name?: string; /** - * The date when the agreement expires. + * The URL to download the invoice document if the source is internal to Microsoft.Billing. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly expirationDate?: Date; - /** The list of participants that participates in acceptance of an agreement. */ - participants?: Participants[]; + readonly url?: string; /** - * The current status of the agreement. + * The source of the document. ENF for Brazil and DRS for rest of the world. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: string; + readonly source?: DocumentSource; } -/** An enrollment account resource. */ -export interface EnrollmentAccountSummary extends Resource { +/** A failed payment. */ +export interface FailedPayment { + /** + * The date when the payment was attempted. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly date?: Date; /** - * The account owner's principal name. + * The reason that the payment failed. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalName?: string; + readonly failedPaymentReason?: FailedPaymentReason; } -/** A billing period resource. */ -export interface BillingPeriod extends Resource { +/** An invoice payment. */ +export interface Payment { + /** The paid amount. */ + amount?: PaymentAmount; /** - * The start of the date range covered by the billing period. + * The date when the payment was made. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodStartDate?: Date; + readonly date?: Date; /** - * The end of the date range covered by the billing period. + * The ID that uniquely identifies the payment method used for the invoice. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly billingPeriodEndDate?: Date; + readonly paymentMethodId?: string; /** - * Array of invoice ids that associated with. + * The family of payment method. * 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 { - /** Location URI to poll for result */ - location?: string; - /** Recommended time to wait before making another request to check the status of the operation. The time is specified in seconds. */ - retryAfter?: number; + readonly paymentMethodFamily?: PaymentMethodFamily; + /** + * The type of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly paymentMethodType?: string; + /** + * The type of payment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly paymentType?: string; } -/** Defines headers for InvoiceSections_createOrUpdate operation. */ -export interface InvoiceSectionsCreateOrUpdateHeaders { - /** Location URI to poll for result */ - location?: string; - /** Recommended time to wait before making another request to check the status of the operation. The time is specified in seconds. */ - retryAfter?: number; +/** The rebill details of an invoice. */ +export interface RebillDetails { + /** + * The ID of invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceDocumentId?: string; + /** + * The ID of credit note. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creditNoteDocumentId?: string; + /** + * The rebill details of an invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly rebillDetails?: RebillDetails; } -/** Defines headers for BillingSubscriptions_move operation. */ -export interface BillingSubscriptionsMoveHeaders { - /** Location URI to poll for result. */ - location?: string; - /** Recommended time to wait before making another request to check the status of the operation. The time is specified in seconds. */ - retryAfter?: number; +/** The details of refund request. */ +export interface RefundDetailsSummary { + /** + * Date when the refund was requested. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requestedOn?: Date; + /** + * Date when the refund was approved. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly approvedOn?: Date; + /** + * Date when the refund was completed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly completedOn?: Date; + /** The amount of refund requested. */ + amountRequested?: RefundDetailsSummaryAmountRequested; + /** The amount refunded. */ + amountRefunded?: RefundDetailsSummaryAmountRefunded; + /** + * The invoice ID of the rebill invoice for a refund. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly rebillInvoiceId?: string; + /** + * The number of transactions refunded. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly transactionCount?: number; + /** + * The status of refund request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly refundStatus?: RefundStatus; + /** + * The ID of refund operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly refundOperationId?: string; + /** + * The reason for refund. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly refundReason?: RefundReasonCode; } -/** Defines headers for Products_move operation. */ -export interface ProductsMoveHeaders { - /** Location URI to poll for result */ - location?: string; - /** Recommended time to wait before making another request to check the status of the operation. The time is specified in seconds. */ - retryAfter?: number; +/** A list of download details for individual documents. */ +export interface DocumentDownloadRequest { + /** The ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit note, or a tax receipt. If omitted, the most recent invoice PDF for the invoice will be returned. */ + documentName?: string; + /** The ID that uniquely identifies an invoice. */ + invoiceName?: string; } -/** Defines headers for Invoices_downloadInvoice operation. */ -export interface InvoicesDownloadInvoiceHeaders { - /** GET this URL to retrieve the status of the asynchronous operation. */ - location?: string; - /** The amount of delay to use while the status of the operation is checked. The value is expressed in seconds. */ - retryAfter?: string; -} +/** A secure URL that can be used to download a an entity until the URL expires. */ +export interface DocumentDownloadResult { + /** + * The time in UTC when the download URL will expire. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiryTime?: string; + /** + * The URL to the PDF or .zip file. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly url?: string; +} -/** Defines headers for Invoices_downloadMultipleBillingProfileInvoices operation. */ -export interface InvoicesDownloadMultipleBillingProfileInvoicesHeaders { - /** GET this URL to retrieve the status of the asynchronous operation. */ - location?: string; - /** The amount of delay to use while the status of the operation is checked. The value is expressed in seconds. */ - retryAfter?: string; +/** Eligibility to delete an invoice section result. */ +export interface DeleteInvoiceSectionEligibilityResult { + /** Status describing if invoice section is eligible to be deleted. */ + eligibilityStatus?: DeleteInvoiceSectionEligibilityStatus; + /** A list of delete invoice section eligibility result details. */ + eligibilityDetails?: DeleteInvoiceSectionEligibilityDetail[]; } -/** Defines headers for Invoices_downloadBillingSubscriptionInvoice operation. */ -export interface InvoicesDownloadBillingSubscriptionInvoiceHeaders { - /** GET this URL to retrieve the status of the asynchronous operation. */ - location?: string; - /** The amount of delay to use while the status of the operation is checked. The value is expressed in seconds. */ - retryAfter?: string; +/** The details of delete invoice section eligibility result. */ +export interface DeleteInvoiceSectionEligibilityDetail { + /** Code for the delete invoice section validation. */ + code?: DeleteInvoiceSectionEligibilityCode; + /** Validation message. */ + message?: string; } -/** Defines headers for Invoices_downloadMultipleBillingSubscriptionInvoices operation. */ -export interface InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders { - /** GET this URL to retrieve the status of the asynchronous operation. */ - location?: string; - /** The amount of delay to use while the status of the operation is checked. The value is expressed in seconds. */ - retryAfter?: string; +/** An invoice section. */ +export interface InvoiceSectionProperties { + /** + * The provisioning state of the resource during a long-running operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The name of the invoice section. */ + displayName?: string; + /** Identifies the status of an invoice section. */ + state?: InvoiceSectionState; + /** Reason for the specified invoice section status. */ + reasonCode?: InvoiceSectionStateReasonCode; + /** + * The system generated unique identifier for an invoice section. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemId?: string; + /** Identifies the cloud environments that are associated with an invoice section. This is a system managed optional field and gets updated as the invoice section gets associated with accounts in various clouds. */ + targetCloud?: string; + /** Dictionary of metadata associated with the resource. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / */ + tags?: { [propertyName: string]: string }; } -/** Known values of {@link AgreementType} that the service accepts. */ -export enum KnownAgreementType { - /** MicrosoftCustomerAgreement */ - MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", - /** EnterpriseAgreement */ - EnterpriseAgreement = "EnterpriseAgreement", - /** MicrosoftOnlineServicesProgram */ - MicrosoftOnlineServicesProgram = "MicrosoftOnlineServicesProgram", - /** MicrosoftPartnerAgreement */ - MicrosoftPartnerAgreement = "MicrosoftPartnerAgreement" +/** A container for a list of resources */ +export interface InvoiceSectionListResult { + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** + * The list of resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: InvoiceSection[]; } -/** - * Defines values for AgreementType. \ - * {@link KnownAgreementType} can be used interchangeably with AgreementType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **MicrosoftCustomerAgreement** \ - * **EnterpriseAgreement** \ - * **MicrosoftOnlineServicesProgram** \ - * **MicrosoftPartnerAgreement** - */ -export type AgreementType = string; +/** A container for a list of resources */ +export interface OperationListResult { + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** + * The list of resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; +} -/** Known values of {@link AccountType} that the service accepts. */ -export enum KnownAccountType { - /** Enterprise */ - Enterprise = "Enterprise", - /** Individual */ - Individual = "Individual", - /** Partner */ - Partner = "Partner" +/** Details of a REST API operation, returned from the Resource Provider Operations API. */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; } -/** - * Defines values for AccountType. \ - * {@link KnownAccountType} can be used interchangeably with AccountType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enterprise** \ - * **Individual** \ - * **Partner** - */ -export type AccountType = string; +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: 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" +/** The list of payment method links. */ +export interface PaymentMethodLinksListResult { + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** + * The list of payment method links. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: PaymentMethodLink[]; } -/** - * Defines values for AccountStatus. \ - * {@link KnownAccountStatus} can be used interchangeably with AccountStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Active** \ - * **Deleted** \ - * **Disabled** \ - * **Expired** \ - * **Transferred** \ - * **Extended** \ - * **Terminated** - */ -export type AccountStatus = string; +/** Logo of payment method. */ +export interface PaymentMethodLogo { + /** + * MIME type of the logo. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly mimeType?: string; + /** + * Public URL of image of the logo. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly url?: 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" +/** The properties of a payment method. */ +export interface PaymentMethodProperties { + /** + * Id of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The account holder name for the payment method. This is only supported for payment methods with family CreditCard. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountHolderName?: string; + /** + * The display name of the payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * The expiration month and year of the payment method. This is only supported for payment methods with family CreditCard. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiration?: string; + /** The family of payment method. */ + family?: PaymentMethodFamily; + /** + * Last four digits of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastFourDigits?: string; + /** The list of logos for the payment method. */ + logos?: PaymentMethodLogo[]; + /** + * The type of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly paymentMethodType?: string; + /** Status of the payment method. */ + status?: PaymentMethodStatus; } -/** - * Defines values for BillingRelationshipType. \ - * {@link KnownBillingRelationshipType} can be used interchangeably with BillingRelationshipType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Direct** \ - * **IndirectCustomer** \ - * **IndirectPartner** \ - * **CSPPartner** - */ -export type BillingRelationshipType = string; +/** The list of payment methods. */ +export interface PaymentMethodsListResult { + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** + * The list of payment methods. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: PaymentMethod[]; +} -/** Known values of {@link InvoiceSectionState} that the service accepts. */ -export enum KnownInvoiceSectionState { - /** Active */ - Active = "Active", - /** Restricted */ - Restricted = "Restricted" +/** A policy at customer scope. */ +export interface CustomerPolicyProperties { + /** + * The provisioning state of the resource during a long-running operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. */ + viewCharges: ViewChargesPolicy; + /** List of all policies defined at the billing scope. */ + policies?: PolicySummary[]; } -/** - * Defines values for InvoiceSectionState. \ - * {@link KnownInvoiceSectionState} can be used interchangeably with InvoiceSectionState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Active** \ - * **Restricted** - */ -export type InvoiceSectionState = string; +/** The summary of the policy. */ +export interface PolicySummary { + /** The name of the policy. */ + name?: string; + /** The value of the policy. */ + value?: string; + /** The type of the policy. */ + policyType?: PolicyType; + /** The scope at which the policy is defined. */ + scope?: string; +} -/** Known values of {@link TargetCloud} that the service accepts. */ -export enum KnownTargetCloud { - /** USGov */ - USGov = "USGov", - /** USNat */ - USNat = "USNat", - /** USSec */ - USSec = "USSec" +/** A policy at billing profile scope. */ +export interface BillingProfilePolicyProperties { + /** + * The provisioning state of the resource during a long-running operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The policies for Enterprise Agreement enrollments. */ + enterpriseAgreementPolicies?: BillingProfilePolicyPropertiesEnterpriseAgreementPolicies; + /** The policy that controls invoice section label management at invoice section scope. This is allowed by default. */ + invoiceSectionLabelManagement?: InvoiceSectionLabelManagementPolicy; + /** The policy that controls whether Azure marketplace purchases are allowed. */ + marketplacePurchases?: MarketplacePurchasesPolicy; + /** The policy that controls whether Azure reservation purchases are allowed. */ + reservationPurchases?: ReservationPurchasesPolicy; + /** The policy that controls whether users with Azure savings plan purchase are allowed. */ + savingsPlanPurchases?: SavingsPlanPurchasesPolicy; + /** The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. */ + viewCharges?: ViewChargesPolicy; + /** List of all policies defined at the billing scope. */ + policies?: PolicySummary[]; } -/** - * Defines values for TargetCloud. \ - * {@link KnownTargetCloud} can be used interchangeably with TargetCloud, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **USGov** \ - * **USNat** \ - * **USSec** - */ -export type TargetCloud = string; +/** The policies for Enterprise Agreement enrollments. */ +export interface EnterpriseAgreementPolicies { + /** The state showing the enrollment auth level. */ + authenticationType?: EnrollmentAuthLevelState; + /** The policy that controls whether account owner can view charges. */ + accountOwnerViewCharges?: EnrollmentAccountOwnerViewCharges; + /** The policy that controls whether department admin can view charges. */ + departmentAdminViewCharges?: EnrollmentDepartmentAdminViewCharges; +} -/** Known values of {@link BillingProfileStatus} that the service accepts. */ -export enum KnownBillingProfileStatus { - /** Active */ - Active = "Active", - /** Disabled */ - Disabled = "Disabled", - /** Warned */ - Warned = "Warned" +/** A policy at billing account scope. */ +export interface BillingAccountPolicyProperties { + /** + * The provisioning state of the resource during a long-running operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The policies for Enterprise Agreement enrollments. */ + enterpriseAgreementPolicies?: BillingAccountPolicyPropertiesEnterpriseAgreementPolicies; + /** The policy that controls whether Azure marketplace purchases are allowed. */ + marketplacePurchases?: MarketplacePurchasesPolicy; + /** The policy that controls whether Azure reservation purchases are allowed. */ + reservationPurchases?: ReservationPurchasesPolicy; + /** The policy that controls whether users with Azure savings plan purchase are allowed. */ + savingsPlanPurchases?: SavingsPlanPurchasesPolicy; + /** List of all policies defined at the billing scope. */ + policies?: PolicySummary[]; } -/** - * Defines values for BillingProfileStatus. \ - * {@link KnownBillingProfileStatus} can be used interchangeably with BillingProfileStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Active** \ +/** A policy at subscription scope. */ +export interface SubscriptionPolicyProperties { + /** + * The provisioning state of the resource during a long-running operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** List of all policies defined at the billing scope. */ + policies?: PolicySummary[]; +} + +/** A container for a list of resources */ +export interface ProductListResult { + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** + * The list of resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Product[]; +} + +/** A product. */ +export interface ProductProperties { + /** Indicates whether auto renewal is turned on or off for a product. */ + autoRenew?: AutoRenew; + /** + * The availability of the product. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly availabilityId?: string; + /** + * The frequency at which the product will be billed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingFrequency?: string; + /** + * The ID of the billing profile to which the product is billed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileId?: string; + /** + * The name of the billing profile to which the product is billed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileDisplayName?: string; + /** + * The ID of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner Agreement billing account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerId?: string; + /** + * The name of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner Agreement billing account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerDisplayName?: string; + /** + * The display name of the product. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * The date when the product will be renewed or canceled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endDate?: string; + /** + * The ID of the invoice section to which the product is billed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionId?: string; + /** + * The name of the invoice section to which the product is billed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionDisplayName?: string; + /** The last month charges. */ + lastCharge?: ProductPropertiesLastCharge; + /** + * The date of the last charge. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastChargeDate?: string; + /** + * The description of the type of product. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productType?: string; + /** + * The ID of the type of product. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productTypeId?: string; + /** + * The sku ID of the product. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuId?: string; + /** + * The sku description of the product. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuDescription?: string; + /** + * The date when the product was purchased. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly purchaseDate?: string; + /** + * The quantity purchased for the product. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly quantity?: number; + /** + * The status of the product. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: ProductStatus; + /** + * The id of the tenant in which the product is used. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Reseller for this product. The fields is not available for Microsoft Partner Agreement products. */ + reseller?: ProductPropertiesReseller; +} + +/** The properties of the product to initiate a transfer. */ +export interface MoveProductRequest { + /** The destination invoice section id. */ + destinationInvoiceSectionId: string; +} + +/** Result of the transfer eligibility validation. */ +export interface MoveProductEligibilityResult { + /** Specifies whether the subscription is eligible to be transferred. */ + isMoveEligible?: boolean; + /** Error details of the transfer eligibility validation. */ + errorDetails?: MoveProductEligibilityResultErrorDetails; +} + +/** Error details of the transfer eligibility validation. */ +export interface MoveProductErrorDetails { + /** + * Error code for the product transfer validation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: MoveValidationErrorCode; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * Error details of the transfer eligibility validation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: string; +} + +/** The list of reservations and summary of roll out count of reservations in each state. */ +export interface ReservationsListResult { + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** The roll out count summary of the reservations */ + summary?: ReservationSummary; + /** + * The list of reservations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Reservation[]; +} + +/** The roll up count summary of reservations in each state */ +export interface ReservationSummary { + /** + * The number of reservation in Cancelled state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cancelledCount?: number; + /** + * The number of reservation in Expired state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiredCount?: number; + /** + * The number of reservation in Expiring state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiringCount?: number; + /** + * The number of reservation in Failed state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly failedCount?: number; + /** + * The number of reservation in Pending state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly pendingCount?: number; + /** + * The number of reservation in Succeeded state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly succeededCount?: number; + /** + * The number of reservation in 'No Benefit' state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly noBenefitCount?: number; + /** + * The number of reservation in Warning state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly warningCount?: number; + /** + * The number of reservation in Processing state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly processingCount?: number; +} + +/** Extended status information for the reservation. */ +export interface ReservationExtendedStatusInfo { + /** The status of the reservation. */ + statusCode?: ReservationStatusCode; + /** The message giving detailed information about the status code. */ + message?: string; + /** Properties for extended status information */ + properties?: ExtendedStatusDefinitionProperties; +} + +/** Extended status definition properties */ +export interface ExtendedStatusDefinitionProperties { + /** Subscription Id */ + subscriptionId?: string; +} + +/** Properties of reservation split */ +export interface ReservationSplitProperties { + /** List of destination resource id that are created due to split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} */ + splitDestinations?: string[]; + /** Resource id of the reservation from which this is split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} */ + splitSource?: string; +} + +/** Properties of reservation merge */ +export interface ReservationMergeProperties { + /** Reservation resource id Created due to the merge. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} */ + mergeDestination?: string; + /** Resource ids of the source reservation's merged to form this reservation. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} */ + mergeSources?: string[]; +} + +/** Properties of reservation swap */ +export interface ReservationSwapProperties { + /** Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} */ + swapSource?: string; + /** Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} */ + swapDestination?: string; +} + +/** Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup */ +export interface ReservationAppliedScopeProperties { + /** Tenant ID where the reservation should apply benefit. */ + tenantId?: string; + /** Fully-qualified identifier of the management group where the benefit must be applied. */ + managementGroupId?: string; + /** Fully-qualified identifier of the subscription. */ + subscriptionId?: string; + /** Fully-qualified identifier of the resource group. */ + resourceGroupId?: string; + /** Display name */ + displayName?: string; +} + +/** The renew properties for a reservation. */ +export interface RenewPropertiesResponse { + /** The request for reservation purchase */ + purchaseProperties?: ReservationPurchaseRequest; + /** Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry. */ + pricingCurrencyTotal?: Price; + /** Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included. */ + billingCurrencyTotal?: Price; +} + +/** The request for reservation purchase */ +export interface ReservationPurchaseRequest { + /** The name of sku */ + sku?: SkuName; + /** The Azure region where the reserved resource lives. */ + location?: string; + /** + * The reserved source type of the reservation, e.g. virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reservedResourceType?: string; + /** + * Subscription that will be charged for purchasing reservation or savings plan + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingScopeId?: string; + /** + * The term of the reservation, e.g. P1Y + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly term?: string; + /** Represent the billing plans. */ + billingPlan?: ReservationBillingPlan; + /** Quantity of the skus that are part of the reservation. Must be greater than zero. */ + quantity?: number; + /** Friendly name of the reservation */ + displayName?: string; + /** Type of the Applied Scope. */ + appliedScopeType?: AppliedScopeType; + /** List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. */ + appliedScopes?: string[]; + /** Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup */ + appliedScopeProperties?: ReservationAppliedScopeProperties; + /** Setting this to true will automatically purchase a new benefit on the expiration date time. */ + renew?: boolean; + /** Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility. */ + instanceFlexibilityPropertiesInstanceFlexibility?: InstanceFlexibility; + /** This is the date-time when the Azure hybrid benefit needs to be reviewed. */ + reviewDateTime?: Date; + /** Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. */ + instanceFlexibilityPropertiesReservedResourcePropertiesInstanceFlexibility?: InstanceFlexibility; +} + +/** The name of sku */ +export interface SkuName { + name?: string; +} + +/** The aggregate values of reservation utilization */ +export interface ReservationUtilizationAggregates { + /** + * The grain of the aggregate + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly grain?: number; + /** + * The grain unit of the aggregate + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly grainUnit?: string; + /** + * The aggregate value + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: number; + /** + * The aggregate value unit + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly valueUnit?: string; +} + +/** The property of reservation sku object. */ +export interface ReservationSkuProperty { + /** + * The name of the reservation sku. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; +} + +/** The request for reservation patch */ +export interface Patch { + /** The sku information associated to this reservation */ + sku?: ReservationSkuProperty; + /** Tags for this reservation */ + tags?: { [propertyName: string]: string }; + /** Type of the Applied Scope. */ + appliedScopeType?: AppliedScopeType; + /** Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup */ + appliedScopeProperties?: ReservationAppliedScopeProperties; + /** Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. */ + instanceFlexibility?: InstanceFlexibility; + /** Display name of the reservation */ + displayName?: string; + /** Setting this to true will automatically purchase a new benefit on the expiration date time. */ + renew?: boolean; + /** This is the date-time when the Azure hybrid benefit needs to be reviewed. */ + reviewDateTime?: Date; + /** The request for reservation purchase */ + purchaseProperties?: ReservationPurchaseRequest; +} + +/** List of `Reservations */ +export interface ReservationList { + value?: Reservation[]; + /** Url to get the next page of reservations. */ + nextLink?: string; +} + +/** Information describing the type of billing plan for this reservation order. */ +export interface ReservationOrderBillingPlanInformation { + /** Amount of money to be paid for the Order. Tax is not included. */ + pricingCurrencyTotal?: Price; + /** Date when the billing plan has started. */ + startDate?: Date; + /** For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. */ + nextPaymentDueDate?: Date; + transactions?: ReservationPaymentDetail[]; +} + +/** Information about payment related to a reservation order. */ +export interface ReservationPaymentDetail { + /** Date when the payment needs to be done. */ + dueDate?: Date; + /** Date when the transaction is completed. Is null when it is scheduled. */ + paymentDate?: Date; + /** Amount in pricing currency. Tax not included. */ + pricingCurrencyTotal?: Price; + /** Amount charged in Billing currency. Tax not included. Is null for future payments */ + billingCurrencyTotal?: Price; + /** Shows the Account that is charged for this payment. */ + billingAccount?: string; + /** Describes whether the payment is completed, failed, pending, cancelled or scheduled in the future. */ + status?: PaymentStatus; + /** Extended status information for the reservation. */ + extendedStatusInfo?: ReservationExtendedStatusInfo; +} + +/** List of ReservationOrders */ +export interface ReservationOrderList { + value?: ReservationOrder[]; + /** Url to get the next page of reservationOrders. */ + nextLink?: string; +} + +/** A container for a list of resources */ +export interface TransactionListResult { + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; + /** + * The list of resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Transaction[]; +} + +/** A transaction. */ +export interface TransactionProperties { + /** The amount of any Azure credits automatically applied to this transaction. */ + azureCreditApplied?: TransactionPropertiesAzureCreditApplied; + /** Details of the Azure plan. */ + azurePlan?: string; + /** The ISO 4217 code for the currency in which this transaction is billed. */ + billingCurrency?: string; + /** The name of the billing profile. */ + billingProfileDisplayName?: any; + /** The fully qualified ID that uniquely identifies a billing profile. */ + billingProfileId?: string; + /** The amount of Microsoft Azure Consumption Commitment(MACC) decrement through the transaction. */ + consumptionCommitmentDecremented?: TransactionPropertiesConsumptionCommitmentDecremented; + /** The name of the customer. */ + customerDisplayName?: string; + /** The fully qualified ID that uniquely identifies a customer. */ + customerId?: string; + /** The credit type of the transaction. Applies only to credited transactions. */ + creditType?: CreditType; + /** The date of transaction. */ + date?: Date; + /** The percentage discount, if any, applied to this transaction. */ + discount?: number; + /** The price of the product after applying any discounts. */ + effectivePrice?: TransactionPropertiesEffectivePrice; + /** The exchange rate used to convert charged amount to billing currency, if applicable. */ + exchangeRate?: number; + /** Invoice name on which the transaction was billed or 'Pending' if the transaction is not billed. */ + invoice?: string; + /** The fully qualified ID of the invoice on which the transaction was billed. This field is only applicable for transactions which are billed. */ + invoiceId?: string; + /** The name of the invoice section. */ + invoiceSectionDisplayName?: string; + /** The fully qualified ID that uniquely identifies an invoice section. */ + invoiceSectionId?: string; + /** Whether or not the transaction is third party. */ + isThirdParty?: boolean; + /** Type of the transaction, billed or unbilled. */ + kind?: TransactionKind; + /** The retail price of the product. */ + marketPrice?: TransactionPropertiesMarketPrice; + /** The part number of the product for which the transaction took place. The field is only applicable for Enterprise Agreement invoices. */ + partNumber?: string; + /** The ISO 4217 code for the currency in which the product is priced. */ + pricingCurrency?: string; + /** The description of the product for which the transaction took place. */ + productDescription?: string; + /** The family of the product for which the transaction took place. */ + productFamily?: string; + /** The ID of the product type for which the transaction took place. */ + productTypeId?: string; + /** The type of the product for which the transaction took place. */ + productType?: string; + /** The quantity purchased in the transaction. */ + quantity?: number; + /** There reason code for the transaction. */ + reasonCode?: string; + /** The date of the purchase of the product, or the start date of the month in which usage started. */ + servicePeriodStartDate?: Date; + /** The end date of the product term, or the end date of the month in which usage ended. */ + servicePeriodEndDate?: Date; + /** The pre-tax charged amount for the transaction. */ + subTotal?: TransactionPropertiesSubTotal; + /** The tax amount applied to the transaction. */ + tax?: TransactionPropertiesTax; + /** The charge associated with the transaction. */ + transactionAmount?: TransactionPropertiesTransactionAmount; + /** The type of transaction. */ + transactionType?: string; + /** The number of units used for a given product. */ + units?: number; + /** The unit of measure used to bill for the product. For example, compute services are billed per hour. */ + unitOfMeasure?: string; + /** The description for the unit of measure for a given product. */ + unitType?: string; + /** Identifies the type of tax calculation used for the invoice. The field is applicable only to invoices with special tax calculation logic. */ + specialTaxationType?: SpecialTaxationType; + /** The refund details of a transaction. */ + refundTransactionDetails?: TransactionPropertiesRefundTransactionDetails; +} + +/** The refund details of a transaction. */ +export interface RefundTransactionDetails { + /** The amount of refund requested. */ + amountRequested?: RefundTransactionDetailsAmountRequested; + /** The amount refunded. */ + amountRefunded?: RefundTransactionDetailsAmountRefunded; + /** The ID of refund operation. */ + refundOperationId?: string; +} + +/** A transaction summary. */ +export interface TransactionSummary { + /** + * The total amount of any Azure credits applied. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly azureCreditApplied?: number; + /** + * The ISO 4217 code for the currency in which the transactions are billed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingCurrency?: string; + /** + * The total Microsoft Azure Consumption Commitment (MACC) decrement through the invoice. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly consumptionCommitmentDecremented?: number; + /** + * The total pre-tax charged amount. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subTotal?: number; + /** + * The total tax amount applied. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tax?: number; + /** + * The total charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly total?: number; +} + +/** Detailed transfer status. */ +export interface DetailedTransferStatus { + /** + * Type of product that is transferred. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productType?: ProductType; + /** + * The ID of the product that is transferred. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productId?: string; + /** + * The name of the product that is transferred. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productName?: string; + /** + * The SKU of the product that is transferred. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuDescription?: string; + /** + * Transfer status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly transferStatus?: ProductTransferStatus; + /** Error details for transfer execution. */ + errorDetails?: TransferError; +} + +/** Error details for transfer execution. */ +export interface TransferError { + /** + * Error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * Error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; +} + +/** Request parameters to initiate transfer. */ +export interface InitiateTransferRequest { + /** The email ID of the recipient to whom the transfer request is sent. */ + recipientEmailId?: string; +} + +/** The list of transfers initiated by caller. */ +export interface TransferDetailsListResult { + /** + * The list of transfers initiated by caller. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: TransferDetails[]; + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Request parameters to initiate partner transfer. */ +export interface PartnerInitiateTransferRequest { + /** The email ID of the recipient to whom the transfer request is sent. */ + recipientEmailId?: string; + /** Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner Agreement billing account. */ + resellerId?: string; +} + +/** The list of transfers initiated by partner. */ +export interface PartnerTransferDetailsListResult { + /** + * The list of transfers initiated by partner. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: PartnerTransferDetails[]; + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Request parameters to accept transfer. */ +export interface AcceptTransferRequest { + /** Request parameters to accept transfer. */ + productDetails?: ProductDetails[]; +} + +/** Details of the product that is transferred. */ +export interface ProductDetails { + /** Type of the product that is transferred. */ + productType?: ProductType; + /** The ID of the product that is transferred. */ + productId?: string; +} + +/** Result of transfer validation. */ +export interface ValidateTransferListResponse { + /** + * The list of transfer validation results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ValidateTransferResponse[]; +} + +/** Transfer validation response. */ +export interface ValidateTransferResponse { + /** + * The status of validation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * The product id for which this result applies. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productId?: string; + /** The array of validation results. */ + results?: ValidationResultProperties[]; +} + +/** The properties of the validation result. */ +export interface ValidationResultProperties { + /** + * Result Level. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly level?: string; + /** + * Result Code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The validation message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; +} + +/** The list of transfers received by caller. */ +export interface RecipientTransferDetailsListResult { + /** + * The list of transfers received by caller. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: RecipientTransferDetails[]; + /** + * The link (url) to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** An external reference. */ +export interface ExternalReference { + /** + * The ID that uniquely identifies an external reference. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The URL of the external reference. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly url?: string; +} + +/** Query parameter to enumerate transfer requests. */ +export interface TransferItemQueryParameter { + /** State of the transfer request query filter. */ + state?: string; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** Credit amount for immediate payment. */ +export interface AvailableBalancePropertiesAmount extends Amount {} + +/** Payment on Account amount. */ +export interface PaymentOnAccountAmount extends Amount {} + +/** Total amount of payments on accounts. */ +export interface AvailableBalancePropertiesTotalPaymentsOnAccount + extends Amount {} + +/** The amount due as of now. */ +export interface InvoicePropertiesAmountDue extends Amount {} + +/** The amount of Azure prepayment applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ +export interface InvoicePropertiesAzurePrepaymentApplied extends Amount {} + +/** The total charges for the invoice billing period. */ +export interface InvoicePropertiesBilledAmount extends Amount {} + +/** The total refund for returns and cancellations during the invoice billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ +export interface InvoicePropertiesCreditAmount extends Amount {} + +/** The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ +export interface InvoicePropertiesFreeAzureCreditApplied extends Amount {} + +/** The paid amount. */ +export interface PaymentAmount extends Amount {} + +/** The pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ +export interface InvoicePropertiesSubTotal extends Amount {} + +/** The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ +export interface InvoicePropertiesTaxAmount extends Amount {} + +/** The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. */ +export interface InvoicePropertiesTotalAmount extends Amount {} + +/** The amount of refund requested. */ +export interface RefundDetailsSummaryAmountRequested extends Amount {} + +/** The amount refunded. */ +export interface RefundDetailsSummaryAmountRefunded extends Amount {} + +/** The last month charges. */ +export interface ProductPropertiesLastCharge extends Amount {} + +/** The amount of any Azure credits automatically applied to this transaction. */ +export interface TransactionPropertiesAzureCreditApplied extends Amount {} + +/** The amount of Microsoft Azure Consumption Commitment(MACC) decrement through the transaction. */ +export interface TransactionPropertiesConsumptionCommitmentDecremented + extends Amount {} + +/** The price of the product after applying any discounts. */ +export interface TransactionPropertiesEffectivePrice extends Amount {} + +/** The retail price of the product. */ +export interface TransactionPropertiesMarketPrice extends Amount {} + +/** The pre-tax charged amount for the transaction. */ +export interface TransactionPropertiesSubTotal extends Amount {} + +/** The tax amount applied to the transaction. */ +export interface TransactionPropertiesTax extends Amount {} + +/** The charge associated with the transaction. */ +export interface TransactionPropertiesTransactionAmount extends Amount {} + +/** The amount of refund requested. */ +export interface RefundTransactionDetailsAmountRequested extends Amount {} + +/** The amount refunded. */ +export interface RefundTransactionDetailsAmountRefunded extends Amount {} + +/** The current payment term of the billing profile. */ +export interface BillingProfilePropertiesCurrentPaymentTerm + extends PaymentTerm {} + +/** The properties of an enrollment. */ +export interface BillingAccountPropertiesEnrollmentDetails + extends EnrollmentDetails {} + +/** The properties of an enrollment which are applicable only for indirect enrollments. */ +export interface EnrollmentDetailsIndirectRelationshipInfo + extends IndirectRelationshipInfo {} + +/** Identifies the billing profile that is linked to another billing profile in indirect purchase motion. */ +export interface BillingProfilePropertiesIndirectRelationshipInfo + extends IndirectRelationshipInfo {} + +/** The address of the individual or organization that is responsible for the billing account. */ +export interface BillingAccountPropertiesSoldTo extends AddressDetails {} + +/** Billing address. */ +export interface BillingProfilePropertiesBillTo extends AddressDetails {} + +/** The default address where the products are shipped, or the services are being used. If a ship to is not specified for a product or a subscription, then this address will be used. */ +export interface BillingProfilePropertiesShipTo extends AddressDetails {} + +/** The address of the individual or organization that is responsible for the billing account. */ +export interface BillingProfilePropertiesSoldTo extends AddressDetails {} + +/** The address of the individual or organization where service subscription is being used. Available for agreement type Microsoft Online Services Program. This property can be updated via patch. */ +export interface BillingPropertyPropertiesSubscriptionServiceUsageAddress + extends AddressDetails {} + +/** Describes the registration number of the organization linked with the billing account. */ +export interface BillingAccountPropertiesRegistrationNumber + extends RegistrationNumber {} + +/** The enrollment details for the subscription. Available for billing accounts with agreement type Enterprise Agreement. */ +export interface BillingPropertyPropertiesEnrollmentDetails + extends SubscriptionEnrollmentDetails {} + +/** The principal of the request reviewer. Will only be set if request is approved. */ +export interface BillingRequestPropertiesReviewedBy extends Principal {} + +/** The principal of the entity who created the request. */ +export interface BillingRequestPropertiesCreatedBy extends Principal {} + +/** The principal of the entity who last updated the request. */ +export interface BillingRequestPropertiesLastUpdatedBy extends Principal {} + +/** Commitment towards the benefit. */ +export interface Commitment extends Price { + /** Commitment grain. */ + grain?: CommitmentGrain; +} + +/** A billing subscription alias. */ +export interface BillingSubscriptionAliasProperties + extends BillingSubscriptionProperties { + /** + * The ID of the billing subscription with the subscription alias. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingSubscriptionId?: string; +} + +/** Reseller for this product. The fields is not available for Microsoft Partner Agreement products. */ +export interface ProductPropertiesReseller extends Reseller {} + +/** Rebill details for an invoice. */ +export interface InvoicePropertiesRebillDetails extends RebillDetails {} + +/** The details of a refund request. */ +export interface InvoicePropertiesRefundDetails extends RefundDetailsSummary {} + +/** The policies for Enterprise Agreement enrollments. */ +export interface BillingProfilePolicyPropertiesEnterpriseAgreementPolicies + extends EnterpriseAgreementPolicies {} + +/** The policies for Enterprise Agreement enrollments. */ +export interface BillingAccountPolicyPropertiesEnterpriseAgreementPolicies + extends EnterpriseAgreementPolicies {} + +/** Error details of the transfer eligibility validation. */ +export interface MoveProductEligibilityResultErrorDetails + extends MoveProductErrorDetails {} + +/** The refund details of a transaction. */ +export interface TransactionPropertiesRefundTransactionDetails + extends RefundTransactionDetails {} + +/** Common fields that are returned in the response for all Azure Resource Manager resources. */ +export interface ProxyResourceWithTags extends ProxyResource { + /** Dictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? / */ + tags?: { [propertyName: string]: string }; +} + +/** The definition of the reservation. */ +export interface Reservation extends ProxyResource { + /** The location of the reservation. */ + location?: string; + etag?: number; + /** Tags for this reservation */ + tags?: { [propertyName: string]: string }; + /** The sku information associated to this reservation */ + sku?: ReservationSkuProperty; + /** + * The reserved source type of the reservation, e.g. virtual machine. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reservedResourceType?: string; + /** Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility. */ + instanceFlexibility?: InstanceFlexibility; + /** + * The display name of the reservation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** The array of applied scopes of a reservation. Will be null if the reservation is in Shared scope */ + appliedScopes?: string[]; + /** + * The applied scope type of the reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly appliedScopeType?: string; + /** Indicates if the reservation is archived */ + archived?: boolean; + /** Capabilities of the reservation */ + capabilities?: string; + /** + * The number of the reservation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly quantity?: number; + /** + * The provisioning state of the reservation, e.g. Succeeded + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * The effective date time of the reservation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly effectiveDateTime?: Date; + /** This is the DateTime when the reservation benefit started. */ + benefitStartTime?: Date; + /** + * DateTime of the last time the reservation was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastUpdatedDateTime?: Date; + /** + * The expiry date of the reservation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiryDate?: string; + /** This is the date-time when the reservation will expire. */ + expiryDateTime?: Date; + /** This is the date-time when the Azure Hybrid Benefit needs to be reviewed. */ + reviewDateTime?: Date; + /** + * The sku description of the reservation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuDescription?: string; + /** The message giving detailed information about the status code. */ + extendedStatusInfo?: ReservationExtendedStatusInfo; + /** The billing plan options available for this sku. */ + billingPlan?: ReservationBillingPlan; + /** + * The provisioning state of the reservation for display, e.g. Succeeded + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayProvisioningState?: string; + /** + * The provisioning state of the reservation, e.g. Succeeded + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningSubState?: string; + /** This is the date when the reservation was purchased. */ + purchaseDate?: Date; + /** This is the date-time when the reservation was purchased. */ + purchaseDateTime?: Date; + /** Properties of reservation split */ + splitProperties?: ReservationSplitProperties; + /** Properties of reservation merge */ + mergeProperties?: ReservationMergeProperties; + /** Properties of reservation swap */ + swapProperties?: ReservationSwapProperties; + /** Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup */ + appliedScopeProperties?: ReservationAppliedScopeProperties; + /** + * Subscription that will be charged for purchasing reservation or savings plan + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingScopeId?: string; + /** + * The renew state of the reservation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly renew?: boolean; + /** + * The renew source of the reservation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly renewSource?: string; + /** Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. */ + renewDestination?: string; + /** The renew properties for a reservation. */ + renewProperties?: RenewPropertiesResponse; + /** + * The term of the reservation, e.g. P1Y + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly term?: string; + /** + * The applied scope type of the reservation for display, e.g. Shared + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userFriendlyAppliedScopeType?: string; + /** + * The renew state of the reservation for display, e.g. On + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userFriendlyRenewState?: string; + /** Represents UPN */ + productCode?: string; + /** + * last 7 day utilization trend for a reservation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly trend?: string; + /** The array of aggregates of a reservation's utilization */ + aggregates?: ReservationUtilizationAggregates[]; +} + +/** Details of a reservation order being returned. */ +export interface ReservationOrder extends ProxyResource { + etag?: number; + /** Tags for this reservation */ + tags?: { [propertyName: string]: string }; + /** Friendly name for user to easily identified the reservation order. */ + displayName?: string; + /** Enrollment id of the reservation order. */ + enrollmentId?: string; + /** Fully-qualified identifier of the customerId where the benefit is applied. Present only for Enterprise Agreement PartnerLed customers. */ + customerId?: string; + /** Billing profile Id associated to this reservation order. */ + billingProfileId?: string; + /** Billing account Id associated to this reservation order. */ + billingAccountId?: string; + /** This is the DateTime when the reservation order was initially requested for purchase. */ + requestDateTime?: Date; + /** This is the DateTime when the reservation order was created. */ + createdDateTime?: Date; + /** This is the date when the reservation order will expire. */ + expiryDate?: Date; + /** This is the date-time when the reservation order will expire. */ + expiryDateTime?: Date; + /** This is the DateTime when the reservation benefit started. */ + benefitStartTime?: Date; + /** Total original quantity of the skus purchased in the reservation order. */ + originalQuantity?: number; + /** + * The term of the reservation, e.g. P1Y + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly term?: string; + /** + * The provisioning state of the reservation, e.g. Succeeded + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** Represent the billing plans. */ + billingPlan?: ReservationBillingPlan; + /** Information describing the type of billing plan for this reservation order. */ + planInformation?: ReservationOrderBillingPlanInformation; + reservations?: Reservation[]; + /** This is the date-time when the Azure Hybrid Benefit needs to be reviewed. */ + reviewDateTime?: Date; + /** Extended status information for the reservation. */ + extendedStatusInfo?: ReservationExtendedStatusInfo; + /** Represents UPN */ + productCode?: string; +} + +/** An agreement. */ +export interface Agreement extends ProxyResourceWithTags { + /** An agreement. */ + properties?: AgreementProperties; +} + +/** An associated tenant. */ +export interface AssociatedTenant extends ProxyResourceWithTags { + /** An associated tenant. */ + properties?: AssociatedTenantProperties; +} + +/** The Available Credit or Payment on Account Balance. The credit balance can be used to settle due or past due invoices. */ +export interface AvailableBalance extends ProxyResourceWithTags { + /** The Available Credit or Payment on Account Balance. The credit balance can be used to settle due or past due invoices. */ + properties?: AvailableBalanceProperties; +} + +/** A billing account. */ +export interface BillingAccount extends ProxyResourceWithTags { + /** A billing account. */ + properties?: BillingAccountProperties; +} + +/** A billing account. */ +export interface BillingAccountPatch extends ProxyResourceWithTags { + /** A billing account. */ + properties?: BillingAccountProperties; +} + +/** A billing profile. */ +export interface BillingProfile extends ProxyResourceWithTags { + /** A billing profile. */ + properties?: BillingProfileProperties; +} + +/** A billing property. */ +export interface BillingProperty extends ProxyResourceWithTags { + /** A billing property. */ + properties?: BillingPropertyProperties; +} + +/** A request submitted by a user to manage billing. Users with an owner role on the scope can approve or decline these requests. */ +export interface BillingRequest extends ProxyResourceWithTags { + /** A request submitted by a user to manage billing. Users with an owner role on the scope can approve or decline these requests. */ + properties?: BillingRequestProperties; +} + +/** The properties of the billing role assignment. */ +export interface BillingRoleAssignment extends ProxyResourceWithTags { + /** The properties of the billing role assignment. */ + properties?: BillingRoleAssignmentProperties; +} + +/** The properties of a role definition. */ +export interface BillingRoleDefinition extends ProxyResourceWithTags { + /** The properties of a role definition. */ + properties?: BillingRoleDefinitionProperties; +} + +/** Savings plan order */ +export interface SavingsPlanOrderModel extends ProxyResourceWithTags { + /** Savings plan SKU */ + sku: Sku; + /** Display name */ + displayName?: string; + /** + * The provisioning state of the savings plan, e.g. Succeeded + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** Subscription that will be charged for purchasing SavingsPlan */ + billingScopeId?: string; + /** + * Fully-qualified identifier of the billing profile where the savings plan is applied. Present only for Field-led or Customer-led customers. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileId?: string; + /** + * Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerId?: string; + /** + * Fully-qualified identifier of the billing account where the savings plan is applied. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingAccountId?: string; + /** Represents the Savings plan term in ISO 8601 format. */ + term?: SavingsPlanTerm; + /** Represents the billing plan in ISO 8601 format. Required only for monthly purchases. */ + billingPlan?: BillingPlan; + /** + * DateTime when the savings plan benefit started. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly benefitStartTime?: Date; + /** + * DateTime when the savings plan will expire. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiryDateTime?: Date; + /** Information describing the type of billing plan for this savings plan. */ + planInformation?: BillingPlanInformation; + savingsPlans?: string[]; + /** + * Extended status information + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extendedStatusInfo?: ExtendedStatusInfo; + /** Represents UPN */ + productCode?: string; +} + +/** Savings plan */ +export interface SavingsPlanModel extends ProxyResourceWithTags { + /** Savings plan SKU */ + sku: Sku; + /** Display name */ + displayName?: string; + /** The provisioning state of the resource during a long-running operation. */ + provisioningState?: ProvisioningState; + /** + * The provisioning state of the savings plan for display, e.g. Succeeded + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayProvisioningState?: string; + /** + * The applied scope type of the savings plan for display, e.g. Shared + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly userFriendlyAppliedScopeType?: string; + /** Subscription that will be charged for purchasing SavingsPlan */ + billingScopeId?: string; + /** + * Fully-qualified identifier of the billing profile where the savings plan is applied. Present only for Field-led or Customer-led customers. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileId?: string; + /** + * Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerId?: string; + /** + * Fully-qualified identifier of the billing account where the savings plan is applied. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingAccountId?: string; + /** Represents the Savings plan term in ISO 8601 format. */ + term?: SavingsPlanTerm; + /** Setting this to true will automatically purchase a new benefit on the expiration date time. */ + renew?: boolean; + /** SavingsPlan Id of the SavingsPlan from which this SavingsPlan is renewed. */ + renewSource?: string; + /** SavingsPlan Id of the SavingsPlan which is purchased because of renew. */ + renewDestination?: string; + /** Properties specific to renew. */ + renewProperties?: RenewProperties; + /** Represents the billing plan in ISO 8601 format. Required only for monthly purchases. */ + billingPlan?: BillingPlan; + /** Type of the Applied Scope. */ + appliedScopeType?: AppliedScopeType; + /** Properties specific to applied scope type. Not required if not applicable. */ + appliedScopeProperties?: AppliedScopeProperties; + /** Commitment towards the benefit. */ + commitment?: Commitment; + /** + * DateTime of the savings plan starting when this version is effective from. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly effectiveDateTime?: Date; + /** + * This is the DateTime when the savings plan benefit starts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly benefitStartTime?: Date; + /** + * This is the date-time when the savings plan will expire. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiryDateTime?: Date; + /** + * Date time when the savings plan was purchased. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly purchaseDateTime?: Date; + /** + * Savings plan utilization + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly utilization?: Utilization; + /** + * Extended status information + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extendedStatusInfo?: ExtendedStatusInfo; + /** Represents UPN */ + productCode?: string; +} + +/** The billing properties of a subscription. */ +export interface BillingSubscription extends ProxyResourceWithTags { + /** Indicates whether auto renewal is turned on or off for a product. */ + autoRenew?: AutoRenew; + /** The provisioning tenant of the subscription. */ + beneficiaryTenantId?: string; + /** The beneficiary of the billing subscription. */ + beneficiary?: Beneficiary; + /** The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y */ + billingFrequency?: string; + /** The fully qualified ID that uniquely identifies a billing profile. */ + billingProfileId?: string; + /** + * Dictionary of billing policies associated with the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingPolicies?: { [propertyName: string]: string }; + /** + * The name of the billing profile. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileDisplayName?: string; + /** + * The ID that uniquely identifies a billing profile. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileName?: string; + /** The cost center applied to the subscription. This field is only available for consumption subscriptions of Microsoft Customer Agreement or Enterprise Agreement Type billing accounts. */ + consumptionCostCenter?: string; + /** The fully qualified ID that uniquely identifies a customer. */ + customerId?: string; + /** + * The name of the customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerDisplayName?: string; + /** + * The ID that uniquely identifies a customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerName?: string; + /** The name of the billing subscription. */ + displayName?: string; + /** + * The enrollment Account ID associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enrollmentAccountId?: string; + /** + * The enrollment Account name associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enrollmentAccountDisplayName?: string; + /** The fully qualified ID that uniquely identifies an invoice section. */ + invoiceSectionId?: string; + /** + * The name of the invoice section. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionDisplayName?: string; + /** + * The ID that uniquely identifies an invoice section. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionName?: string; + /** + * The last month's charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastMonthCharges?: Amount; + /** + * The current month to date charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly monthToDateCharges?: Amount; + /** + * Next billing cycle details of the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextBillingCycleDetails?: NextBillingCycleDetails; + /** + * The offer ID for the subscription. This field is only available for the Microsoft Online Services Program billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly offerId?: string; + /** + * The category of the product for which the subscription is purchased. Possible values include: AzureSupport, Hardware, ReservationOrder, SaaS, SavingsPlanOrder, Software, UsageBased, Other. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productCategory?: string; + /** + * Type of the product for which the subscription is purchased. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productType?: string; + /** Id of the product for which the subscription is purchased. */ + productTypeId?: string; + /** + * Purchase date of the product in UTC time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly purchaseDate?: Date; + /** The quantity of licenses or fulfillment units for the subscription. */ + quantity?: number; + /** + * Reseller for this subscription. The fields is not available for Microsoft Partner Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reseller?: Reseller; + /** + * Details for the next renewal term of a subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly renewalTermDetails?: RenewalTermDetails; + /** The SKU ID of the product for which the subscription is purchased. This field is is only available for Microsoft Customer Agreement billing accounts. */ + skuId?: string; + /** + * The SKU description of the product for which the subscription is purchased. This field is is only available for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuDescription?: string; + /** System imposed policies that regulate behavior of the subscription. */ + systemOverrides?: SystemOverrides; + /** + * Unique identifier of the linked resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceUri?: string; + /** The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y */ + termDuration?: string; + /** + * Start date of the term in UTC time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly termStartDate?: Date; + /** + * End date of the term in UTC time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly termEndDate?: Date; + /** The tenant in which the subscription is provisioned. */ + provisioningTenantId?: string; + /** + * The status of the subscription. This field is not available for Enterprise Agreement billing accounts + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: BillingSubscriptionStatus; + /** + * The status of an operation on the subscription. When None, there is no ongoing operation. When LockedForUpdate, write operations will be blocked on the Billing Subscription. Other is the default value and you may need to refer to the latest API version for more details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operationStatus?: BillingSubscriptionOperationStatus; + /** + * The provisioning state of the resource during a long-running operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The ID of the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** + * The suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly suspensionReasons?: string[]; + /** + * The suspension details for a subscription. This field is not available for Enterprise Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly suspensionReasonDetails?: BillingSubscriptionStatusDetails[]; + /** + * The enrollment Account and the subscription association start date. This field is available only for the Enterprise Agreement Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enrollmentAccountStartDate?: Date; + /** + * The current enrollment account status of the subscription. This field is available only for the Enterprise Agreement Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionEnrollmentAccountStatus?: SubscriptionEnrollmentAccountStatus; +} + +/** A billing subscription alias. */ +export interface BillingSubscriptionAlias extends ProxyResourceWithTags { + /** Indicates whether auto renewal is turned on or off for a product. */ + autoRenew?: AutoRenew; + /** The provisioning tenant of the subscription. */ + beneficiaryTenantId?: string; + /** The beneficiary of the billing subscription. */ + beneficiary?: Beneficiary; + /** The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y */ + billingFrequency?: string; + /** The fully qualified ID that uniquely identifies a billing profile. */ + billingProfileId?: string; + /** + * Dictionary of billing policies associated with the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingPolicies?: { [propertyName: string]: string }; + /** + * The name of the billing profile. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileDisplayName?: string; + /** + * The ID that uniquely identifies a billing profile. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileName?: string; + /** The cost center applied to the subscription. This field is only available for consumption subscriptions of Microsoft Customer Agreement or Enterprise Agreement Type billing accounts. */ + consumptionCostCenter?: string; + /** The fully qualified ID that uniquely identifies a customer. */ + customerId?: string; + /** + * The name of the customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerDisplayName?: string; + /** + * The ID that uniquely identifies a customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerName?: string; + /** The name of the billing subscription. */ + displayName?: string; + /** + * The enrollment Account ID associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enrollmentAccountId?: string; + /** + * The enrollment Account name associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enrollmentAccountDisplayName?: string; + /** The fully qualified ID that uniquely identifies an invoice section. */ + invoiceSectionId?: string; + /** + * The name of the invoice section. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionDisplayName?: string; + /** + * The ID that uniquely identifies an invoice section. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionName?: string; + /** + * The last month's charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastMonthCharges?: Amount; + /** + * The current month to date charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly monthToDateCharges?: Amount; + /** + * Next billing cycle details of the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextBillingCycleDetails?: NextBillingCycleDetails; + /** + * The offer ID for the subscription. This field is only available for the Microsoft Online Services Program billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly offerId?: string; + /** + * The category of the product for which the subscription is purchased. Possible values include: AzureSupport, Hardware, ReservationOrder, SaaS, SavingsPlanOrder, Software, UsageBased, Other. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productCategory?: string; + /** + * Type of the product for which the subscription is purchased. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productType?: string; + /** Id of the product for which the subscription is purchased. */ + productTypeId?: string; + /** + * Purchase date of the product in UTC time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly purchaseDate?: Date; + /** The quantity of licenses or fulfillment units for the subscription. */ + quantity?: number; + /** + * Reseller for this subscription. The fields is not available for Microsoft Partner Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reseller?: Reseller; + /** + * Details for the next renewal term of a subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly renewalTermDetails?: RenewalTermDetails; + /** The SKU ID of the product for which the subscription is purchased. This field is is only available for Microsoft Customer Agreement billing accounts. */ + skuId?: string; + /** + * The SKU description of the product for which the subscription is purchased. This field is is only available for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuDescription?: string; + /** System imposed policies that regulate behavior of the subscription. */ + systemOverrides?: SystemOverrides; + /** + * Unique identifier of the linked resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceUri?: string; + /** The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y */ + termDuration?: string; + /** + * Start date of the term in UTC time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly termStartDate?: Date; + /** + * End date of the term in UTC time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly termEndDate?: Date; + /** The tenant in which the subscription is provisioned. */ + provisioningTenantId?: string; + /** + * The status of the subscription. This field is not available for Enterprise Agreement billing accounts + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: BillingSubscriptionStatus; + /** + * The status of an operation on the subscription. When None, there is no ongoing operation. When LockedForUpdate, write operations will be blocked on the Billing Subscription. Other is the default value and you may need to refer to the latest API version for more details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operationStatus?: BillingSubscriptionOperationStatus; + /** + * The provisioning state of the resource during a long-running operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The ID of the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** + * The suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly suspensionReasons?: string[]; + /** + * The suspension details for a subscription. This field is not available for Enterprise Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly suspensionReasonDetails?: BillingSubscriptionStatusDetails[]; + /** + * The enrollment Account and the subscription association start date. This field is available only for the Enterprise Agreement Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enrollmentAccountStartDate?: Date; + /** + * The current enrollment account status of the subscription. This field is available only for the Enterprise Agreement Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionEnrollmentAccountStatus?: SubscriptionEnrollmentAccountStatus; + /** + * The ID of the billing subscription with the subscription alias. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingSubscriptionId?: string; +} + +/** The billing properties of a subscription. */ +export interface BillingSubscriptionPatch extends ProxyResourceWithTags { + /** Indicates whether auto renewal is turned on or off for a product. */ + autoRenew?: AutoRenew; + /** The provisioning tenant of the subscription. */ + beneficiaryTenantId?: string; + /** The beneficiary of the billing subscription. */ + beneficiary?: Beneficiary; + /** The billing frequency in ISO8601 format of product in the subscription. Example: P1M, P3M, P1Y */ + billingFrequency?: string; + /** The fully qualified ID that uniquely identifies a billing profile. */ + billingProfileId?: string; + /** + * Dictionary of billing policies associated with the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingPolicies?: { [propertyName: string]: string }; + /** + * The name of the billing profile. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileDisplayName?: string; + /** + * The ID that uniquely identifies a billing profile. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileName?: string; + /** The cost center applied to the subscription. This field is only available for consumption subscriptions of Microsoft Customer Agreement or Enterprise Agreement Type billing accounts. */ + consumptionCostCenter?: string; + /** The fully qualified ID that uniquely identifies a customer. */ + customerId?: string; + /** + * The name of the customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerDisplayName?: string; + /** + * The ID that uniquely identifies a customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerName?: string; + /** The name of the billing subscription. */ + displayName?: string; + /** + * The enrollment Account ID associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enrollmentAccountId?: string; + /** + * The enrollment Account name associated with the subscription. This field is available only for the Enterprise Agreement Type billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enrollmentAccountDisplayName?: string; + /** The fully qualified ID that uniquely identifies an invoice section. */ + invoiceSectionId?: string; + /** + * The name of the invoice section. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionDisplayName?: string; + /** + * The ID that uniquely identifies an invoice section. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invoiceSectionName?: string; + /** + * The last month's charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastMonthCharges?: Amount; + /** + * The current month to date charges. This field is only available for usage based subscriptions of Microsoft Customer Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly monthToDateCharges?: Amount; + /** + * Next billing cycle details of the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextBillingCycleDetails?: NextBillingCycleDetails; + /** + * The offer ID for the subscription. This field is only available for the Microsoft Online Services Program billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly offerId?: string; + /** + * The category of the product for which the subscription is purchased. Possible values include: AzureSupport, Hardware, ReservationOrder, SaaS, SavingsPlanOrder, Software, UsageBased, Other. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productCategory?: string; + /** + * Type of the product for which the subscription is purchased. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly productType?: string; + /** Id of the product for which the subscription is purchased. */ + productTypeId?: string; + /** + * Purchase date of the product in UTC time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly purchaseDate?: Date; + /** The quantity of licenses or fulfillment units for the subscription. */ + quantity?: number; + /** + * Reseller for this subscription. The fields is not available for Microsoft Partner Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reseller?: Reseller; + /** + * Details for the next renewal term of a subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly renewalTermDetails?: RenewalTermDetails; + /** The SKU ID of the product for which the subscription is purchased. This field is is only available for Microsoft Customer Agreement billing accounts. */ + skuId?: string; + /** + * The SKU description of the product for which the subscription is purchased. This field is is only available for billing accounts with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuDescription?: string; + /** System imposed policies that regulate behavior of the subscription. */ + systemOverrides?: SystemOverrides; + /** + * Unique identifier of the linked resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceUri?: string; + /** The duration in ISO8601 format for which you can use the subscription. Example: P1M, P3M, P1Y */ + termDuration?: string; + /** + * Start date of the term in UTC time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly termStartDate?: Date; + /** + * End date of the term in UTC time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly termEndDate?: Date; + /** The tenant in which the subscription is provisioned. */ + provisioningTenantId?: string; + /** + * The status of the subscription. This field is not available for Enterprise Agreement billing accounts + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: BillingSubscriptionStatus; + /** + * The status of an operation on the subscription. When None, there is no ongoing operation. When LockedForUpdate, write operations will be blocked on the Billing Subscription. Other is the default value and you may need to refer to the latest API version for more details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operationStatus?: BillingSubscriptionOperationStatus; + /** + * The provisioning state of the resource during a long-running operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The ID of the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; + /** + * The suspension reason for a subscription. This field is not available for Enterprise Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly suspensionReasons?: string[]; + /** + * The suspension details for a subscription. This field is not available for Enterprise Agreement billing accounts. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly suspensionReasonDetails?: BillingSubscriptionStatusDetails[]; + /** + * The enrollment Account and the subscription association start date. This field is available only for the Enterprise Agreement Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enrollmentAccountStartDate?: Date; + /** + * The current enrollment account status of the subscription. This field is available only for the Enterprise Agreement Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionEnrollmentAccountStatus?: SubscriptionEnrollmentAccountStatus; +} + +/** A partner's customer. */ +export interface Customer extends ProxyResourceWithTags { + /** A partner's customer. */ + properties?: CustomerProperties; +} + +/** Optional grouping of enrollment accounts to segment costs into logical groupings and set budgets. */ +export interface Department extends ProxyResourceWithTags { + /** Optional grouping of enrollment accounts to segment costs into logical groupings and set budgets. */ + properties?: DepartmentProperties; +} + +/** It is an organizational hierarchy within a billing account to administer and manage azure costs. */ +export interface EnrollmentAccount extends ProxyResourceWithTags { + /** It is an organizational hierarchy within a billing account to administer and manage azure costs. */ + properties?: EnrollmentAccountProperties; +} + +/** An invoice. */ +export interface Invoice extends ProxyResourceWithTags { + /** An invoice. */ + properties?: InvoiceProperties; +} + +/** An invoice section. */ +export interface InvoiceSection extends ProxyResourceWithTags { + /** An invoice section. */ + properties?: InvoiceSectionProperties; +} + +/** A payment method link. */ +export interface PaymentMethodLink extends ProxyResourceWithTags { + /** + * The account holder name for the payment method. This is only supported for payment methods with family CreditCard. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountHolderName?: string; + /** + * The display name of the payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * The expiration month and year of the payment method. This is only supported for payment methods with family CreditCard. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiration?: string; + /** + * The family of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly family?: PaymentMethodFamily; + /** + * Last four digits of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastFourDigits?: string; + /** + * The list of logos for the payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly logos?: PaymentMethodLogo[]; + /** Projection of a payment method. Will not be returned in this or future versions. */ + paymentMethod?: PaymentMethodProperties; + /** Id of payment method. Example: /providers/Microsoft.Billing/paymentMethods/ABCDABCDABC0 */ + paymentMethodId?: string; + /** + * The type of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly paymentMethodType?: string; + /** + * Status of the payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: PaymentMethodStatus; +} + +/** A payment method. */ +export interface PaymentMethod extends ProxyResourceWithTags { + /** + * Id of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly idPropertiesId?: string; + /** + * The account holder name for the payment method. This is only supported for payment methods with family CreditCard. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountHolderName?: string; + /** + * The display name of the payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly displayName?: string; + /** + * The expiration month and year of the payment method. This is only supported for payment methods with family CreditCard. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiration?: string; + /** The family of payment method. */ + family?: PaymentMethodFamily; + /** + * Last four digits of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastFourDigits?: string; + /** The list of logos for the payment method. */ + logos?: PaymentMethodLogo[]; + /** + * The type of payment method. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly paymentMethodType?: string; + /** Status of the payment method. */ + status?: PaymentMethodStatus; +} + +/** A policy at customer scope. */ +export interface CustomerPolicy extends ProxyResourceWithTags { + /** A policy at customer scope. */ + properties?: CustomerPolicyProperties; +} + +/** A policy at billing profile scope. */ +export interface BillingProfilePolicy extends ProxyResourceWithTags { + /** A policy at billing profile scope. */ + properties?: BillingProfilePolicyProperties; +} + +/** A policy at billing account scope. */ +export interface BillingAccountPolicy extends ProxyResourceWithTags { + /** A policy at billing account scope. */ + properties?: BillingAccountPolicyProperties; +} + +/** A policy at subscription scope. */ +export interface SubscriptionPolicy extends ProxyResourceWithTags { + /** A policy at subscription scope. */ + properties?: SubscriptionPolicyProperties; +} + +/** A product. */ +export interface Product extends ProxyResourceWithTags { + /** A product. */ + properties?: ProductProperties; +} + +/** A product. */ +export interface ProductPatch extends ProxyResourceWithTags { + /** A product. */ + properties?: ProductProperties; +} + +/** A transaction. */ +export interface Transaction extends ProxyResourceWithTags { + /** A transaction. */ + properties?: TransactionProperties; +} + +/** Details of the transfer. */ +export interface TransferDetails extends ProxyResourceWithTags { + /** + * The time at which the transfer request expires. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expirationTime?: Date; + /** + * Overall transfer status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly transferStatus?: TransferStatus; + /** + * The email ID of the user to whom the transfer request was sent. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recipientEmailId?: string; + /** + * The email ID of the user who sent the transfer request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly initiatorEmailId?: string; + /** + * The email ID of the user who canceled the transfer request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly canceledBy?: string; + /** + * Detailed transfer status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedTransferStatus?: DetailedTransferStatus[]; +} + +/** Details of the transfer. */ +export interface PartnerTransferDetails extends ProxyResourceWithTags { + /** + * The time at which the transfer request expires. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expirationTime?: Date; + /** + * Overall transfer status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly transferStatus?: TransferStatus; + /** + * The email ID of the user to whom the transfer request was sent. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recipientEmailId?: string; + /** + * The type of customer who sent the transfer request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly initiatorCustomerType?: InitiatorCustomerType; + /** + * The email ID of the user who sent the transfer request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly initiatorEmailId?: string; + /** + * Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner Agreement billing account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resellerId?: string; + /** + * Optional name of the reseller for transfer requests that are sent from Microsoft Partner Agreement billing account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resellerName?: string; + /** + * The email ID of the user who canceled the transfer request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly canceledBy?: string; + /** + * Detailed transfer status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedTransferStatus?: DetailedTransferStatus[]; +} + +/** Details of the transfer. */ +export interface RecipientTransferDetails extends ProxyResourceWithTags { + /** + * The time at which the transfer request expires. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expirationTime?: Date; + /** + * Type of subscriptions that can be transferred. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly allowedProductType?: EligibleProductType[]; + /** + * Overall transfer status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly transferStatus?: TransferStatus; + /** + * The email ID of the user to whom the transfer request was sent. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recipientEmailId?: string; + /** + * The email ID of the user who sent the transfer request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly initiatorEmailId?: string; + /** + * Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner Agreement billing account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resellerId?: string; + /** + * Optional name of the reseller for transfer requests that are sent from Microsoft Partner Agreement billing account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resellerName?: string; + /** + * The type of customer who sent the transfer request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly initiatorCustomerType?: InitiatorCustomerType; + /** + * The email ID of the user who canceled the transfer request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly canceledBy?: string; + /** + * Detailed transfer status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly detailedTransferStatus?: DetailedTransferStatus[]; + /** + * The customer tenant id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly customerTenantId?: string; + /** + * List of supported account types. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly supportedAccounts?: SupportedAccountType[]; +} + +/** Defines headers for AssociatedTenants_delete operation. */ +export interface AssociatedTenantsDeleteHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for AssociatedTenants_createOrUpdate operation. */ +export interface AssociatedTenantsCreateOrUpdateHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingAccounts_addPaymentTerms operation. */ +export interface BillingAccountsAddPaymentTermsHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingAccounts_cancelPaymentTerms operation. */ +export interface BillingAccountsCancelPaymentTermsHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingAccounts_update operation. */ +export interface BillingAccountsUpdateHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingProfiles_delete operation. */ +export interface BillingProfilesDeleteHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingProfiles_createOrUpdate operation. */ +export interface BillingProfilesCreateOrUpdateHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRequests_createOrUpdate operation. */ +export interface BillingRequestsCreateOrUpdateHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_createByBillingProfile operation. */ +export interface BillingRoleAssignmentsCreateByBillingProfileHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_createByCustomer operation. */ +export interface BillingRoleAssignmentsCreateByCustomerHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_resolveByCustomer operation. */ +export interface BillingRoleAssignmentsResolveByCustomerHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_createByInvoiceSection operation. */ +export interface BillingRoleAssignmentsCreateByInvoiceSectionHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_resolveByInvoiceSection operation. */ +export interface BillingRoleAssignmentsResolveByInvoiceSectionHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_resolveByBillingProfile operation. */ +export interface BillingRoleAssignmentsResolveByBillingProfileHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_createOrUpdateByBillingAccount operation. */ +export interface BillingRoleAssignmentsCreateOrUpdateByBillingAccountHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_createByBillingAccount operation. */ +export interface BillingRoleAssignmentsCreateByBillingAccountHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_createOrUpdateByDepartment operation. */ +export interface BillingRoleAssignmentsCreateOrUpdateByDepartmentHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_createOrUpdateByEnrollmentAccount operation. */ +export interface BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingRoleAssignments_resolveByBillingAccount operation. */ +export interface BillingRoleAssignmentsResolveByBillingAccountHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for SavingsPlans_updateByBillingAccount operation. */ +export interface SavingsPlansUpdateByBillingAccountHeaders { + /** URL for checking the ongoing status of the operation. */ + azureAsyncOperation?: string; + /** URL for determining when an operation has completed. Only use this value only when Azure-AsyncOperation isn't returned. */ + location?: string; + /** Clients should wait for the Retry-After interval before polling again */ + retryAfter?: number; +} + +/** Defines headers for BillingSubscriptions_cancel operation. */ +export interface BillingSubscriptionsCancelHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingSubscriptions_merge operation. */ +export interface BillingSubscriptionsMergeHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingSubscriptions_move operation. */ +export interface BillingSubscriptionsMoveHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingSubscriptions_split operation. */ +export interface BillingSubscriptionsSplitHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingSubscriptions_delete operation. */ +export interface BillingSubscriptionsDeleteHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingSubscriptions_update operation. */ +export interface BillingSubscriptionsUpdateHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for BillingSubscriptionsAliases_createOrUpdate operation. */ +export interface BillingSubscriptionsAliasesCreateOrUpdateHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Invoices_downloadDocumentsByBillingAccount operation. */ +export interface InvoicesDownloadDocumentsByBillingAccountHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Invoices_amend operation. */ +export interface InvoicesAmendHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Invoices_downloadByBillingAccount operation. */ +export interface InvoicesDownloadByBillingAccountHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Invoices_downloadSummaryByBillingAccount operation. */ +export interface InvoicesDownloadSummaryByBillingAccountHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Invoices_downloadDocumentsByBillingSubscription operation. */ +export interface InvoicesDownloadDocumentsByBillingSubscriptionHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Invoices_downloadByBillingSubscription operation. */ +export interface InvoicesDownloadByBillingSubscriptionHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for InvoiceSections_delete operation. */ +export interface InvoiceSectionsDeleteHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for InvoiceSections_createOrUpdate operation. */ +export interface InvoiceSectionsCreateOrUpdateHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Policies_createOrUpdateByCustomer operation. */ +export interface PoliciesCreateOrUpdateByCustomerHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Policies_createOrUpdateByBillingProfile operation. */ +export interface PoliciesCreateOrUpdateByBillingProfileHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Policies_createOrUpdateByCustomerAtBillingAccount operation. */ +export interface PoliciesCreateOrUpdateByCustomerAtBillingAccountHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Policies_createOrUpdateByBillingAccount operation. */ +export interface PoliciesCreateOrUpdateByBillingAccountHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Products_move operation. */ +export interface ProductsMoveHeaders { + location?: string; + retryAfter?: number; +} + +/** Defines headers for Reservations_updateByBillingAccount operation. */ +export interface ReservationsUpdateByBillingAccountHeaders { + /** URL for checking the ongoing status of the operation. */ + azureAsyncOperation?: string; + /** URL for determining when an operation has completed. Only use this value only when Azure-AsyncOperation isn't returned. */ + location?: string; + /** Clients should wait for the Retry-After interval before polling again */ + retryAfter?: number; +} + +/** Defines headers for Transactions_transactionsDownloadByInvoice operation. */ +export interface TransactionsTransactionsDownloadByInvoiceHeaders { + location?: string; + retryAfter?: number; +} + +/** Known values of {@link AcceptanceMode} that the service accepts. */ +export enum KnownAcceptanceMode { + /** Other */ + Other = "Other", + /** ClickToAccept */ + ClickToAccept = "ClickToAccept", + /** ESignEmbedded */ + ESignEmbedded = "ESignEmbedded", + /** ESignOffline */ + ESignOffline = "ESignOffline", + /** Implicit */ + Implicit = "Implicit", + /** Offline */ + Offline = "Offline", + /** PhysicalSign */ + PhysicalSign = "PhysicalSign", +} + +/** + * Defines values for AcceptanceMode. \ + * {@link KnownAcceptanceMode} can be used interchangeably with AcceptanceMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **ClickToAccept** \ + * **ESignEmbedded** \ + * **ESignOffline** \ + * **Implicit** \ + * **Offline** \ + * **PhysicalSign** + */ +export type AcceptanceMode = string; + +/** Known values of {@link Category} that the service accepts. */ +export enum KnownCategory { + /** Other */ + Other = "Other", + /** AffiliatePurchaseTerms */ + AffiliatePurchaseTerms = "AffiliatePurchaseTerms", + /** IndirectForGovernmentAgreement */ + IndirectForGovernmentAgreement = "IndirectForGovernmentAgreement", + /** MicrosoftCustomerAgreement */ + MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", + /** MicrosoftPartnerAgreement */ + MicrosoftPartnerAgreement = "MicrosoftPartnerAgreement", + /** UKCloudComputeFramework */ + UKCloudComputeFramework = "UKCloudComputeFramework", +} + +/** + * Defines values for Category. \ + * {@link KnownCategory} can be used interchangeably with Category, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **AffiliatePurchaseTerms** \ + * **IndirectForGovernmentAgreement** \ + * **MicrosoftCustomerAgreement** \ + * **MicrosoftPartnerAgreement** \ + * **UKCloudComputeFramework** + */ +export type Category = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", + /** Failed */ + Failed = "Failed", + /** New */ + New = "New", + /** Pending */ + Pending = "Pending", + /** Provisioning */ + Provisioning = "Provisioning", + /** PendingBilling */ + PendingBilling = "PendingBilling", + /** ConfirmedBilling */ + ConfirmedBilling = "ConfirmedBilling", + /** Creating */ + Creating = "Creating", + /** Created */ + Created = "Created", + /** Expired */ + Expired = "Expired", +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Canceled** \ + * **Failed** \ + * **New** \ + * **Pending** \ + * **Provisioning** \ + * **PendingBilling** \ + * **ConfirmedBilling** \ + * **Creating** \ + * **Created** \ + * **Expired** + */ +export type ProvisioningState = string; + +/** Known values of {@link BillingManagementTenantState} that the service accepts. */ +export enum KnownBillingManagementTenantState { + /** Other */ + Other = "Other", + /** NotAllowed */ + NotAllowed = "NotAllowed", + /** Active */ + Active = "Active", + /** Revoked */ + Revoked = "Revoked", +} + +/** + * Defines values for BillingManagementTenantState. \ + * {@link KnownBillingManagementTenantState} can be used interchangeably with BillingManagementTenantState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **NotAllowed** \ + * **Active** \ + * **Revoked** + */ +export type BillingManagementTenantState = string; + +/** Known values of {@link ProvisioningTenantState} that the service accepts. */ +export enum KnownProvisioningTenantState { + /** Other */ + Other = "Other", + /** NotRequested */ + NotRequested = "NotRequested", + /** Active */ + Active = "Active", + /** Pending */ + Pending = "Pending", + /** BillingRequestExpired */ + BillingRequestExpired = "BillingRequestExpired", + /** BillingRequestDeclined */ + BillingRequestDeclined = "BillingRequestDeclined", + /** Revoked */ + Revoked = "Revoked", +} + +/** + * Defines values for ProvisioningTenantState. \ + * {@link KnownProvisioningTenantState} can be used interchangeably with ProvisioningTenantState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **NotRequested** \ + * **Active** \ + * **Pending** \ + * **BillingRequestExpired** \ + * **BillingRequestDeclined** \ + * **Revoked** + */ +export type ProvisioningTenantState = string; + +/** Known values of {@link PaymentMethodFamily} that the service accepts. */ +export enum KnownPaymentMethodFamily { + /** Other */ + Other = "Other", + /** None */ + None = "None", + /** CreditCard */ + CreditCard = "CreditCard", + /** Credits */ + Credits = "Credits", + /** CheckWire */ + CheckWire = "CheckWire", + /** EWallet */ + EWallet = "EWallet", + /** TaskOrder */ + TaskOrder = "TaskOrder", + /** DirectDebit */ + DirectDebit = "DirectDebit", +} + +/** + * Defines values for PaymentMethodFamily. \ + * {@link KnownPaymentMethodFamily} can be used interchangeably with PaymentMethodFamily, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **None** \ + * **CreditCard** \ + * **Credits** \ + * **CheckWire** \ + * **EWallet** \ + * **TaskOrder** \ + * **DirectDebit** + */ +export type PaymentMethodFamily = string; + +/** Known values of {@link AccountStatus} that the service accepts. */ +export enum KnownAccountStatus { + /** Other */ + Other = "Other", + /** Active */ + Active = "Active", + /** UnderReview */ + UnderReview = "UnderReview", + /** Disabled */ + Disabled = "Disabled", + /** Deleted */ + Deleted = "Deleted", + /** Extended */ + Extended = "Extended", + /** Pending */ + Pending = "Pending", + /** New */ + New = "New", + /** Expired */ + Expired = "Expired", + /** Terminated */ + Terminated = "Terminated", + /** Transferred */ + Transferred = "Transferred", +} + +/** + * Defines values for AccountStatus. \ + * {@link KnownAccountStatus} can be used interchangeably with AccountStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Active** \ + * **UnderReview** \ + * **Disabled** \ + * **Deleted** \ + * **Extended** \ + * **Pending** \ + * **New** \ + * **Expired** \ + * **Terminated** \ + * **Transferred** + */ +export type AccountStatus = string; + +/** Known values of {@link AccountType} that the service accepts. */ +export enum KnownAccountType { + /** Other */ + Other = "Other", + /** Enterprise */ + Enterprise = "Enterprise", + /** Individual */ + Individual = "Individual", + /** Partner */ + Partner = "Partner", + /** Reseller */ + Reseller = "Reseller", + /** ClassicPartner */ + ClassicPartner = "ClassicPartner", + /** Internal */ + Internal = "Internal", + /** Tenant */ + Tenant = "Tenant", + /** Business */ + Business = "Business", +} + +/** + * Defines values for AccountType. \ + * {@link KnownAccountType} can be used interchangeably with AccountType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Enterprise** \ + * **Individual** \ + * **Partner** \ + * **Reseller** \ + * **ClassicPartner** \ + * **Internal** \ + * **Tenant** \ + * **Business** + */ +export type AccountType = string; + +/** Known values of {@link AccountSubType} that the service accepts. */ +export enum KnownAccountSubType { + /** Other */ + Other = "Other", + /** None */ + None = "None", + /** Individual */ + Individual = "Individual", + /** Professional */ + Professional = "Professional", + /** Enterprise */ + Enterprise = "Enterprise", +} + +/** + * Defines values for AccountSubType. \ + * {@link KnownAccountSubType} can be used interchangeably with AccountSubType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **None** \ + * **Individual** \ + * **Professional** \ + * **Enterprise** + */ +export type AccountSubType = string; + +/** Known values of {@link BillingAccountStatusReasonCode} that the service accepts. */ +export enum KnownBillingAccountStatusReasonCode { + /** Other */ + Other = "Other", + /** UnusualActivity */ + UnusualActivity = "UnusualActivity", + /** ManuallyTerminated */ + ManuallyTerminated = "ManuallyTerminated", + /** Expired */ + Expired = "Expired", + /** Transferred */ + Transferred = "Transferred", + /** TerminateProcessing */ + TerminateProcessing = "TerminateProcessing", +} + +/** + * Defines values for BillingAccountStatusReasonCode. \ + * {@link KnownBillingAccountStatusReasonCode} can be used interchangeably with BillingAccountStatusReasonCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **UnusualActivity** \ + * **ManuallyTerminated** \ + * **Expired** \ + * **Transferred** \ + * **TerminateProcessing** + */ +export type BillingAccountStatusReasonCode = string; + +/** Known values of {@link AgreementType} that the service accepts. */ +export enum KnownAgreementType { + /** Other */ + Other = "Other", + /** MicrosoftCustomerAgreement */ + MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", + /** EnterpriseAgreement */ + EnterpriseAgreement = "EnterpriseAgreement", + /** MicrosoftOnlineServicesProgram */ + MicrosoftOnlineServicesProgram = "MicrosoftOnlineServicesProgram", + /** MicrosoftPartnerAgreement */ + MicrosoftPartnerAgreement = "MicrosoftPartnerAgreement", +} + +/** + * Defines values for AgreementType. \ + * {@link KnownAgreementType} can be used interchangeably with AgreementType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **MicrosoftCustomerAgreement** \ + * **EnterpriseAgreement** \ + * **MicrosoftOnlineServicesProgram** \ + * **MicrosoftPartnerAgreement** + */ +export type AgreementType = string; + +/** Known values of {@link ExtendedTermOption} that the service accepts. */ +export enum KnownExtendedTermOption { + /** Other */ + Other = "Other", + /** OptedIn */ + OptedIn = "Opted-In", + /** OptedOut */ + OptedOut = "Opted-Out", +} + +/** + * Defines values for ExtendedTermOption. \ + * {@link KnownExtendedTermOption} can be used interchangeably with ExtendedTermOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Opted-In** \ + * **Opted-Out** + */ +export type ExtendedTermOption = string; + +/** Known values of {@link SupportLevel} that the service accepts. */ +export enum KnownSupportLevel { + /** Other */ + Other = "Other", + /** Standard */ + Standard = "Standard", + /** ProDirect */ + ProDirect = "Pro-Direct", + /** Developer */ + Developer = "Developer", +} + +/** + * Defines values for SupportLevel. \ + * {@link KnownSupportLevel} can be used interchangeably with SupportLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Standard** \ + * **Pro-Direct** \ + * **Developer** + */ +export type SupportLevel = string; + +/** Known values of {@link MarkupStatus} that the service accepts. */ +export enum KnownMarkupStatus { + /** Other */ + Other = "Other", + /** Disabled */ + Disabled = "Disabled", + /** Preview */ + Preview = "Preview", + /** Published */ + Published = "Published", + /** Locked */ + Locked = "Locked", +} + +/** + * Defines values for MarkupStatus. \ + * {@link KnownMarkupStatus} can be used interchangeably with MarkupStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Disabled** \ + * **Preview** \ + * **Published** \ + * **Locked** + */ +export type MarkupStatus = string; + +/** Known values of {@link BillingRelationshipType} that the service accepts. */ +export enum KnownBillingRelationshipType { + /** Other */ + Other = "Other", + /** Direct */ + Direct = "Direct", + /** IndirectCustomer */ + IndirectCustomer = "IndirectCustomer", + /** IndirectPartner */ + IndirectPartner = "IndirectPartner", + /** CSPPartner */ + CSPPartner = "CSPPartner", + /** CSPCustomer */ + CSPCustomer = "CSPCustomer", +} + +/** + * Defines values for BillingRelationshipType. \ + * {@link KnownBillingRelationshipType} can be used interchangeably with BillingRelationshipType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Direct** \ + * **IndirectCustomer** \ + * **IndirectPartner** \ + * **CSPPartner** \ + * **CSPCustomer** + */ +export type BillingRelationshipType = string; + +/** Known values of {@link TaxIdentifierType} that the service accepts. */ +export enum KnownTaxIdentifierType { + /** Other */ + Other = "Other", + /** BrazilCcmId */ + BrazilCcmId = "BrazilCcmId", + /** BrazilCnpjId */ + BrazilCnpjId = "BrazilCnpjId", + /** BrazilCpfId */ + BrazilCpfId = "BrazilCpfId", + /** CanadianFederalExempt */ + CanadianFederalExempt = "CanadianFederalExempt", + /** CanadianProvinceExempt */ + CanadianProvinceExempt = "CanadianProvinceExempt", + /** ExternalTaxation */ + ExternalTaxation = "ExternalTaxation", + /** IndiaFederalTanId */ + IndiaFederalTanId = "IndiaFederalTanId", + /** IndiaFederalServiceTaxId */ + IndiaFederalServiceTaxId = "IndiaFederalServiceTaxId", + /** IndiaPanId */ + IndiaPanId = "IndiaPanId", + /** IndiaStateCstId */ + IndiaStateCstId = "IndiaStateCstId", + /** IndiaStateGstINId */ + IndiaStateGstINId = "IndiaStateGstINId", + /** IndiaStateVatId */ + IndiaStateVatId = "IndiaStateVatId", + /** IntlExempt */ + IntlExempt = "IntlExempt", + /** USExempt */ + USExempt = "USExempt", + /** VatId */ + VatId = "VatId", + /** LoveCode */ + LoveCode = "LoveCode", + /** MobileBarCode */ + MobileBarCode = "MobileBarCode", + /** NationalIdentificationNumber */ + NationalIdentificationNumber = "NationalIdentificationNumber", + /** PublicSectorId */ + PublicSectorId = "PublicSectorId", +} + +/** + * Defines values for TaxIdentifierType. \ + * {@link KnownTaxIdentifierType} can be used interchangeably with TaxIdentifierType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **BrazilCcmId** \ + * **BrazilCnpjId** \ + * **BrazilCpfId** \ + * **CanadianFederalExempt** \ + * **CanadianProvinceExempt** \ + * **ExternalTaxation** \ + * **IndiaFederalTanId** \ + * **IndiaFederalServiceTaxId** \ + * **IndiaPanId** \ + * **IndiaStateCstId** \ + * **IndiaStateGstINId** \ + * **IndiaStateVatId** \ + * **IntlExempt** \ + * **USExempt** \ + * **VatId** \ + * **LoveCode** \ + * **MobileBarCode** \ + * **NationalIdentificationNumber** \ + * **PublicSectorId** + */ +export type TaxIdentifierType = string; + +/** Known values of {@link TaxIdentifierStatus} that the service accepts. */ +export enum KnownTaxIdentifierStatus { + /** Other */ + Other = "Other", + /** Valid */ + Valid = "Valid", + /** Invalid */ + Invalid = "Invalid", +} + +/** + * Defines values for TaxIdentifierStatus. \ + * {@link KnownTaxIdentifierStatus} can be used interchangeably with TaxIdentifierStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Valid** \ + * **Invalid** + */ +export type TaxIdentifierStatus = string; + +/** Known values of {@link BillingProfileStatus} that the service accepts. */ +export enum KnownBillingProfileStatus { + /** Other */ + Other = "Other", + /** Active */ + Active = "Active", + /** Disabled */ + Disabled = "Disabled", + /** Warned */ + Warned = "Warned", + /** Deleted */ + Deleted = "Deleted", + /** UnderReview */ + UnderReview = "UnderReview", +} + +/** + * Defines values for BillingProfileStatus. \ + * {@link KnownBillingProfileStatus} can be used interchangeably with BillingProfileStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Active** \ + * **Disabled** \ + * **Warned** \ + * **Deleted** \ + * **UnderReview** + */ +export type BillingProfileStatus = string; + +/** Known values of {@link BillingProfileStatusReasonCode} that the service accepts. */ +export enum KnownBillingProfileStatusReasonCode { + /** Other */ + Other = "Other", + /** PastDue */ + PastDue = "PastDue", + /** UnusualActivity */ + UnusualActivity = "UnusualActivity", + /** SpendingLimitReached */ + SpendingLimitReached = "SpendingLimitReached", + /** SpendingLimitExpired */ + SpendingLimitExpired = "SpendingLimitExpired", +} + +/** + * Defines values for BillingProfileStatusReasonCode. \ + * {@link KnownBillingProfileStatusReasonCode} can be used interchangeably with BillingProfileStatusReasonCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **PastDue** \ + * **UnusualActivity** \ + * **SpendingLimitReached** \ + * **SpendingLimitExpired** + */ +export type BillingProfileStatusReasonCode = string; + +/** Known values of {@link SpendingLimit} that the service accepts. */ +export enum KnownSpendingLimit { + /** Off */ + Off = "Off", + /** On */ + On = "On", +} + +/** + * Defines values for SpendingLimit. \ + * {@link KnownSpendingLimit} can be used interchangeably with SpendingLimit, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Off** \ + * **On** + */ +export type SpendingLimit = string; + +/** Known values of {@link PaymentTermsEligibilityStatus} that the service accepts. */ +export enum KnownPaymentTermsEligibilityStatus { + /** Other */ + Other = "Other", + /** Valid */ + Valid = "Valid", + /** Invalid */ + Invalid = "Invalid", +} + +/** + * Defines values for PaymentTermsEligibilityStatus. \ + * {@link KnownPaymentTermsEligibilityStatus} can be used interchangeably with PaymentTermsEligibilityStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Valid** \ + * **Invalid** + */ +export type PaymentTermsEligibilityStatus = string; + +/** Known values of {@link PaymentTermsEligibilityCode} that the service accepts. */ +export enum KnownPaymentTermsEligibilityCode { + /** Other */ + Other = "Other", + /** OverlappingPaymentTerms */ + OverlappingPaymentTerms = "OverlappingPaymentTerms", + /** InvalidDateFormat */ + InvalidDateFormat = "InvalidDateFormat", + /** InvalidDateRange */ + InvalidDateRange = "InvalidDateRange", + /** InactiveBillingAccount */ + InactiveBillingAccount = "InactiveBillingAccount", + /** InvalidBillingAccountType */ + InvalidBillingAccountType = "InvalidBillingAccountType", + /** NullOrEmptyPaymentTerms */ + NullOrEmptyPaymentTerms = "NullOrEmptyPaymentTerms", + /** BillingAccountNotFound */ + BillingAccountNotFound = "BillingAccountNotFound", + /** IneligibleBillingAccountStatus */ + IneligibleBillingAccountStatus = "IneligibleBillingAccountStatus", + /** InvalidTerms */ + InvalidTerms = "InvalidTerms", +} + +/** + * Defines values for PaymentTermsEligibilityCode. \ + * {@link KnownPaymentTermsEligibilityCode} can be used interchangeably with PaymentTermsEligibilityCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **OverlappingPaymentTerms** \ + * **InvalidDateFormat** \ + * **InvalidDateRange** \ + * **InactiveBillingAccount** \ + * **InvalidBillingAccountType** \ + * **NullOrEmptyPaymentTerms** \ + * **BillingAccountNotFound** \ + * **IneligibleBillingAccountStatus** \ + * **InvalidTerms** + */ +export type PaymentTermsEligibilityCode = string; + +/** Known values of {@link AddressValidationStatus} that the service accepts. */ +export enum KnownAddressValidationStatus { + /** Other */ + Other = "Other", + /** Valid */ + Valid = "Valid", + /** Invalid */ + Invalid = "Invalid", +} + +/** + * Defines values for AddressValidationStatus. \ + * {@link KnownAddressValidationStatus} can be used interchangeably with AddressValidationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Valid** \ + * **Invalid** + */ +export type AddressValidationStatus = string; + +/** Known values of {@link AccessDecision} that the service accepts. */ +export enum KnownAccessDecision { + /** Other */ + Other = "Other", + /** Allowed */ + Allowed = "Allowed", + /** NotAllowed */ + NotAllowed = "NotAllowed", +} + +/** + * Defines values for AccessDecision. \ + * {@link KnownAccessDecision} can be used interchangeably with AccessDecision, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Allowed** \ + * **NotAllowed** + */ +export type AccessDecision = string; + +/** Known values of {@link DeleteBillingProfileEligibilityStatus} that the service accepts. */ +export enum KnownDeleteBillingProfileEligibilityStatus { + /** Allowed */ + Allowed = "Allowed", + /** NotAllowed */ + NotAllowed = "NotAllowed", +} + +/** + * Defines values for DeleteBillingProfileEligibilityStatus. \ + * {@link KnownDeleteBillingProfileEligibilityStatus} can be used interchangeably with DeleteBillingProfileEligibilityStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allowed** \ + * **NotAllowed** + */ +export type DeleteBillingProfileEligibilityStatus = string; + +/** Known values of {@link DeleteBillingProfileEligibilityCode} that the service accepts. */ +export enum KnownDeleteBillingProfileEligibilityCode { + /** None */ + None = "None", + /** ActiveCredits */ + ActiveCredits = "ActiveCredits", + /** ActiveCreditCard */ + ActiveCreditCard = "ActiveCreditCard", + /** LastBillingProfile */ + LastBillingProfile = "LastBillingProfile", + /** NotSupported */ + NotSupported = "NotSupported", + /** OutstandingCharges */ + OutstandingCharges = "OutstandingCharges", + /** PendingCharges */ + PendingCharges = "PendingCharges", + /** ReservedInstances */ + ReservedInstances = "ReservedInstances", + /** ActiveBillingSubscriptions */ + ActiveBillingSubscriptions = "ActiveBillingSubscriptions", +} + +/** + * Defines values for DeleteBillingProfileEligibilityCode. \ + * {@link KnownDeleteBillingProfileEligibilityCode} can be used interchangeably with DeleteBillingProfileEligibilityCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **ActiveCredits** \ + * **ActiveCreditCard** \ + * **LastBillingProfile** \ + * **NotSupported** \ + * **OutstandingCharges** \ + * **PendingCharges** \ + * **ReservedInstances** \ + * **ActiveBillingSubscriptions** + */ +export type DeleteBillingProfileEligibilityCode = string; + +/** Known values of {@link SpendingLimitType} that the service accepts. */ +export enum KnownSpendingLimitType { + /** Other */ + Other = "Other", + /** None */ + None = "None", + /** FreeAccount */ + FreeAccount = "FreeAccount", + /** Sandbox */ + Sandbox = "Sandbox", + /** AzureForStudents */ + AzureForStudents = "AzureForStudents", + /** AcademicSponsorship */ + AcademicSponsorship = "AcademicSponsorship", + /** AzureConsumptionCredit */ + AzureConsumptionCredit = "AzureConsumptionCredit", + /** AzurePassSponsorship */ + AzurePassSponsorship = "AzurePassSponsorship", + /** MpnSponsorship */ + MpnSponsorship = "MpnSponsorship", + /** Msdn */ + Msdn = "MSDN", + /** NonProfitSponsorship */ + NonProfitSponsorship = "NonProfitSponsorship", + /** Sponsorship */ + Sponsorship = "Sponsorship", + /** StartupSponsorship */ + StartupSponsorship = "StartupSponsorship", + /** AzureForStudentsStarter */ + AzureForStudentsStarter = "AzureForStudentsStarter", + /** VisualStudio */ + VisualStudio = "VisualStudio", +} + +/** + * Defines values for SpendingLimitType. \ + * {@link KnownSpendingLimitType} can be used interchangeably with SpendingLimitType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **None** \ + * **FreeAccount** \ + * **Sandbox** \ + * **AzureForStudents** \ + * **AcademicSponsorship** \ + * **AzureConsumptionCredit** \ + * **AzurePassSponsorship** \ + * **MpnSponsorship** \ + * **MSDN** \ + * **NonProfitSponsorship** \ + * **Sponsorship** \ + * **StartupSponsorship** \ + * **AzureForStudentsStarter** \ + * **VisualStudio** + */ +export type SpendingLimitType = string; + +/** Known values of {@link SpendingLimitStatus} that the service accepts. */ +export enum KnownSpendingLimitStatus { + /** Other */ + Other = "Other", + /** None */ + None = "None", + /** Active */ + Active = "Active", + /** Expired */ + Expired = "Expired", + /** LimitReached */ + LimitReached = "LimitReached", + /** LimitRemoved */ + LimitRemoved = "LimitRemoved", +} + +/** + * Defines values for SpendingLimitStatus. \ + * {@link KnownSpendingLimitStatus} can be used interchangeably with SpendingLimitStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **None** \ + * **Active** \ + * **Expired** \ + * **LimitReached** \ + * **LimitRemoved** + */ +export type SpendingLimitStatus = string; + +/** Known values of {@link CustomerStatus} that the service accepts. */ +export enum KnownCustomerStatus { + /** Other */ + Other = "Other", + /** Active */ + Active = "Active", + /** Pending */ + Pending = "Pending", + /** Disabled */ + Disabled = "Disabled", + /** Warned */ + Warned = "Warned", + /** Deleted */ + Deleted = "Deleted", + /** UnderReview */ + UnderReview = "UnderReview", +} + +/** + * Defines values for CustomerStatus. \ + * {@link KnownCustomerStatus} can be used interchangeably with CustomerStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Active** \ + * **Pending** \ + * **Disabled** \ + * **Warned** \ + * **Deleted** \ + * **UnderReview** + */ +export type CustomerStatus = string; + +/** Known values of {@link InvoiceSectionState} that the service accepts. */ +export enum KnownInvoiceSectionState { + /** Other */ + Other = "Other", + /** Active */ + Active = "Active", + /** Deleted */ + Deleted = "Deleted", + /** Disabled */ + Disabled = "Disabled", + /** UnderReview */ + UnderReview = "UnderReview", + /** Warned */ + Warned = "Warned", + /** Restricted */ + Restricted = "Restricted", +} + +/** + * Defines values for InvoiceSectionState. \ + * {@link KnownInvoiceSectionState} can be used interchangeably with InvoiceSectionState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Active** \ + * **Deleted** \ + * **Disabled** \ + * **UnderReview** \ + * **Warned** \ + * **Restricted** + */ +export type InvoiceSectionState = string; + +/** Known values of {@link InvoiceSectionStateReasonCode} that the service accepts. */ +export enum KnownInvoiceSectionStateReasonCode { + /** Other */ + Other = "Other", + /** PastDue */ + PastDue = "PastDue", + /** UnusualActivity */ + UnusualActivity = "UnusualActivity", + /** SpendingLimitReached */ + SpendingLimitReached = "SpendingLimitReached", + /** SpendingLimitExpired */ + SpendingLimitExpired = "SpendingLimitExpired", +} + +/** + * Defines values for InvoiceSectionStateReasonCode. \ + * {@link KnownInvoiceSectionStateReasonCode} can be used interchangeably with InvoiceSectionStateReasonCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **PastDue** \ + * **UnusualActivity** \ + * **SpendingLimitReached** \ + * **SpendingLimitExpired** + */ +export type InvoiceSectionStateReasonCode = string; + +/** Known values of {@link BillingSubscriptionStatus} that the service accepts. */ +export enum KnownBillingSubscriptionStatus { + /** Other */ + Other = "Other", + /** Unknown */ + Unknown = "Unknown", + /** Active */ + Active = "Active", + /** Disabled */ + Disabled = "Disabled", + /** Deleted */ + Deleted = "Deleted", + /** Warned */ + Warned = "Warned", + /** Expiring */ + Expiring = "Expiring", + /** Expired */ + Expired = "Expired", + /** AutoRenew */ + AutoRenew = "AutoRenew", + /** Cancelled */ + Cancelled = "Cancelled", + /** Suspended */ + Suspended = "Suspended", + /** Failed */ + Failed = "Failed", +} + +/** + * Defines values for BillingSubscriptionStatus. \ + * {@link KnownBillingSubscriptionStatus} can be used interchangeably with BillingSubscriptionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Unknown** \ + * **Active** \ + * **Disabled** \ + * **Deleted** \ + * **Warned** \ + * **Expiring** \ + * **Expired** \ + * **AutoRenew** \ + * **Cancelled** \ + * **Suspended** \ + * **Failed** + */ +export type BillingSubscriptionStatus = string; + +/** Known values of {@link SubscriptionStatusReason} that the service accepts. */ +export enum KnownSubscriptionStatusReason { + /** None */ + None = "None", + /** Cancelled */ + Cancelled = "Cancelled", + /** PastDue */ + PastDue = "PastDue", + /** SuspiciousActivity */ + SuspiciousActivity = "SuspiciousActivity", + /** Other */ + Other = "Other", + /** Transferred */ + Transferred = "Transferred", + /** PolicyViolation */ + PolicyViolation = "PolicyViolation", + /** SpendingLimitReached */ + SpendingLimitReached = "SpendingLimitReached", + /** Expired */ + Expired = "Expired", +} + +/** + * Defines values for SubscriptionStatusReason. \ + * {@link KnownSubscriptionStatusReason} can be used interchangeably with SubscriptionStatusReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Cancelled** \ + * **PastDue** \ + * **SuspiciousActivity** \ + * **Other** \ + * **Transferred** \ + * **PolicyViolation** \ + * **SpendingLimitReached** \ + * **Expired** + */ +export type SubscriptionStatusReason = string; + +/** Known values of {@link SubscriptionBillingType} that the service accepts. */ +export enum KnownSubscriptionBillingType { + /** None */ + None = "None", + /** Benefit */ + Benefit = "Benefit", + /** Free */ + Free = "Free", + /** Paid */ + Paid = "Paid", + /** PrePaid */ + PrePaid = "PrePaid", +} + +/** + * Defines values for SubscriptionBillingType. \ + * {@link KnownSubscriptionBillingType} can be used interchangeably with SubscriptionBillingType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Benefit** \ + * **Free** \ + * **Paid** \ + * **PrePaid** + */ +export type SubscriptionBillingType = string; + +/** Known values of {@link SubscriptionWorkloadType} that the service accepts. */ +export enum KnownSubscriptionWorkloadType { + /** None */ + None = "None", + /** Production */ + Production = "Production", + /** DevTest */ + DevTest = "DevTest", + /** Internal */ + Internal = "Internal", +} + +/** + * Defines values for SubscriptionWorkloadType. \ + * {@link KnownSubscriptionWorkloadType} can be used interchangeably with SubscriptionWorkloadType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Production** \ + * **DevTest** \ + * **Internal** + */ +export type SubscriptionWorkloadType = string; + +/** Known values of {@link BillingRequestStatus} that the service accepts. */ +export enum KnownBillingRequestStatus { + /** Other */ + Other = "Other", + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Declined */ + Declined = "Declined", + /** Cancelled */ + Cancelled = "Cancelled", + /** Completed */ + Completed = "Completed", + /** Expired */ + Expired = "Expired", +} + +/** + * Defines values for BillingRequestStatus. \ + * {@link KnownBillingRequestStatus} can be used interchangeably with BillingRequestStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Pending** \ + * **Approved** \ + * **Declined** \ + * **Cancelled** \ + * **Completed** \ + * **Expired** + */ +export type BillingRequestStatus = string; + +/** Known values of {@link BillingRequestType} that the service accepts. */ +export enum KnownBillingRequestType { + /** Other */ + Other = "Other", + /** InvoiceAccess */ + InvoiceAccess = "InvoiceAccess", + /** ProvisioningAccess */ + ProvisioningAccess = "ProvisioningAccess", + /** RoleAssignment */ + RoleAssignment = "RoleAssignment", + /** UpdateBillingPolicy */ + UpdateBillingPolicy = "UpdateBillingPolicy", +} + +/** + * Defines values for BillingRequestType. \ + * {@link KnownBillingRequestType} can be used interchangeably with BillingRequestType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **InvoiceAccess** \ + * **ProvisioningAccess** \ + * **RoleAssignment** \ + * **UpdateBillingPolicy** + */ +export type BillingRequestType = string; + +/** Known values of {@link PrincipalType} that the service accepts. */ +export enum KnownPrincipalType { + /** Unknown */ + Unknown = "Unknown", + /** None */ + None = "None", + /** User */ + User = "User", + /** Group */ + Group = "Group", + /** DirectoryRole */ + DirectoryRole = "DirectoryRole", + /** ServicePrincipal */ + ServicePrincipal = "ServicePrincipal", + /** Everyone */ + Everyone = "Everyone", +} + +/** + * Defines values for PrincipalType. \ + * {@link KnownPrincipalType} can be used interchangeably with PrincipalType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **None** \ + * **User** \ + * **Group** \ + * **DirectoryRole** \ + * **ServicePrincipal** \ + * **Everyone** + */ +export type PrincipalType = string; + +/** Known values of {@link SavingsPlanTerm} that the service accepts. */ +export enum KnownSavingsPlanTerm { + /** P1Y */ + P1Y = "P1Y", + /** P3Y */ + P3Y = "P3Y", + /** P5Y */ + P5Y = "P5Y", +} + +/** + * Defines values for SavingsPlanTerm. \ + * {@link KnownSavingsPlanTerm} can be used interchangeably with SavingsPlanTerm, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **P1Y** \ + * **P3Y** \ + * **P5Y** + */ +export type SavingsPlanTerm = string; + +/** Known values of {@link BillingPlan} that the service accepts. */ +export enum KnownBillingPlan { + /** P1M */ + P1M = "P1M", +} + +/** + * Defines values for BillingPlan. \ + * {@link KnownBillingPlan} can be used interchangeably with BillingPlan, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **P1M** + */ +export type BillingPlan = string; + +/** Known values of {@link PaymentStatus} that the service accepts. */ +export enum KnownPaymentStatus { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Scheduled */ + Scheduled = "Scheduled", + /** Cancelled */ + Cancelled = "Cancelled", + /** Completed */ + Completed = "Completed", + /** Pending */ + Pending = "Pending", +} + +/** + * Defines values for PaymentStatus. \ + * {@link KnownPaymentStatus} can be used interchangeably with PaymentStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Scheduled** \ + * **Cancelled** \ + * **Completed** \ + * **Pending** + */ +export type PaymentStatus = string; + +/** Known values of {@link AppliedScopeType} that the service accepts. */ +export enum KnownAppliedScopeType { + /** Single */ + Single = "Single", + /** Shared */ + Shared = "Shared", + /** ManagementGroup */ + ManagementGroup = "ManagementGroup", +} + +/** + * Defines values for AppliedScopeType. \ + * {@link KnownAppliedScopeType} can be used interchangeably with AppliedScopeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Single** \ + * **Shared** \ + * **ManagementGroup** + */ +export type AppliedScopeType = string; + +/** Known values of {@link CommitmentGrain} that the service accepts. */ +export enum KnownCommitmentGrain { + /** Hourly */ + Hourly = "Hourly", +} + +/** + * Defines values for CommitmentGrain. \ + * {@link KnownCommitmentGrain} can be used interchangeably with CommitmentGrain, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Hourly** + */ +export type CommitmentGrain = string; + +/** Known values of {@link AutoRenew} that the service accepts. */ +export enum KnownAutoRenew { + /** Off */ + Off = "Off", + /** On */ + On = "On", +} + +/** + * Defines values for AutoRenew. \ + * {@link KnownAutoRenew} can be used interchangeably with AutoRenew, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Off** \ + * **On** + */ +export type AutoRenew = string; + +/** Known values of {@link SubscriptionEnrollmentAccountStatus} that the service accepts. */ +export enum KnownSubscriptionEnrollmentAccountStatus { + /** Active */ + Active = "Active", + /** Cancelled */ + Cancelled = "Cancelled", + /** Expired */ + Expired = "Expired", + /** Deleted */ + Deleted = "Deleted", + /** TransferredOut */ + TransferredOut = "TransferredOut", + /** Transferring */ + Transferring = "Transferring", + /** Inactive */ + Inactive = "Inactive", +} + +/** + * Defines values for SubscriptionEnrollmentAccountStatus. \ + * {@link KnownSubscriptionEnrollmentAccountStatus} can be used interchangeably with SubscriptionEnrollmentAccountStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **Cancelled** \ + * **Expired** \ + * **Deleted** \ + * **TransferredOut** \ + * **Transferring** \ + * **Inactive** + */ +export type SubscriptionEnrollmentAccountStatus = string; + +/** Known values of {@link Cancellation} that the service accepts. */ +export enum KnownCancellation { + /** NotAllowed */ + NotAllowed = "NotAllowed", + /** Allowed */ + Allowed = "Allowed", +} + +/** + * Defines values for Cancellation. \ + * {@link KnownCancellation} can be used interchangeably with Cancellation, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotAllowed** \ + * **Allowed** + */ +export type Cancellation = string; + +/** Known values of {@link BillingSubscriptionOperationStatus} that the service accepts. */ +export enum KnownBillingSubscriptionOperationStatus { + /** Other */ + Other = "Other", + /** None */ + None = "None", + /** LockedForUpdate */ + LockedForUpdate = "LockedForUpdate", +} + +/** + * Defines values for BillingSubscriptionOperationStatus. \ + * {@link KnownBillingSubscriptionOperationStatus} can be used interchangeably with BillingSubscriptionOperationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **None** \ + * **LockedForUpdate** + */ +export type BillingSubscriptionOperationStatus = string; + +/** Known values of {@link CancellationReason} that the service accepts. */ +export enum KnownCancellationReason { + /** Other */ + Other = "Other", + /** Compromise */ + Compromise = "Compromise", + /** Dispute */ + Dispute = "Dispute", +} + +/** + * Defines values for CancellationReason. \ + * {@link KnownCancellationReason} can be used interchangeably with CancellationReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Compromise** \ + * **Dispute** + */ +export type CancellationReason = string; + +/** Known values of {@link SubscriptionTransferValidationErrorCode} that the service accepts. */ +export enum KnownSubscriptionTransferValidationErrorCode { + /** Other */ + Other = "Other", + /** BillingAccountInactive */ + BillingAccountInactive = "BillingAccountInactive", + /** 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", + /** ProductInactive */ + ProductInactive = "ProductInactive", + /** ProductNotFound */ + ProductNotFound = "ProductNotFound", + /** ProductTypeNotSupported */ + ProductTypeNotSupported = "ProductTypeNotSupported", + /** SourceBillingProfilePastDue */ + SourceBillingProfilePastDue = "SourceBillingProfilePastDue", + /** SourceInvoiceSectionInactive */ + SourceInvoiceSectionInactive = "SourceInvoiceSectionInactive", + /** AccountIsLocked */ + AccountIsLocked = "AccountIsLocked", + /** AssetHasCap */ + AssetHasCap = "AssetHasCap", + /** AssetNotActive */ + AssetNotActive = "AssetNotActive", + /** BillingProfilePastDue */ + BillingProfilePastDue = "BillingProfilePastDue", + /** CrossBillingAccountNotAllowed */ + CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed", + /** NoActiveAzurePlan */ + NoActiveAzurePlan = "NoActiveAzurePlan", + /** None */ + None = "None", + /** SubscriptionNotActive */ + SubscriptionNotActive = "SubscriptionNotActive", + /** SubscriptionHasReservations */ + SubscriptionHasReservations = "SubscriptionHasReservations", + /** SubscriptionTypeNotSupported */ + SubscriptionTypeNotSupported = "SubscriptionTypeNotSupported", + /** InvoiceSectionIsRestricted */ + InvoiceSectionIsRestricted = "InvoiceSectionIsRestricted", +} + +/** + * Defines values for SubscriptionTransferValidationErrorCode. \ + * {@link KnownSubscriptionTransferValidationErrorCode} can be used interchangeably with SubscriptionTransferValidationErrorCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **BillingAccountInactive** \ + * **DestinationBillingProfileInactive** \ + * **DestinationBillingProfileNotFound** \ + * **DestinationBillingProfilePastDue** \ + * **DestinationInvoiceSectionInactive** \ + * **DestinationInvoiceSectionNotFound** \ + * **InsufficientPermissionOnDestination** \ + * **InsufficientPermissionOnSource** \ + * **InvalidDestination** \ + * **InvalidSource** \ + * **MarketplaceNotEnabledOnDestination** \ + * **ProductInactive** \ + * **ProductNotFound** \ + * **ProductTypeNotSupported** \ + * **SourceBillingProfilePastDue** \ + * **SourceInvoiceSectionInactive** \ + * **AccountIsLocked** \ + * **AssetHasCap** \ + * **AssetNotActive** \ + * **BillingProfilePastDue** \ + * **CrossBillingAccountNotAllowed** \ + * **NoActiveAzurePlan** \ + * **None** \ + * **SubscriptionNotActive** \ + * **SubscriptionHasReservations** \ + * **SubscriptionTypeNotSupported** \ + * **InvoiceSectionIsRestricted** + */ +export type SubscriptionTransferValidationErrorCode = string; + +/** Known values of {@link InvoiceDocumentType} that the service accepts. */ +export enum KnownInvoiceDocumentType { + /** Other */ + Other = "Other", + /** Invoice */ + Invoice = "Invoice", + /** VoidNote */ + VoidNote = "VoidNote", + /** TaxReceipt */ + TaxReceipt = "TaxReceipt", + /** CreditNote */ + CreditNote = "CreditNote", + /** Summary */ + Summary = "Summary", + /** Transactions */ + Transactions = "Transactions", +} + +/** + * Defines values for InvoiceDocumentType. \ + * {@link KnownInvoiceDocumentType} can be used interchangeably with InvoiceDocumentType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Invoice** \ + * **VoidNote** \ + * **TaxReceipt** \ + * **CreditNote** \ + * **Summary** \ + * **Transactions** + */ +export type InvoiceDocumentType = string; + +/** Known values of {@link DocumentSource} that the service accepts. */ +export enum KnownDocumentSource { + /** Other */ + Other = "Other", + /** DRS */ + DRS = "DRS", + /** ENF */ + ENF = "ENF", +} + +/** + * Defines values for DocumentSource. \ + * {@link KnownDocumentSource} can be used interchangeably with DocumentSource, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **DRS** \ + * **ENF** + */ +export type DocumentSource = string; + +/** Known values of {@link FailedPaymentReason} that the service accepts. */ +export enum KnownFailedPaymentReason { + /** Other */ + Other = "Other", + /** BankDeclined */ + BankDeclined = "BankDeclined", + /** CardExpired */ + CardExpired = "CardExpired", + /** IncorrectCardDetails */ + IncorrectCardDetails = "IncorrectCardDetails", +} + +/** + * Defines values for FailedPaymentReason. \ + * {@link KnownFailedPaymentReason} can be used interchangeably with FailedPaymentReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **BankDeclined** \ + * **CardExpired** \ + * **IncorrectCardDetails** + */ +export type FailedPaymentReason = string; + +/** Known values of {@link InvoiceType} that the service accepts. */ +export enum KnownInvoiceType { + /** Other */ + Other = "Other", + /** AzureServices */ + AzureServices = "AzureServices", + /** AzureMarketplace */ + AzureMarketplace = "AzureMarketplace", + /** AzureSupport */ + AzureSupport = "AzureSupport", +} + +/** + * Defines values for InvoiceType. \ + * {@link KnownInvoiceType} can be used interchangeably with InvoiceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **AzureServices** \ + * **AzureMarketplace** \ + * **AzureSupport** + */ +export type InvoiceType = string; + +/** Known values of {@link InvoiceStatus} that the service accepts. */ +export enum KnownInvoiceStatus { + /** Other */ + Other = "Other", + /** Due */ + Due = "Due", + /** OverDue */ + OverDue = "OverDue", + /** Paid */ + Paid = "Paid", + /** Void */ + Void = "Void", + /** Locked */ + Locked = "Locked", +} + +/** + * Defines values for InvoiceStatus. \ + * {@link KnownInvoiceStatus} can be used interchangeably with InvoiceStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Due** \ + * **OverDue** \ + * **Paid** \ + * **Void** \ + * **Locked** + */ +export type InvoiceStatus = string; + +/** Known values of {@link SpecialTaxationType} that the service accepts. */ +export enum KnownSpecialTaxationType { + /** SubtotalLevel */ + SubtotalLevel = "SubtotalLevel", + /** InvoiceLevel */ + InvoiceLevel = "InvoiceLevel", +} + +/** + * Defines values for SpecialTaxationType. \ + * {@link KnownSpecialTaxationType} can be used interchangeably with SpecialTaxationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SubtotalLevel** \ + * **InvoiceLevel** + */ +export type SpecialTaxationType = string; + +/** Known values of {@link RefundStatus} that the service accepts. */ +export enum KnownRefundStatus { + /** Other */ + Other = "Other", + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Declined */ + Declined = "Declined", + /** Cancelled */ + Cancelled = "Cancelled", + /** Completed */ + Completed = "Completed", + /** Expired */ + Expired = "Expired", +} + +/** + * Defines values for RefundStatus. \ + * {@link KnownRefundStatus} can be used interchangeably with RefundStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Pending** \ + * **Approved** \ + * **Declined** \ + * **Cancelled** \ + * **Completed** \ + * **Expired** + */ +export type RefundStatus = string; + +/** Known values of {@link RefundReasonCode} that the service accepts. */ +export enum KnownRefundReasonCode { + /** Other */ + Other = "Other", + /** AccidentalConversion */ + AccidentalConversion = "AccidentalConversion", + /** UnclearPricing */ + UnclearPricing = "UnclearPricing", + /** AccidentalPurchase */ + AccidentalPurchase = "AccidentalPurchase", + /** ForgotToCancel */ + ForgotToCancel = "ForgotToCancel", + /** UnclearDocumentation */ + UnclearDocumentation = "UnclearDocumentation", +} + +/** + * Defines values for RefundReasonCode. \ + * {@link KnownRefundReasonCode} can be used interchangeably with RefundReasonCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **AccidentalConversion** \ + * **UnclearPricing** \ + * **AccidentalPurchase** \ + * **ForgotToCancel** \ + * **UnclearDocumentation** + */ +export type RefundReasonCode = string; + +/** Known values of {@link DeleteInvoiceSectionEligibilityStatus} that the service accepts. */ +export enum KnownDeleteInvoiceSectionEligibilityStatus { + /** Allowed */ + Allowed = "Allowed", + /** NotAllowed */ + NotAllowed = "NotAllowed", +} + +/** + * Defines values for DeleteInvoiceSectionEligibilityStatus. \ + * {@link KnownDeleteInvoiceSectionEligibilityStatus} can be used interchangeably with DeleteInvoiceSectionEligibilityStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allowed** \ + * **NotAllowed** + */ +export type DeleteInvoiceSectionEligibilityStatus = string; + +/** Known values of {@link DeleteInvoiceSectionEligibilityCode} that the service accepts. */ +export enum KnownDeleteInvoiceSectionEligibilityCode { + /** Other */ + Other = "Other", + /** LastInvoiceSection */ + LastInvoiceSection = "LastInvoiceSection", + /** ActiveAzurePlans */ + ActiveAzurePlans = "ActiveAzurePlans", + /** ReservedInstances */ + ReservedInstances = "ReservedInstances", + /** ActiveBillingSubscriptions */ + ActiveBillingSubscriptions = "ActiveBillingSubscriptions", +} + +/** + * Defines values for DeleteInvoiceSectionEligibilityCode. \ + * {@link KnownDeleteInvoiceSectionEligibilityCode} can be used interchangeably with DeleteInvoiceSectionEligibilityCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **LastInvoiceSection** \ + * **ActiveAzurePlans** \ + * **ReservedInstances** \ + * **ActiveBillingSubscriptions** + */ +export type DeleteInvoiceSectionEligibilityCode = string; + +/** Known values of {@link PaymentMethodStatus} that the service accepts. */ +export enum KnownPaymentMethodStatus { + /** Active */ + Active = "active", + /** Inactive */ + Inactive = "inactive", +} + +/** + * Defines values for PaymentMethodStatus. \ + * {@link KnownPaymentMethodStatus} can be used interchangeably with PaymentMethodStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **active** \ + * **inactive** + */ +export type PaymentMethodStatus = string; + +/** Known values of {@link ServiceDefinedResourceName} that the service accepts. */ +export enum KnownServiceDefinedResourceName { + /** Default */ + Default = "default", +} + +/** + * Defines values for ServiceDefinedResourceName. \ + * {@link KnownServiceDefinedResourceName} can be used interchangeably with ServiceDefinedResourceName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **default** + */ +export type ServiceDefinedResourceName = string; + +/** Known values of {@link ViewChargesPolicy} that the service accepts. */ +export enum KnownViewChargesPolicy { + /** Other */ + Other = "Other", + /** Allowed */ + Allowed = "Allowed", + /** NotAllowed */ + NotAllowed = "NotAllowed", +} + +/** + * Defines values for ViewChargesPolicy. \ + * {@link KnownViewChargesPolicy} can be used interchangeably with ViewChargesPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Allowed** \ + * **NotAllowed** + */ +export type ViewChargesPolicy = string; + +/** Known values of {@link PolicyType} that the service accepts. */ +export enum KnownPolicyType { + /** Other */ + Other = "Other", + /** UserControlled */ + UserControlled = "UserControlled", + /** SystemControlled */ + SystemControlled = "SystemControlled", +} + +/** + * Defines values for PolicyType. \ + * {@link KnownPolicyType} can be used interchangeably with PolicyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **UserControlled** \ + * **SystemControlled** + */ +export type PolicyType = string; + +/** Known values of {@link EnrollmentAuthLevelState} that the service accepts. */ +export enum KnownEnrollmentAuthLevelState { + /** Other */ + Other = "Other", + /** MicrosoftAccountOnly */ + MicrosoftAccountOnly = "MicrosoftAccountOnly", + /** MixedAccount */ + MixedAccount = "MixedAccount", + /** OrganizationalAccountCrossTenant */ + OrganizationalAccountCrossTenant = "OrganizationalAccountCrossTenant", + /** OrganizationalAccountOnly */ + OrganizationalAccountOnly = "OrganizationalAccountOnly", +} + +/** + * Defines values for EnrollmentAuthLevelState. \ + * {@link KnownEnrollmentAuthLevelState} can be used interchangeably with EnrollmentAuthLevelState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **MicrosoftAccountOnly** \ + * **MixedAccount** \ + * **OrganizationalAccountCrossTenant** \ + * **OrganizationalAccountOnly** + */ +export type EnrollmentAuthLevelState = string; + +/** Known values of {@link EnrollmentAccountOwnerViewCharges} that the service accepts. */ +export enum KnownEnrollmentAccountOwnerViewCharges { + /** Other */ + Other = "Other", + /** Allowed */ + Allowed = "Allowed", + /** Disabled */ + Disabled = "Disabled", + /** NotAllowed */ + NotAllowed = "NotAllowed", +} + +/** + * Defines values for EnrollmentAccountOwnerViewCharges. \ + * {@link KnownEnrollmentAccountOwnerViewCharges} can be used interchangeably with EnrollmentAccountOwnerViewCharges, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Allowed** \ + * **Disabled** \ + * **NotAllowed** + */ +export type EnrollmentAccountOwnerViewCharges = string; + +/** Known values of {@link EnrollmentDepartmentAdminViewCharges} that the service accepts. */ +export enum KnownEnrollmentDepartmentAdminViewCharges { + /** Other */ + Other = "Other", + /** Allowed */ + Allowed = "Allowed", + /** Disabled */ + Disabled = "Disabled", + /** NotAllowed */ + NotAllowed = "NotAllowed", +} + +/** + * Defines values for EnrollmentDepartmentAdminViewCharges. \ + * {@link KnownEnrollmentDepartmentAdminViewCharges} can be used interchangeably with EnrollmentDepartmentAdminViewCharges, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Allowed** \ + * **Disabled** \ + * **NotAllowed** + */ +export type EnrollmentDepartmentAdminViewCharges = string; + +/** Known values of {@link InvoiceSectionLabelManagementPolicy} that the service accepts. */ +export enum KnownInvoiceSectionLabelManagementPolicy { + /** Other */ + Other = "Other", + /** Allowed */ + Allowed = "Allowed", + /** NotAllowed */ + NotAllowed = "NotAllowed", +} + +/** + * Defines values for InvoiceSectionLabelManagementPolicy. \ + * {@link KnownInvoiceSectionLabelManagementPolicy} can be used interchangeably with InvoiceSectionLabelManagementPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Allowed** \ + * **NotAllowed** + */ +export type InvoiceSectionLabelManagementPolicy = string; + +/** Known values of {@link MarketplacePurchasesPolicy} that the service accepts. */ +export enum KnownMarketplacePurchasesPolicy { + /** Other */ + Other = "Other", + /** AllAllowed */ + AllAllowed = "AllAllowed", + /** Disabled */ + Disabled = "Disabled", + /** NotAllowed */ + NotAllowed = "NotAllowed", + /** OnlyFreeAllowed */ + OnlyFreeAllowed = "OnlyFreeAllowed", +} + +/** + * Defines values for MarketplacePurchasesPolicy. \ + * {@link KnownMarketplacePurchasesPolicy} can be used interchangeably with MarketplacePurchasesPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **AllAllowed** \ + * **Disabled** \ + * **NotAllowed** \ + * **OnlyFreeAllowed** + */ +export type MarketplacePurchasesPolicy = string; + +/** Known values of {@link ReservationPurchasesPolicy} that the service accepts. */ +export enum KnownReservationPurchasesPolicy { + /** Other */ + Other = "Other", + /** Allowed */ + Allowed = "Allowed", + /** Disabled */ + Disabled = "Disabled", + /** NotAllowed */ + NotAllowed = "NotAllowed", +} + +/** + * Defines values for ReservationPurchasesPolicy. \ + * {@link KnownReservationPurchasesPolicy} can be used interchangeably with ReservationPurchasesPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Allowed** \ + * **Disabled** \ + * **NotAllowed** + */ +export type ReservationPurchasesPolicy = string; + +/** Known values of {@link SavingsPlanPurchasesPolicy} that the service accepts. */ +export enum KnownSavingsPlanPurchasesPolicy { + /** Other */ + Other = "Other", + /** Allowed */ + Allowed = "Allowed", + /** Disabled */ + Disabled = "Disabled", + /** NotAllowed */ + NotAllowed = "NotAllowed", +} + +/** + * Defines values for SavingsPlanPurchasesPolicy. \ + * {@link KnownSavingsPlanPurchasesPolicy} can be used interchangeably with SavingsPlanPurchasesPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Allowed** \ + * **Disabled** \ + * **NotAllowed** + */ +export type SavingsPlanPurchasesPolicy = string; + +/** Known values of {@link ProductStatus} that the service accepts. */ +export enum KnownProductStatus { + /** Other */ + Other = "Other", + /** Active */ + Active = "Active", + /** Disabled */ + Disabled = "Disabled", + /** Deleted */ + Deleted = "Deleted", + /** PastDue */ + PastDue = "PastDue", + /** Expiring */ + Expiring = "Expiring", + /** Expired */ + Expired = "Expired", + /** AutoRenew */ + AutoRenew = "AutoRenew", + /** Canceled */ + Canceled = "Canceled", + /** Suspended */ + Suspended = "Suspended", +} + +/** + * Defines values for ProductStatus. \ + * {@link KnownProductStatus} can be used interchangeably with ProductStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Active** \ * **Disabled** \ - * **Warned** + * **Deleted** \ + * **PastDue** \ + * **Expiring** \ + * **Expired** \ + * **AutoRenew** \ + * **Canceled** \ + * **Suspended** + */ +export type ProductStatus = string; + +/** Known values of {@link MoveValidationErrorCode} that the service accepts. */ +export enum KnownMoveValidationErrorCode { + /** Other */ + Other = "Other", + /** BillingAccountInactive */ + BillingAccountInactive = "BillingAccountInactive", + /** 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", + /** ProductInactive */ + ProductInactive = "ProductInactive", + /** ProductNotFound */ + ProductNotFound = "ProductNotFound", + /** ProductTypeNotSupported */ + ProductTypeNotSupported = "ProductTypeNotSupported", + /** SourceBillingProfilePastDue */ + SourceBillingProfilePastDue = "SourceBillingProfilePastDue", + /** SourceInvoiceSectionInactive */ + SourceInvoiceSectionInactive = "SourceInvoiceSectionInactive", +} + +/** + * Defines values for MoveValidationErrorCode. \ + * {@link KnownMoveValidationErrorCode} can be used interchangeably with MoveValidationErrorCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **BillingAccountInactive** \ + * **DestinationBillingProfileInactive** \ + * **DestinationBillingProfileNotFound** \ + * **DestinationBillingProfilePastDue** \ + * **DestinationInvoiceSectionInactive** \ + * **DestinationInvoiceSectionNotFound** \ + * **InsufficientPermissionOnDestination** \ + * **InsufficientPermissionOnSource** \ + * **InvalidDestination** \ + * **InvalidSource** \ + * **MarketplaceNotEnabledOnDestination** \ + * **ProductInactive** \ + * **ProductNotFound** \ + * **ProductTypeNotSupported** \ + * **SourceBillingProfilePastDue** \ + * **SourceInvoiceSectionInactive** */ -export type BillingProfileStatus = string; +export type MoveValidationErrorCode = string; + +/** Known values of {@link InstanceFlexibility} that the service accepts. */ +export enum KnownInstanceFlexibility { + /** On */ + On = "On", + /** Off */ + Off = "Off", +} + +/** + * Defines values for InstanceFlexibility. \ + * {@link KnownInstanceFlexibility} can be used interchangeably with InstanceFlexibility, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **On** \ + * **Off** + */ +export type InstanceFlexibility = string; + +/** Known values of {@link ReservationStatusCode} that the service accepts. */ +export enum KnownReservationStatusCode { + /** None */ + None = "None", + /** Pending */ + Pending = "Pending", + /** Processing */ + Processing = "Processing", + /** Active */ + Active = "Active", + /** PurchaseError */ + PurchaseError = "PurchaseError", + /** PaymentInstrumentError */ + PaymentInstrumentError = "PaymentInstrumentError", + /** Split */ + Split = "Split", + /** Merged */ + Merged = "Merged", + /** Expired */ + Expired = "Expired", + /** Succeeded */ + Succeeded = "Succeeded", + /** CapacityError */ + CapacityError = "CapacityError", + /** CapacityRestricted */ + CapacityRestricted = "CapacityRestricted", + /** Exchanged */ + Exchanged = "Exchanged", + /** UnknownError */ + UnknownError = "UnknownError", + /** RiskCheckFailed */ + RiskCheckFailed = "RiskCheckFailed", + /** CreditLineCheckFailed */ + CreditLineCheckFailed = "CreditLineCheckFailed", + /** Warning */ + Warning = "Warning", + /** NoBenefitDueToSubscriptionTransfer */ + NoBenefitDueToSubscriptionTransfer = "NoBenefitDueToSubscriptionTransfer", + /** NoBenefitDueToSubscriptionDeletion */ + NoBenefitDueToSubscriptionDeletion = "NoBenefitDueToSubscriptionDeletion", + /** NoBenefit */ + NoBenefit = "NoBenefit", +} + +/** + * Defines values for ReservationStatusCode. \ + * {@link KnownReservationStatusCode} can be used interchangeably with ReservationStatusCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Pending** \ + * **Processing** \ + * **Active** \ + * **PurchaseError** \ + * **PaymentInstrumentError** \ + * **Split** \ + * **Merged** \ + * **Expired** \ + * **Succeeded** \ + * **CapacityError** \ + * **CapacityRestricted** \ + * **Exchanged** \ + * **UnknownError** \ + * **RiskCheckFailed** \ + * **CreditLineCheckFailed** \ + * **Warning** \ + * **NoBenefitDueToSubscriptionTransfer** \ + * **NoBenefitDueToSubscriptionDeletion** \ + * **NoBenefit** + */ +export type ReservationStatusCode = string; + +/** Known values of {@link ReservationBillingPlan} that the service accepts. */ +export enum KnownReservationBillingPlan { + /** Upfront */ + Upfront = "Upfront", + /** Monthly */ + Monthly = "Monthly", +} + +/** + * Defines values for ReservationBillingPlan. \ + * {@link KnownReservationBillingPlan} can be used interchangeably with ReservationBillingPlan, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Upfront** \ + * **Monthly** + */ +export type ReservationBillingPlan = string; + +/** Known values of {@link TransactionType} that the service accepts. */ +export enum KnownTransactionType { + /** Other */ + Other = "Other", + /** Billed */ + Billed = "Billed", + /** Unbilled */ + Unbilled = "Unbilled", +} + +/** + * Defines values for TransactionType. \ + * {@link KnownTransactionType} can be used interchangeably with TransactionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **Billed** \ + * **Unbilled** + */ +export type TransactionType = string; + +/** Known values of {@link CreditType} that the service accepts. */ +export enum KnownCreditType { + /** Other */ + Other = "Other", + /** AzureFreeCredit */ + AzureFreeCredit = "AzureFreeCredit", + /** AzureCreditOffer */ + AzureCreditOffer = "AzureCreditOffer", + /** ServiceInterruption */ + ServiceInterruption = "ServiceInterruption", + /** Refund */ + Refund = "Refund", +} + +/** + * Defines values for CreditType. \ + * {@link KnownCreditType} can be used interchangeably with CreditType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **AzureFreeCredit** \ + * **AzureCreditOffer** \ + * **ServiceInterruption** \ + * **Refund** + */ +export type CreditType = string; + +/** Known values of {@link TransactionKind} that the service accepts. */ +export enum KnownTransactionKind { + /** Other */ + Other = "Other", + /** All */ + All = "All", + /** Reservation */ + Reservation = "Reservation", +} + +/** + * Defines values for TransactionKind. \ + * {@link KnownTransactionKind} can be used interchangeably with TransactionKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **All** \ + * **Reservation** + */ +export type TransactionKind = string; + +/** Known values of {@link TransferStatus} that the service accepts. */ +export enum KnownTransferStatus { + /** Expired */ + Expired = "Expired", + /** Pending */ + Pending = "Pending", + /** InProgress */ + InProgress = "InProgress", + /** Completed */ + Completed = "Completed", + /** CompletedWithErrors */ + CompletedWithErrors = "CompletedWithErrors", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Declined */ + Declined = "Declined", +} + +/** + * Defines values for TransferStatus. \ + * {@link KnownTransferStatus} can be used interchangeably with TransferStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Expired** \ + * **Pending** \ + * **InProgress** \ + * **Completed** \ + * **CompletedWithErrors** \ + * **Failed** \ + * **Canceled** \ + * **Declined** + */ +export type TransferStatus = string; + +/** Known values of {@link ProductType} that the service accepts. */ +export enum KnownProductType { + /** AzureSubscription */ + AzureSubscription = "AzureSubscription", + /** AzureReservation */ + AzureReservation = "AzureReservation", + /** Department */ + Department = "Department", + /** SavingsPlan */ + SavingsPlan = "SavingsPlan", + /** Saas */ + Saas = "SAAS", +} + +/** + * Defines values for ProductType. \ + * {@link KnownProductType} can be used interchangeably with ProductType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AzureSubscription** \ + * **AzureReservation** \ + * **Department** \ + * **SavingsPlan** \ + * **SAAS** + */ +export type ProductType = string; + +/** Known values of {@link ProductTransferStatus} that the service accepts. */ +export enum KnownProductTransferStatus { + /** NotStarted */ + NotStarted = "NotStarted", + /** InProgress */ + InProgress = "InProgress", + /** Completed */ + Completed = "Completed", + /** Failed */ + Failed = "Failed", +} + +/** + * Defines values for ProductTransferStatus. \ + * {@link KnownProductTransferStatus} can be used interchangeably with ProductTransferStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotStarted** \ + * **InProgress** \ + * **Completed** \ + * **Failed** + */ +export type ProductTransferStatus = string; + +/** Known values of {@link InitiatorCustomerType} that the service accepts. */ +export enum KnownInitiatorCustomerType { + /** Partner */ + Partner = "Partner", + /** EA */ + EA = "EA", +} + +/** + * Defines values for InitiatorCustomerType. \ + * {@link KnownInitiatorCustomerType} can be used interchangeably with InitiatorCustomerType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Partner** \ + * **EA** + */ +export type InitiatorCustomerType = string; + +/** Known values of {@link EligibleProductType} that the service accepts. */ +export enum KnownEligibleProductType { + /** DevTestAzureSubscription */ + DevTestAzureSubscription = "DevTestAzureSubscription", + /** StandardAzureSubscription */ + StandardAzureSubscription = "StandardAzureSubscription", + /** AzureReservation */ + AzureReservation = "AzureReservation", +} + +/** + * Defines values for EligibleProductType. \ + * {@link KnownEligibleProductType} can be used interchangeably with EligibleProductType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **DevTestAzureSubscription** \ + * **StandardAzureSubscription** \ + * **AzureReservation** + */ +export type EligibleProductType = string; + +/** Known values of {@link SupportedAccountType} that the service accepts. */ +export enum KnownSupportedAccountType { + /** None */ + None = "None", + /** Partner */ + Partner = "Partner", + /** Individual */ + Individual = "Individual", + /** Enterprise */ + Enterprise = "Enterprise", +} + +/** + * Defines values for SupportedAccountType. \ + * {@link KnownSupportedAccountType} can be used interchangeably with SupportedAccountType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Partner** \ + * **Individual** \ + * **Enterprise** + */ +export type SupportedAccountType = string; + +/** Optional parameters. */ +export interface AgreementsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AgreementsGetResponse = Agreement; + +/** Optional parameters. */ +export interface AgreementsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the participants. */ + expand?: string; +} + +/** Contains response data for the listByBillingAccount operation. */ +export type AgreementsListByBillingAccountResponse = AgreementListResult; + +/** Optional parameters. */ +export interface AgreementsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type AgreementsListByBillingAccountNextResponse = AgreementListResult; + +/** Optional parameters. */ +export interface AssociatedTenantsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type AssociatedTenantsDeleteResponse = AssociatedTenantsDeleteHeaders; + +/** Optional parameters. */ +export interface AssociatedTenantsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AssociatedTenantsGetResponse = AssociatedTenant; + +/** Optional parameters. */ +export interface AssociatedTenantsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type AssociatedTenantsCreateOrUpdateResponse = AssociatedTenant; + +/** Optional parameters. */ +export interface AssociatedTenantsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** Can be used to get revoked associated tenants. */ + includeRevoked?: boolean; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} + +/** Contains response data for the listByBillingAccount operation. */ +export type AssociatedTenantsListByBillingAccountResponse = + AssociatedTenantListResult; + +/** Optional parameters. */ +export interface AssociatedTenantsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type AssociatedTenantsListByBillingAccountNextResponse = + AssociatedTenantListResult; + +/** Optional parameters. */ +export interface AvailableBalancesGetByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByBillingAccount operation. */ +export type AvailableBalancesGetByBillingAccountResponse = AvailableBalance; + +/** Optional parameters. */ +export interface AvailableBalancesGetByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByBillingProfile operation. */ +export type AvailableBalancesGetByBillingProfileResponse = AvailableBalance; + +/** Optional parameters. */ +export interface BillingAccountsAddPaymentTermsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the addPaymentTerms operation. */ +export type BillingAccountsAddPaymentTermsResponse = BillingAccount; + +/** Optional parameters. */ +export interface BillingAccountsCancelPaymentTermsOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the cancelPaymentTerms operation. */ +export type BillingAccountsCancelPaymentTermsResponse = BillingAccount; + +/** Optional parameters. */ +export interface BillingAccountsConfirmTransitionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the confirmTransition operation. */ +export type BillingAccountsConfirmTransitionResponse = TransitionDetails; + +/** Optional parameters. */ +export interface BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; +} + +/** Contains response data for the listInvoiceSectionsByCreateSubscriptionPermission operation. */ +export type BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionResponse = + InvoiceSectionWithCreateSubPermissionListResult; + +/** Optional parameters. */ +export interface BillingAccountsValidatePaymentTermsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the validatePaymentTerms operation. */ +export type BillingAccountsValidatePaymentTermsResponse = + PaymentTermsEligibilityResult; + +/** Optional parameters. */ +export interface BillingAccountsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BillingAccountsGetResponse = BillingAccount; + +/** Optional parameters. */ +export interface BillingAccountsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type BillingAccountsUpdateResponse = BillingAccount; + +/** Optional parameters. */ +export interface BillingAccountsListOptionalParams + extends coreClient.OperationOptions { + /** Expand is allowed for SoldTo and EnrollmentDetails/PONumber. */ + expand?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** When true, results will include Billing Accounts that the user does not have a direct role assignment on if the user has one of the following AAD roles: Global Administrator, Global Reader, Billing Administrator. */ + includeAll?: boolean; + /** When true, results will include Billing Accounts that are not fully created if the user has one of the following AAD roles: Global Administrator, Global Reader, Billing Administrator. */ + includeAllWithoutBillingProfiles?: boolean; + /** When true, results will include any billing accounts in a deleted state. */ + includeDeleted?: boolean; + /** Includes billing accounts with agreement pending signature that the user has access to. */ + includePendingAgreement?: boolean; + /** Includes the customer's billing account of Microsoft Partner Agreement that the user has access to. */ + includeResellee?: boolean; + /** Must be combined with legalOwnerOID, results will only include Billing Accounts for whom is legally responsible for the Billing Accounts. Optional. */ + legalOwnerTID?: string; + /** Must be combined with legalOwnerTID, results will only include Billing Accounts for whom is legally responsible for the Billing Accounts. Optional. */ + legalOwnerOID?: string; +} + +/** Contains response data for the list operation. */ +export type BillingAccountsListResponse = BillingAccountListResult; + +/** Optional parameters. */ +export interface BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listInvoiceSectionsByCreateSubscriptionPermissionNext operation. */ +export type BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextResponse = + InvoiceSectionWithCreateSubPermissionListResult; + +/** Optional parameters. */ +export interface BillingAccountsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type BillingAccountsListNextResponse = BillingAccountListResult; + +/** Optional parameters. */ +export interface AddressValidateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the validate operation. */ +export type AddressValidateResponse = AddressValidationResponse; + +/** Optional parameters. */ +export interface BillingPermissionsListByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccount operation. */ +export type BillingPermissionsListByBillingAccountResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsListByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfile operation. */ +export type BillingPermissionsListByBillingProfileResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsCheckAccessByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkAccessByBillingProfile operation. */ +export type BillingPermissionsCheckAccessByBillingProfileResponse = + CheckAccessResponse[]; + +/** Optional parameters. */ +export interface BillingPermissionsListByCustomerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCustomer operation. */ +export type BillingPermissionsListByCustomerResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsCheckAccessByCustomerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkAccessByCustomer operation. */ +export type BillingPermissionsCheckAccessByCustomerResponse = + CheckAccessResponse[]; + +/** Optional parameters. */ +export interface BillingPermissionsListByInvoiceSectionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByInvoiceSection operation. */ +export type BillingPermissionsListByInvoiceSectionResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsCheckAccessByInvoiceSectionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkAccessByInvoiceSection operation. */ +export type BillingPermissionsCheckAccessByInvoiceSectionResponse = + CheckAccessResponse[]; + +/** Optional parameters. */ +export interface BillingPermissionsCheckAccessByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkAccessByBillingAccount operation. */ +export type BillingPermissionsCheckAccessByBillingAccountResponse = + CheckAccessResponse[]; + +/** Optional parameters. */ +export interface BillingPermissionsListByCustomerAtBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCustomerAtBillingAccount operation. */ +export type BillingPermissionsListByCustomerAtBillingAccountResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsListByDepartmentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByDepartment operation. */ +export type BillingPermissionsListByDepartmentResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsCheckAccessByDepartmentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkAccessByDepartment operation. */ +export type BillingPermissionsCheckAccessByDepartmentResponse = + CheckAccessResponse[]; + +/** Optional parameters. */ +export interface BillingPermissionsListByEnrollmentAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnrollmentAccount operation. */ +export type BillingPermissionsListByEnrollmentAccountResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsCheckAccessByEnrollmentAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkAccessByEnrollmentAccount operation. */ +export type BillingPermissionsCheckAccessByEnrollmentAccountResponse = + CheckAccessResponse[]; + +/** Optional parameters. */ +export interface BillingPermissionsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type BillingPermissionsListByBillingAccountNextResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type BillingPermissionsListByBillingProfileNextResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsListByCustomerNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCustomerNext operation. */ +export type BillingPermissionsListByCustomerNextResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsListByInvoiceSectionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByInvoiceSectionNext operation. */ +export type BillingPermissionsListByInvoiceSectionNextResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsListByCustomerAtBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCustomerAtBillingAccountNext operation. */ +export type BillingPermissionsListByCustomerAtBillingAccountNextResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsListByDepartmentNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByDepartmentNext operation. */ +export type BillingPermissionsListByDepartmentNextResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingPermissionsListByEnrollmentAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnrollmentAccountNext operation. */ +export type BillingPermissionsListByEnrollmentAccountNextResponse = + BillingPermissionListResult; + +/** Optional parameters. */ +export interface BillingProfilesValidateDeleteEligibilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the validateDeleteEligibility operation. */ +export type BillingProfilesValidateDeleteEligibilityResponse = + DeleteBillingProfileEligibilityResult; + +/** Optional parameters. */ +export interface BillingProfilesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type BillingProfilesDeleteResponse = BillingProfilesDeleteHeaders; + +/** Optional parameters. */ +export interface BillingProfilesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BillingProfilesGetResponse = BillingProfile; + +/** Optional parameters. */ +export interface BillingProfilesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type BillingProfilesCreateOrUpdateResponse = BillingProfile; + +/** Optional parameters. */ +export interface BillingProfilesListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** Can be used to get deleted billing profiles. */ + includeDeleted?: boolean; +} + +/** Contains response data for the listByBillingAccount operation. */ +export type BillingProfilesListByBillingAccountResponse = + BillingProfileListResult; + +/** Optional parameters. */ +export interface BillingProfilesListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type BillingProfilesListByBillingAccountNextResponse = + BillingProfileListResult; + +/** Optional parameters. */ +export interface BillingPropertyGetOptionalParams + extends coreClient.OperationOptions { + /** A flag that specifies whether or not to include billing country. */ + includeBillingCountry?: boolean; + /** A flag that specifies whether or not to include transition status for billing accounts with agreement type Microsoft Customer Agreement. */ + includeTransitionStatus?: boolean; +} + +/** Contains response data for the get operation. */ +export type BillingPropertyGetResponse = BillingProperty; + +/** Optional parameters. */ +export interface BillingPropertyUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type BillingPropertyUpdateResponse = BillingProperty; + +/** Optional parameters. */ +export interface BillingRequestsListByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} + +/** Contains response data for the listByBillingProfile operation. */ +export type BillingRequestsListByBillingProfileResponse = + BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRequestsListByCustomerOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} + +/** Contains response data for the listByCustomer operation. */ +export type BillingRequestsListByCustomerResponse = BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRequestsListByInvoiceSectionOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} + +/** Contains response data for the listByInvoiceSection operation. */ +export type BillingRequestsListByInvoiceSectionResponse = + BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRequestsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} + +/** Contains response data for the listByBillingAccount operation. */ +export type BillingRequestsListByBillingAccountResponse = + BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRequestsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type BillingRequestsGetResponse = BillingRequest; + +/** Optional parameters. */ +export interface BillingRequestsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type BillingRequestsCreateOrUpdateResponse = BillingRequest; + +/** Optional parameters. */ +export interface BillingRequestsListByUserOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} + +/** Contains response data for the listByUser operation. */ +export type BillingRequestsListByUserResponse = BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRequestsListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type BillingRequestsListByBillingProfileNextResponse = + BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRequestsListByCustomerNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCustomerNext operation. */ +export type BillingRequestsListByCustomerNextResponse = + BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRequestsListByInvoiceSectionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByInvoiceSectionNext operation. */ +export type BillingRequestsListByInvoiceSectionNextResponse = + BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRequestsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type BillingRequestsListByBillingAccountNextResponse = + BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRequestsListByUserNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByUserNext operation. */ +export type BillingRequestsListByUserNextResponse = BillingRequestListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsDeleteByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface BillingRoleAssignmentsGetByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByBillingProfile operation. */ +export type BillingRoleAssignmentsGetByBillingProfileResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; +} + +/** Contains response data for the listByBillingProfile operation. */ +export type BillingRoleAssignmentsListByBillingProfileResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsCreateByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createByBillingProfile operation. */ +export type BillingRoleAssignmentsCreateByBillingProfileResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsDeleteByCustomerOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface BillingRoleAssignmentsGetByCustomerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByCustomer operation. */ +export type BillingRoleAssignmentsGetByCustomerResponse = BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByCustomerOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; +} + +/** Contains response data for the listByCustomer operation. */ +export type BillingRoleAssignmentsListByCustomerResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsCreateByCustomerOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createByCustomer operation. */ +export type BillingRoleAssignmentsCreateByCustomerResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsResolveByCustomerOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** Resolves the scope display name for each of the role assignments. */ + resolveScopeDisplayNames?: boolean; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the resolveByCustomer operation. */ +export type BillingRoleAssignmentsResolveByCustomerResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface BillingRoleAssignmentsGetByInvoiceSectionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByInvoiceSection operation. */ +export type BillingRoleAssignmentsGetByInvoiceSectionResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByInvoiceSectionOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; +} + +/** Contains response data for the listByInvoiceSection operation. */ +export type BillingRoleAssignmentsListByInvoiceSectionResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createByInvoiceSection operation. */ +export type BillingRoleAssignmentsCreateByInvoiceSectionResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** Resolves the scope display name for each of the role assignments. */ + resolveScopeDisplayNames?: boolean; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the resolveByInvoiceSection operation. */ +export type BillingRoleAssignmentsResolveByInvoiceSectionResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsResolveByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** Resolves the scope display name for each of the role assignments. */ + resolveScopeDisplayNames?: boolean; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the resolveByBillingProfile operation. */ +export type BillingRoleAssignmentsResolveByBillingProfileResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsDeleteByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface BillingRoleAssignmentsGetByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByBillingAccount operation. */ +export type BillingRoleAssignmentsGetByBillingAccountResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdateByBillingAccount operation. */ +export type BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; +} + +/** Contains response data for the listByBillingAccount operation. */ +export type BillingRoleAssignmentsListByBillingAccountResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsCreateByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createByBillingAccount operation. */ +export type BillingRoleAssignmentsCreateByBillingAccountResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsDeleteByDepartmentOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface BillingRoleAssignmentsGetByDepartmentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByDepartment operation. */ +export type BillingRoleAssignmentsGetByDepartmentResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdateByDepartment operation. */ +export type BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByDepartmentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByDepartment operation. */ +export type BillingRoleAssignmentsListByDepartmentResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByEnrollmentAccount operation. */ +export type BillingRoleAssignmentsGetByEnrollmentAccountResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdateByEnrollmentAccount operation. */ +export type BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse = + BillingRoleAssignment; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByEnrollmentAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnrollmentAccount operation. */ +export type BillingRoleAssignmentsListByEnrollmentAccountResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsResolveByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** Resolves the scope display name for each of the role assignments. */ + resolveScopeDisplayNames?: boolean; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the resolveByBillingAccount operation. */ +export type BillingRoleAssignmentsResolveByBillingAccountResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type BillingRoleAssignmentsListByBillingProfileNextResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByCustomerNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCustomerNext operation. */ +export type BillingRoleAssignmentsListByCustomerNextResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByInvoiceSectionNext operation. */ +export type BillingRoleAssignmentsListByInvoiceSectionNextResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type BillingRoleAssignmentsListByBillingAccountNextResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByDepartmentNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByDepartmentNext operation. */ +export type BillingRoleAssignmentsListByDepartmentNextResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleAssignmentsListByEnrollmentAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnrollmentAccountNext operation. */ +export type BillingRoleAssignmentsListByEnrollmentAccountNextResponse = + BillingRoleAssignmentListResult; + +/** Optional parameters. */ +export interface BillingRoleDefinitionGetByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByBillingProfile operation. */ +export type BillingRoleDefinitionGetByBillingProfileResponse = + BillingRoleDefinition; + +/** Optional parameters. */ +export interface BillingRoleDefinitionListByBillingProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfile operation. */ +export type BillingRoleDefinitionListByBillingProfileResponse = + BillingRoleDefinitionListResult; + +/** Optional parameters. */ +export interface BillingRoleDefinitionGetByCustomerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByCustomer operation. */ +export type BillingRoleDefinitionGetByCustomerResponse = BillingRoleDefinition; + +/** Optional parameters. */ +export interface BillingRoleDefinitionListByCustomerOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCustomer operation. */ +export type BillingRoleDefinitionListByCustomerResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link StatusReasonCode} that the service accepts. */ -export enum KnownStatusReasonCode { - /** PastDue */ - PastDue = "PastDue", - /** SpendingLimitReached */ - SpendingLimitReached = "SpendingLimitReached", - /** SpendingLimitExpired */ - SpendingLimitExpired = "SpendingLimitExpired" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionGetByInvoiceSectionOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for StatusReasonCode. \ - * {@link KnownStatusReasonCode} can be used interchangeably with StatusReasonCode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **PastDue** \ - * **SpendingLimitReached** \ - * **SpendingLimitExpired** - */ -export type StatusReasonCode = string; +/** Contains response data for the getByInvoiceSection operation. */ +export type BillingRoleDefinitionGetByInvoiceSectionResponse = + BillingRoleDefinition; -/** Known values of {@link SpendingLimit} that the service accepts. */ -export enum KnownSpendingLimit { - /** Off */ - Off = "Off", - /** On */ - On = "On" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByInvoiceSectionOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for SpendingLimit. \ - * {@link KnownSpendingLimit} can be used interchangeably with SpendingLimit, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Off** \ - * **On** - */ -export type SpendingLimit = string; +/** Contains response data for the listByInvoiceSection operation. */ +export type BillingRoleDefinitionListByInvoiceSectionResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link StatusReasonCodeForBillingProfile} that the service accepts. */ -export enum KnownStatusReasonCodeForBillingProfile { - /** PastDue */ - PastDue = "PastDue", - /** SpendingLimitReached */ - SpendingLimitReached = "SpendingLimitReached", - /** SpendingLimitExpired */ - SpendingLimitExpired = "SpendingLimitExpired" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionGetByBillingAccountOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for StatusReasonCodeForBillingProfile. \ - * {@link KnownStatusReasonCodeForBillingProfile} can be used interchangeably with StatusReasonCodeForBillingProfile, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **PastDue** \ - * **SpendingLimitReached** \ - * **SpendingLimitExpired** - */ -export type StatusReasonCodeForBillingProfile = string; +/** Contains response data for the getByBillingAccount operation. */ +export type BillingRoleDefinitionGetByBillingAccountResponse = + BillingRoleDefinition; -/** Known values of {@link SpendingLimitForBillingProfile} that the service accepts. */ -export enum KnownSpendingLimitForBillingProfile { - /** Off */ - Off = "Off", - /** On */ - On = "On" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByBillingAccountOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for SpendingLimitForBillingProfile. \ - * {@link KnownSpendingLimitForBillingProfile} can be used interchangeably with SpendingLimitForBillingProfile, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Off** \ - * **On** - */ -export type SpendingLimitForBillingProfile = string; +/** Contains response data for the listByBillingAccount operation. */ +export type BillingRoleDefinitionListByBillingAccountResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link AddressValidationStatus} that the service accepts. */ -export enum KnownAddressValidationStatus { - /** Valid */ - Valid = "Valid", - /** Invalid */ - Invalid = "Invalid" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionGetByDepartmentOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for AddressValidationStatus. \ - * {@link KnownAddressValidationStatus} can be used interchangeably with AddressValidationStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Valid** \ - * **Invalid** - */ -export type AddressValidationStatus = string; +/** Contains response data for the getByDepartment operation. */ +export type BillingRoleDefinitionGetByDepartmentResponse = + BillingRoleDefinition; -/** 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" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByDepartmentOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for BillingSubscriptionStatusType. \ - * {@link KnownBillingSubscriptionStatusType} can be used interchangeably with BillingSubscriptionStatusType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Active** \ - * **Inactive** \ - * **Abandoned** \ - * **Deleted** \ - * **Warning** - */ -export type BillingSubscriptionStatusType = string; +/** Contains response data for the listByDepartment operation. */ +export type BillingRoleDefinitionListByDepartmentResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link AutoRenew} that the service accepts. */ -export enum KnownAutoRenew { - /** Off */ - Off = "Off", - /** On */ - On = "On" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionGetByEnrollmentAccountOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for AutoRenew. \ - * {@link KnownAutoRenew} can be used interchangeably with AutoRenew, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Off** \ - * **On** - */ -export type AutoRenew = string; +/** Contains response data for the getByEnrollmentAccount operation. */ +export type BillingRoleDefinitionGetByEnrollmentAccountResponse = + BillingRoleDefinition; -/** 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" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByEnrollmentAccountOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for ProductStatusType. \ - * {@link KnownProductStatusType} can be used interchangeably with ProductStatusType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Active** \ - * **Inactive** \ - * **PastDue** \ - * **Expiring** \ - * **Expired** \ - * **Disabled** \ - * **Cancelled** \ - * **AutoRenew** - */ -export type ProductStatusType = string; +/** Contains response data for the listByEnrollmentAccount operation. */ +export type BillingRoleDefinitionListByEnrollmentAccountResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link BillingFrequency} that the service accepts. */ -export enum KnownBillingFrequency { - /** OneTime */ - OneTime = "OneTime", - /** Monthly */ - Monthly = "Monthly", - /** UsageBased */ - UsageBased = "UsageBased" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for BillingFrequency. \ - * {@link KnownBillingFrequency} can be used interchangeably with BillingFrequency, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **OneTime** \ - * **Monthly** \ - * **UsageBased** - */ -export type BillingFrequency = string; +/** Contains response data for the listByBillingProfileNext operation. */ +export type BillingRoleDefinitionListByBillingProfileNextResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link InvoiceStatus} that the service accepts. */ -export enum KnownInvoiceStatus { - /** Due */ - Due = "Due", - /** OverDue */ - OverDue = "OverDue", - /** Paid */ - Paid = "Paid", - /** Void */ - Void = "Void" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByCustomerNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for InvoiceStatus. \ - * {@link KnownInvoiceStatus} can be used interchangeably with InvoiceStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Due** \ - * **OverDue** \ - * **Paid** \ - * **Void** - */ -export type InvoiceStatus = string; +/** Contains response data for the listByCustomerNext operation. */ +export type BillingRoleDefinitionListByCustomerNextResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link InvoiceType} that the service accepts. */ -export enum KnownInvoiceType { - /** AzureService */ - AzureService = "AzureService", - /** AzureMarketplace */ - AzureMarketplace = "AzureMarketplace", - /** AzureSupport */ - AzureSupport = "AzureSupport" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByInvoiceSectionNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for InvoiceType. \ - * {@link KnownInvoiceType} can be used interchangeably with InvoiceType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **AzureService** \ - * **AzureMarketplace** \ - * **AzureSupport** - */ -export type InvoiceType = string; +/** Contains response data for the listByInvoiceSectionNext operation. */ +export type BillingRoleDefinitionListByInvoiceSectionNextResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link DocumentType} that the service accepts. */ -export enum KnownDocumentType { - /** Invoice */ - Invoice = "Invoice", - /** VoidNote */ - VoidNote = "VoidNote", - /** TaxReceipt */ - TaxReceipt = "TaxReceipt", - /** CreditNote */ - CreditNote = "CreditNote" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for DocumentType. \ - * {@link KnownDocumentType} can be used interchangeably with DocumentType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invoice** \ - * **VoidNote** \ - * **TaxReceipt** \ - * **CreditNote** - */ -export type DocumentType = string; +/** Contains response data for the listByBillingAccountNext operation. */ +export type BillingRoleDefinitionListByBillingAccountNextResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link DocumentSource} that the service accepts. */ -export enum KnownDocumentSource { - /** DRS */ - DRS = "DRS", - /** ENF */ - ENF = "ENF" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByDepartmentNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for DocumentSource. \ - * {@link KnownDocumentSource} can be used interchangeably with DocumentSource, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **DRS** \ - * **ENF** - */ -export type DocumentSource = string; +/** Contains response data for the listByDepartmentNext operation. */ +export type BillingRoleDefinitionListByDepartmentNextResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link PaymentMethodFamily} that the service accepts. */ -export enum KnownPaymentMethodFamily { - /** Credits */ - Credits = "Credits", - /** CheckWire */ - CheckWire = "CheckWire", - /** CreditCard */ - CreditCard = "CreditCard", - /** None */ - None = "None" -} +/** Optional parameters. */ +export interface BillingRoleDefinitionListByEnrollmentAccountNextOptionalParams + extends coreClient.OperationOptions {} -/** - * Defines values for PaymentMethodFamily. \ - * {@link KnownPaymentMethodFamily} can be used interchangeably with PaymentMethodFamily, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Credits** \ - * **CheckWire** \ - * **CreditCard** \ - * **None** - */ -export type PaymentMethodFamily = string; +/** Contains response data for the listByEnrollmentAccountNext operation. */ +export type BillingRoleDefinitionListByEnrollmentAccountNextResponse = + BillingRoleDefinitionListResult; -/** Known values of {@link InvoiceDocumentType} that the service accepts. */ -export enum KnownInvoiceDocumentType { - /** Invoice */ - Invoice = "Invoice", - /** CreditNote */ - CreditNote = "CreditNote" +/** Optional parameters. */ +export interface SavingsPlanOrdersGetByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the planInformation. */ + expand?: string; } -/** - * Defines values for InvoiceDocumentType. \ - * {@link KnownInvoiceDocumentType} can be used interchangeably with InvoiceDocumentType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invoice** \ - * **CreditNote** - */ -export type InvoiceDocumentType = string; +/** Contains response data for the getByBillingAccount operation. */ +export type SavingsPlanOrdersGetByBillingAccountResponse = + SavingsPlanOrderModel; -/** 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" +/** Optional parameters. */ +export interface SavingsPlanOrdersListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The number of savings plans to skip from the list before returning results */ + skiptoken?: number; } -/** - * Defines values for SubscriptionTransferValidationErrorCode. \ - * {@link KnownSubscriptionTransferValidationErrorCode} can be used interchangeably with SubscriptionTransferValidationErrorCode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **BillingAccountInactive** \ - * **CrossBillingAccountNotAllowed** \ - * **DestinationBillingProfileInactive** \ - * **DestinationBillingProfileNotFound** \ - * **DestinationBillingProfilePastDue** \ - * **DestinationInvoiceSectionInactive** \ - * **DestinationInvoiceSectionNotFound** \ - * **InsufficientPermissionOnDestination** \ - * **InsufficientPermissionOnSource** \ - * **InvalidDestination** \ - * **InvalidSource** \ - * **MarketplaceNotEnabledOnDestination** \ - * **NotAvailableForDestinationMarket** \ - * **ProductInactive** \ - * **ProductNotFound** \ - * **ProductTypeNotSupported** \ - * **SourceBillingProfilePastDue** \ - * **SourceInvoiceSectionInactive** \ - * **SubscriptionNotActive** \ - * **SubscriptionTypeNotSupported** - */ -export type SubscriptionTransferValidationErrorCode = string; +/** Contains response data for the listByBillingAccount operation. */ +export type SavingsPlanOrdersListByBillingAccountResponse = + SavingsPlanOrderModelList; -/** 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" +/** Optional parameters. */ +export interface SavingsPlanOrdersListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type SavingsPlanOrdersListByBillingAccountNextResponse = + SavingsPlanOrderModelList; + +/** Optional parameters. */ +export interface SavingsPlansListBySavingsPlanOrderOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySavingsPlanOrder operation. */ +export type SavingsPlansListBySavingsPlanOrderResponse = SavingsPlanModelList; + +/** Optional parameters. */ +export interface SavingsPlansListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The number of savings plans to skip from the list before returning results */ + skiptoken?: number; + /** The number of savings plans to return */ + take?: number; + /** The selected provisioning state */ + selectedState?: string; + /** To indicate whether to refresh the roll up counts of the savings plans group by provisioning states */ + refreshSummary?: string; } -/** - * Defines values for ProductTransferValidationErrorCode. \ - * {@link KnownProductTransferValidationErrorCode} can be used interchangeably with ProductTransferValidationErrorCode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **InvalidSource** \ - * **ProductNotActive** \ - * **InsufficientPermissionOnSource** \ - * **InsufficientPermissionOnDestination** \ - * **DestinationBillingProfilePastDue** \ - * **ProductTypeNotSupported** \ - * **CrossBillingAccountNotAllowed** \ - * **NotAvailableForDestinationMarket** \ - * **OneTimePurchaseProductTransferNotAllowed** - */ -export type ProductTransferValidationErrorCode = string; +/** Contains response data for the listByBillingAccount operation. */ +export type SavingsPlansListByBillingAccountResponse = + SavingsPlanModelListResult; -/** Known values of {@link TransactionTypeKind} that the service accepts. */ -export enum KnownTransactionTypeKind { - /** All */ - All = "all", - /** Reservation */ - Reservation = "reservation" +/** Optional parameters. */ +export interface SavingsPlansGetByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the planInformation. */ + expand?: string; } -/** - * Defines values for TransactionTypeKind. \ - * {@link KnownTransactionTypeKind} can be used interchangeably with TransactionTypeKind, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **all** \ - * **reservation** - */ -export type TransactionTypeKind = string; +/** Contains response data for the getByBillingAccount operation. */ +export type SavingsPlansGetByBillingAccountResponse = SavingsPlanModel; -/** Known values of {@link ReservationType} that the service accepts. */ -export enum KnownReservationType { - /** Purchase */ - Purchase = "Purchase", - /** UsageCharge */ - UsageCharge = "Usage Charge" +/** Optional parameters. */ +export interface SavingsPlansUpdateByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * Defines values for ReservationType. \ - * {@link KnownReservationType} can be used interchangeably with ReservationType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Purchase** \ - * **Usage Charge** - */ -export type ReservationType = string; +/** Contains response data for the updateByBillingAccount operation. */ +export type SavingsPlansUpdateByBillingAccountResponse = SavingsPlanModel; -/** Known values of {@link MarketplacePurchasesPolicy} that the service accepts. */ -export enum KnownMarketplacePurchasesPolicy { - /** AllAllowed */ - AllAllowed = "AllAllowed", - /** OnlyFreeAllowed */ - OnlyFreeAllowed = "OnlyFreeAllowed", - /** NotAllowed */ - NotAllowed = "NotAllowed" +/** Optional parameters. */ +export interface SavingsPlansValidateUpdateByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the validateUpdateByBillingAccount operation. */ +export type SavingsPlansValidateUpdateByBillingAccountResponse = + SavingsPlanValidateResponse; + +/** Optional parameters. */ +export interface SavingsPlansListBySavingsPlanOrderNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySavingsPlanOrderNext operation. */ +export type SavingsPlansListBySavingsPlanOrderNextResponse = + SavingsPlanModelList; + +/** Optional parameters. */ +export interface SavingsPlansListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type SavingsPlansListByBillingAccountNextResponse = + SavingsPlanModelListResult; + +/** Optional parameters. */ +export interface BillingSubscriptionsGetByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** Can be used to expand `Reseller`, `ConsumptionCostCenter`, `LastMonthCharges` and `MonthToDateCharges` */ + expand?: string; } -/** - * Defines values for MarketplacePurchasesPolicy. \ - * {@link KnownMarketplacePurchasesPolicy} can be used interchangeably with MarketplacePurchasesPolicy, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **AllAllowed** \ - * **OnlyFreeAllowed** \ - * **NotAllowed** - */ -export type MarketplacePurchasesPolicy = string; +/** Contains response data for the getByBillingProfile operation. */ +export type BillingSubscriptionsGetByBillingProfileResponse = + BillingSubscription; -/** Known values of {@link ReservationPurchasesPolicy} that the service accepts. */ -export enum KnownReservationPurchasesPolicy { - /** Allowed */ - Allowed = "Allowed", - /** NotAllowed */ - NotAllowed = "NotAllowed" +/** Optional parameters. */ +export interface BillingSubscriptionsListByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** Can be used to expand `Reseller`, `ConsumptionCostCenter`, `LastMonthCharges` and `MonthToDateCharges` */ + expand?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** Can be used to get deleted billing subscriptions. */ + includeDeleted?: boolean; } -/** - * Defines values for ReservationPurchasesPolicy. \ - * {@link KnownReservationPurchasesPolicy} can be used interchangeably with ReservationPurchasesPolicy, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Allowed** \ - * **NotAllowed** - */ -export type ReservationPurchasesPolicy = string; +/** Contains response data for the listByBillingProfile operation. */ +export type BillingSubscriptionsListByBillingProfileResponse = + BillingSubscriptionListResult; -/** Known values of {@link ViewChargesPolicy} that the service accepts. */ -export enum KnownViewChargesPolicy { - /** Allowed */ - Allowed = "Allowed", - /** NotAllowed */ - NotAllowed = "NotAllowed" +/** Optional parameters. */ +export interface BillingSubscriptionsListByCustomerOptionalParams + extends coreClient.OperationOptions { + /** Can be used to expand `Reseller`, `ConsumptionCostCenter`, `LastMonthCharges` and `MonthToDateCharges` */ + expand?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** Can be used to get deleted billing subscriptions. */ + includeDeleted?: boolean; } -/** - * Defines values for ViewChargesPolicy. \ - * {@link KnownViewChargesPolicy} can be used interchangeably with ViewChargesPolicy, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Allowed** \ - * **NotAllowed** - */ -export type ViewChargesPolicy = string; +/** Contains response data for the listByCustomer operation. */ +export type BillingSubscriptionsListByCustomerResponse = + BillingSubscriptionListResult; -/** Known values of {@link ViewCharges} that the service accepts. */ -export enum KnownViewCharges { - /** Allowed */ - Allowed = "Allowed", - /** NotAllowed */ - NotAllowed = "NotAllowed" +/** Optional parameters. */ +export interface BillingSubscriptionsListByInvoiceSectionOptionalParams + extends coreClient.OperationOptions { + /** Can be used to expand `Reseller`, `ConsumptionCostCenter`, `LastMonthCharges` and `MonthToDateCharges` */ + expand?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** Can be used to get deleted billing subscriptions. */ + includeDeleted?: boolean; } -/** - * Defines values for ViewCharges. \ - * {@link KnownViewCharges} can be used interchangeably with ViewCharges, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Allowed** \ - * **NotAllowed** - */ -export type ViewCharges = string; +/** Contains response data for the listByInvoiceSection operation. */ +export type BillingSubscriptionsListByInvoiceSectionResponse = + BillingSubscriptionListResult; -/** Known values of {@link BillingProfileStatusReasonCode} that the service accepts. */ -export enum KnownBillingProfileStatusReasonCode { - /** PastDue */ - PastDue = "PastDue", - /** SpendingLimitReached */ - SpendingLimitReached = "SpendingLimitReached", - /** SpendingLimitExpired */ - SpendingLimitExpired = "SpendingLimitExpired" +/** Optional parameters. */ +export interface BillingSubscriptionsCancelOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * Defines values for BillingProfileStatusReasonCode. \ - * {@link KnownBillingProfileStatusReasonCode} can be used interchangeably with BillingProfileStatusReasonCode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **PastDue** \ - * **SpendingLimitReached** \ - * **SpendingLimitExpired** - */ -export type BillingProfileStatusReasonCode = string; +/** Contains response data for the cancel operation. */ +export type BillingSubscriptionsCancelResponse = + BillingSubscriptionsCancelHeaders; -/** Known values of {@link BillingProfileSpendingLimit} that the service accepts. */ -export enum KnownBillingProfileSpendingLimit { - /** Off */ - Off = "Off", - /** On */ - On = "On" +/** Optional parameters. */ +export interface BillingSubscriptionsMergeOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * Defines values for BillingProfileSpendingLimit. \ - * {@link KnownBillingProfileSpendingLimit} can be used interchangeably with BillingProfileSpendingLimit, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Off** \ - * **On** - */ -export type BillingProfileSpendingLimit = string; +/** Contains response data for the merge operation. */ +export type BillingSubscriptionsMergeResponse = BillingSubscription; -/** Known values of {@link Category} that the service accepts. */ -export enum KnownCategory { - /** MicrosoftCustomerAgreement */ - MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", - /** AffiliatePurchaseTerms */ - AffiliatePurchaseTerms = "AffiliatePurchaseTerms", - /** Other */ - Other = "Other" +/** Optional parameters. */ +export interface BillingSubscriptionsMoveOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * Defines values for Category. \ - * {@link KnownCategory} can be used interchangeably with Category, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **MicrosoftCustomerAgreement** \ - * **AffiliatePurchaseTerms** \ - * **Other** - */ -export type Category = string; +/** Contains response data for the move operation. */ +export type BillingSubscriptionsMoveResponse = BillingSubscription; -/** Known values of {@link AcceptanceMode} that the service accepts. */ -export enum KnownAcceptanceMode { - /** ClickToAccept */ - ClickToAccept = "ClickToAccept", - /** ESignEmbedded */ - ESignEmbedded = "ESignEmbedded", - /** ESignOffline */ - ESignOffline = "ESignOffline" +/** Optional parameters. */ +export interface BillingSubscriptionsSplitOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** - * Defines values for AcceptanceMode. \ - * {@link KnownAcceptanceMode} can be used interchangeably with AcceptanceMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **ClickToAccept** \ - * **ESignEmbedded** \ - * **ESignOffline** - */ -export type AcceptanceMode = string; +/** Contains response data for the split operation. */ +export type BillingSubscriptionsSplitResponse = BillingSubscription; /** Optional parameters. */ -export interface BillingAccountsListOptionalParams +export interface BillingSubscriptionsValidateMoveEligibilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the validateMoveEligibility operation. */ +export type BillingSubscriptionsValidateMoveEligibilityResponse = + MoveBillingSubscriptionEligibilityResult; + +/** Optional parameters. */ +export interface BillingSubscriptionsDeleteOptionalParams extends coreClient.OperationOptions { - /** May be used to expand the soldTo, invoice sections and billing profiles. */ - expand?: string; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** Contains response data for the list operation. */ -export type BillingAccountsListResponse = BillingAccountListResult; +/** Contains response data for the delete operation. */ +export type BillingSubscriptionsDeleteResponse = + BillingSubscriptionsDeleteHeaders; /** Optional parameters. */ -export interface BillingAccountsGetOptionalParams +export interface BillingSubscriptionsGetOptionalParams extends coreClient.OperationOptions { - /** May be used to expand the soldTo, invoice sections and billing profiles. */ + /** Can be used to expand `Reseller`, `ConsumptionCostCenter`, `LastMonthCharges` and `MonthToDateCharges` */ expand?: string; } /** Contains response data for the get operation. */ -export type BillingAccountsGetResponse = BillingAccount; +export type BillingSubscriptionsGetResponse = BillingSubscription; /** Optional parameters. */ -export interface BillingAccountsUpdateOptionalParams +export interface BillingSubscriptionsUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -2849,96 +9042,140 @@ export interface BillingAccountsUpdateOptionalParams } /** Contains response data for the update operation. */ -export type BillingAccountsUpdateResponse = BillingAccount; +export type BillingSubscriptionsUpdateResponse = BillingSubscription; /** Optional parameters. */ -export interface BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams - extends coreClient.OperationOptions {} +export interface BillingSubscriptionsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** Can be used to expand `Reseller`, `ConsumptionCostCenter`, `LastMonthCharges` and `MonthToDateCharges` */ + expand?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** Can be used to get deleted billing subscriptions. */ + includeDeleted?: boolean; + /** Can be used to get tenant-owned billing subscriptions. This field is only applies to Microsoft Online Services Program billing accounts. */ + includeTenantSubscriptions?: boolean; + /** Can be used to get failed billing subscriptions. */ + includeFailed?: boolean; +} -/** Contains response data for the listInvoiceSectionsByCreateSubscriptionPermission operation. */ -export type BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionResponse = InvoiceSectionListWithCreateSubPermissionResult; +/** Contains response data for the listByBillingAccount operation. */ +export type BillingSubscriptionsListByBillingAccountResponse = + BillingSubscriptionListResult; /** Optional parameters. */ -export interface BillingAccountsListNextOptionalParams +export interface BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams extends coreClient.OperationOptions { - /** May be used to expand the soldTo, invoice sections and billing profiles. */ + /** Can be used to expand `Reseller`, `ConsumptionCostCenter`, `LastMonthCharges` and `MonthToDateCharges` */ expand?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** Can be used to get deleted billing subscriptions. */ + includeDeleted?: boolean; } -/** Contains response data for the listNext operation. */ -export type BillingAccountsListNextResponse = BillingAccountListResult; +/** Contains response data for the listByCustomerAtBillingAccount operation. */ +export type BillingSubscriptionsListByCustomerAtBillingAccountResponse = + BillingSubscriptionListResult; /** Optional parameters. */ -export interface BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextOptionalParams - extends coreClient.OperationOptions {} +export interface BillingSubscriptionsListByEnrollmentAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} -/** Contains response data for the listInvoiceSectionsByCreateSubscriptionPermissionNext operation. */ -export type BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextResponse = InvoiceSectionListWithCreateSubPermissionResult; +/** Contains response data for the listByEnrollmentAccount operation. */ +export type BillingSubscriptionsListByEnrollmentAccountResponse = + BillingSubscriptionListResult; /** Optional parameters. */ -export interface AddressValidateOptionalParams +export interface BillingSubscriptionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the validate operation. */ -export type AddressValidateResponse = ValidateAddressResponse; +/** Contains response data for the listByBillingProfileNext operation. */ +export type BillingSubscriptionsListByBillingProfileNextResponse = + BillingSubscriptionListResult; /** Optional parameters. */ -export interface AvailableBalancesGetOptionalParams +export interface BillingSubscriptionsListByCustomerNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type AvailableBalancesGetResponse = AvailableBalance; +/** Contains response data for the listByCustomerNext operation. */ +export type BillingSubscriptionsListByCustomerNextResponse = + BillingSubscriptionListResult; /** Optional parameters. */ -export interface InstructionsListByBillingProfileOptionalParams +export interface BillingSubscriptionsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfile operation. */ -export type InstructionsListByBillingProfileResponse = InstructionListResult; +/** Contains response data for the listByInvoiceSectionNext operation. */ +export type BillingSubscriptionsListByInvoiceSectionNextResponse = + BillingSubscriptionListResult; /** Optional parameters. */ -export interface InstructionsGetOptionalParams +export interface BillingSubscriptionsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type InstructionsGetResponse = Instruction; +/** Contains response data for the listByBillingAccountNext operation. */ +export type BillingSubscriptionsListByBillingAccountNextResponse = + BillingSubscriptionListResult; /** Optional parameters. */ -export interface InstructionsPutOptionalParams +export interface BillingSubscriptionsListByCustomerAtBillingAccountNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the put operation. */ -export type InstructionsPutResponse = Instruction; +/** Contains response data for the listByCustomerAtBillingAccountNext operation. */ +export type BillingSubscriptionsListByCustomerAtBillingAccountNextResponse = + BillingSubscriptionListResult; /** Optional parameters. */ -export interface InstructionsListByBillingProfileNextOptionalParams +export interface BillingSubscriptionsListByEnrollmentAccountNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfileNext operation. */ -export type InstructionsListByBillingProfileNextResponse = InstructionListResult; - -/** Optional parameters. */ -export interface BillingProfilesListByBillingAccountOptionalParams - extends coreClient.OperationOptions { - /** May be used to expand the invoice sections. */ - expand?: string; -} - -/** Contains response data for the listByBillingAccount operation. */ -export type BillingProfilesListByBillingAccountResponse = BillingProfileListResult; +/** Contains response data for the listByEnrollmentAccountNext operation. */ +export type BillingSubscriptionsListByEnrollmentAccountNextResponse = + BillingSubscriptionListResult; /** Optional parameters. */ -export interface BillingProfilesGetOptionalParams - extends coreClient.OperationOptions { - /** May be used to expand the invoice sections. */ - expand?: string; -} +export interface BillingSubscriptionsAliasesGetOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type BillingProfilesGetResponse = BillingProfile; +export type BillingSubscriptionsAliasesGetResponse = BillingSubscriptionAlias; /** Optional parameters. */ -export interface BillingProfilesCreateOrUpdateOptionalParams +export interface BillingSubscriptionsAliasesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -2947,209 +9184,439 @@ export interface BillingProfilesCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type BillingProfilesCreateOrUpdateResponse = BillingProfile; +export type BillingSubscriptionsAliasesCreateOrUpdateResponse = + BillingSubscriptionAlias; /** Optional parameters. */ -export interface BillingProfilesListByBillingAccountNextOptionalParams +export interface BillingSubscriptionsAliasesListByBillingAccountOptionalParams extends coreClient.OperationOptions { - /** May be used to expand the invoice sections. */ - expand?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** Can be used to get deleted billing subscriptions. */ + includeDeleted?: boolean; } +/** Contains response data for the listByBillingAccount operation. */ +export type BillingSubscriptionsAliasesListByBillingAccountResponse = + BillingSubscriptionAliasListResult; + +/** Optional parameters. */ +export interface BillingSubscriptionsAliasesListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the listByBillingAccountNext operation. */ -export type BillingProfilesListByBillingAccountNextResponse = BillingProfileListResult; +export type BillingSubscriptionsAliasesListByBillingAccountNextResponse = + BillingSubscriptionAliasListResult; + +/** Optional parameters. */ +export interface CustomersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CustomersGetResponse = Customer; /** Optional parameters. */ export interface CustomersListByBillingProfileOptionalParams extends coreClient.OperationOptions { - /** Used for searching customers by their name. Any customer with name containing the search text will be included in the response */ - search?: string; - /** May be used to filter the list of customers. */ + /** May be used to expand enabledAzurePlans and resellers */ + expand?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; } /** Contains response data for the listByBillingProfile operation. */ export type CustomersListByBillingProfileResponse = CustomerListResult; +/** Optional parameters. */ +export interface CustomersGetByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByBillingAccount operation. */ +export type CustomersGetByBillingAccountResponse = Customer; + /** Optional parameters. */ export interface CustomersListByBillingAccountOptionalParams extends coreClient.OperationOptions { - /** Used for searching customers by their name. Any customer with name containing the search text will be included in the response */ - search?: string; - /** May be used to filter the list of customers. */ + /** May be used to expand enabledAzurePlans and resellers */ + expand?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; } /** Contains response data for the listByBillingAccount operation. */ export type CustomersListByBillingAccountResponse = CustomerListResult; /** Optional parameters. */ -export interface CustomersGetOptionalParams - extends coreClient.OperationOptions { - /** May be used to expand enabledAzurePlans and resellers */ - expand?: string; -} +export interface CustomersListByBillingProfileNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingProfileNext operation. */ +export type CustomersListByBillingProfileNextResponse = CustomerListResult; + +/** Optional parameters. */ +export interface CustomersListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type CustomersListByBillingAccountNextResponse = CustomerListResult; + +/** Optional parameters. */ +export interface DepartmentsGetOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type CustomersGetResponse = Customer; +export type DepartmentsGetResponse = Department; /** Optional parameters. */ -export interface CustomersListByBillingProfileNextOptionalParams +export interface DepartmentsListByBillingAccountOptionalParams extends coreClient.OperationOptions { - /** Used for searching customers by their name. Any customer with name containing the search text will be included in the response */ - search?: string; - /** May be used to filter the list of customers. */ + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; } -/** Contains response data for the listByBillingProfileNext operation. */ -export type CustomersListByBillingProfileNextResponse = CustomerListResult; +/** Contains response data for the listByBillingAccount operation. */ +export type DepartmentsListByBillingAccountResponse = DepartmentListResult; /** Optional parameters. */ -export interface CustomersListByBillingAccountNextOptionalParams +export interface DepartmentsListByBillingAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByBillingAccountNext operation. */ +export type DepartmentsListByBillingAccountNextResponse = DepartmentListResult; + +/** Optional parameters. */ +export interface EnrollmentAccountsGetByDepartmentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByDepartment operation. */ +export type EnrollmentAccountsGetByDepartmentResponse = EnrollmentAccount; + +/** Optional parameters. */ +export interface EnrollmentAccountsListByDepartmentOptionalParams extends coreClient.OperationOptions { - /** Used for searching customers by their name. Any customer with name containing the search text will be included in the response */ + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ search?: string; - /** May be used to filter the list of customers. */ +} + +/** Contains response data for the listByDepartment operation. */ +export type EnrollmentAccountsListByDepartmentResponse = + EnrollmentAccountListResult; + +/** Optional parameters. */ +export interface EnrollmentAccountsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type EnrollmentAccountsGetResponse = EnrollmentAccount; + +/** Optional parameters. */ +export interface EnrollmentAccountsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; } -/** Contains response data for the listByBillingAccountNext operation. */ -export type CustomersListByBillingAccountNextResponse = CustomerListResult; +/** Contains response data for the listByBillingAccount operation. */ +export type EnrollmentAccountsListByBillingAccountResponse = + EnrollmentAccountListResult; /** Optional parameters. */ -export interface InvoiceSectionsListByBillingProfileOptionalParams +export interface EnrollmentAccountsListByDepartmentNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfile operation. */ -export type InvoiceSectionsListByBillingProfileResponse = InvoiceSectionListResult; +/** Contains response data for the listByDepartmentNext operation. */ +export type EnrollmentAccountsListByDepartmentNextResponse = + EnrollmentAccountListResult; /** Optional parameters. */ -export interface InvoiceSectionsGetOptionalParams +export interface EnrollmentAccountsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type InvoiceSectionsGetResponse = InvoiceSection; +/** Contains response data for the listByBillingAccountNext operation. */ +export type EnrollmentAccountsListByBillingAccountNextResponse = + EnrollmentAccountListResult; + +/** Optional parameters. */ +export interface InvoicesListByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. */ + periodStartDate?: Date; + /** The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. */ + periodEndDate?: Date; +} + +/** Contains response data for the listByBillingProfile operation. */ +export type InvoicesListByBillingProfileResponse = InvoiceListResult; + +/** Optional parameters. */ +export interface InvoicesDownloadDocumentsByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the downloadDocumentsByBillingAccount operation. */ +export type InvoicesDownloadDocumentsByBillingAccountResponse = + DocumentDownloadResult; + +/** Optional parameters. */ +export interface InvoicesAmendOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the amend operation. */ +export type InvoicesAmendResponse = InvoicesAmendHeaders; /** Optional parameters. */ -export interface InvoiceSectionsCreateOrUpdateOptionalParams +export interface InvoicesDownloadByBillingAccountOptionalParams extends coreClient.OperationOptions { + /** The ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit note, or a tax receipt. */ + documentName?: string; /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ resumeFrom?: string; } -/** Contains response data for the createOrUpdate operation. */ -export type InvoiceSectionsCreateOrUpdateResponse = InvoiceSection; +/** Contains response data for the downloadByBillingAccount operation. */ +export type InvoicesDownloadByBillingAccountResponse = DocumentDownloadResult; /** Optional parameters. */ -export interface InvoiceSectionsListByBillingProfileNextOptionalParams - extends coreClient.OperationOptions {} +export interface InvoicesDownloadSummaryByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** Contains response data for the listByBillingProfileNext operation. */ -export type InvoiceSectionsListByBillingProfileNextResponse = InvoiceSectionListResult; +/** Contains response data for the downloadSummaryByBillingAccount operation. */ +export type InvoicesDownloadSummaryByBillingAccountResponse = + DocumentDownloadResult; /** Optional parameters. */ -export interface BillingPermissionsListByCustomerOptionalParams +export interface InvoicesGetByBillingAccountOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByCustomer operation. */ -export type BillingPermissionsListByCustomerResponse = BillingPermissionsListResult; +/** Contains response data for the getByBillingAccount operation. */ +export type InvoicesGetByBillingAccountResponse = Invoice; /** Optional parameters. */ -export interface BillingPermissionsListByBillingAccountOptionalParams - extends coreClient.OperationOptions {} +export interface InvoicesListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. */ + periodStartDate?: Date; + /** The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. */ + periodEndDate?: Date; +} /** Contains response data for the listByBillingAccount operation. */ -export type BillingPermissionsListByBillingAccountResponse = BillingPermissionsListResult; +export type InvoicesListByBillingAccountResponse = InvoiceListResult; /** Optional parameters. */ -export interface BillingPermissionsListByInvoiceSectionsOptionalParams - extends coreClient.OperationOptions {} +export interface InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** Contains response data for the listByInvoiceSections operation. */ -export type BillingPermissionsListByInvoiceSectionsResponse = BillingPermissionsListResult; +/** Contains response data for the downloadDocumentsByBillingSubscription operation. */ +export type InvoicesDownloadDocumentsByBillingSubscriptionResponse = + DocumentDownloadResult; /** Optional parameters. */ -export interface BillingPermissionsListByBillingProfileOptionalParams - extends coreClient.OperationOptions {} +export interface InvoicesDownloadByBillingSubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit note, or a tax receipt. */ + documentName?: string; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** Contains response data for the listByBillingProfile operation. */ -export type BillingPermissionsListByBillingProfileResponse = BillingPermissionsListResult; +/** Contains response data for the downloadByBillingSubscription operation. */ +export type InvoicesDownloadByBillingSubscriptionResponse = + DocumentDownloadResult; /** Optional parameters. */ -export interface BillingPermissionsListByCustomerNextOptionalParams +export interface InvoicesGetByBillingSubscriptionOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByCustomerNext operation. */ -export type BillingPermissionsListByCustomerNextResponse = BillingPermissionsListResult; +/** Contains response data for the getByBillingSubscription operation. */ +export type InvoicesGetByBillingSubscriptionResponse = Invoice; /** Optional parameters. */ -export interface BillingPermissionsListByBillingAccountNextOptionalParams - extends coreClient.OperationOptions {} +export interface InvoicesListByBillingSubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. */ + periodStartDate?: Date; + /** The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. */ + periodEndDate?: Date; +} -/** Contains response data for the listByBillingAccountNext operation. */ -export type BillingPermissionsListByBillingAccountNextResponse = BillingPermissionsListResult; +/** Contains response data for the listByBillingSubscription operation. */ +export type InvoicesListByBillingSubscriptionResponse = InvoiceListResult; /** Optional parameters. */ -export interface BillingPermissionsListByInvoiceSectionsNextOptionalParams +export interface InvoicesGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByInvoiceSectionsNext operation. */ -export type BillingPermissionsListByInvoiceSectionsNextResponse = BillingPermissionsListResult; +/** Contains response data for the get operation. */ +export type InvoicesGetResponse = Invoice; /** Optional parameters. */ -export interface BillingPermissionsListByBillingProfileNextOptionalParams +export interface InvoicesListByBillingProfileNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByBillingProfileNext operation. */ -export type BillingPermissionsListByBillingProfileNextResponse = BillingPermissionsListResult; +export type InvoicesListByBillingProfileNextResponse = InvoiceListResult; /** Optional parameters. */ -export interface BillingSubscriptionsListByCustomerOptionalParams +export interface InvoicesListByBillingAccountNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByCustomer operation. */ -export type BillingSubscriptionsListByCustomerResponse = BillingSubscriptionsListResult; +/** Contains response data for the listByBillingAccountNext operation. */ +export type InvoicesListByBillingAccountNextResponse = InvoiceListResult; /** Optional parameters. */ -export interface BillingSubscriptionsListByBillingAccountOptionalParams +export interface InvoicesListByBillingSubscriptionNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccount operation. */ -export type BillingSubscriptionsListByBillingAccountResponse = BillingSubscriptionsListResult; +/** Contains response data for the listByBillingSubscriptionNext operation. */ +export type InvoicesListByBillingSubscriptionNextResponse = InvoiceListResult; /** Optional parameters. */ -export interface BillingSubscriptionsListByBillingProfileOptionalParams +export interface InvoiceSectionsValidateDeleteEligibilityOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfile operation. */ -export type BillingSubscriptionsListByBillingProfileResponse = BillingSubscriptionsListResult; +/** Contains response data for the validateDeleteEligibility operation. */ +export type InvoiceSectionsValidateDeleteEligibilityResponse = + DeleteInvoiceSectionEligibilityResult; /** Optional parameters. */ -export interface BillingSubscriptionsListByInvoiceSectionOptionalParams - extends coreClient.OperationOptions {} +export interface InvoiceSectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** Contains response data for the listByInvoiceSection operation. */ -export type BillingSubscriptionsListByInvoiceSectionResponse = BillingSubscriptionsListResult; +/** Contains response data for the delete operation. */ +export type InvoiceSectionsDeleteResponse = InvoiceSectionsDeleteHeaders; /** Optional parameters. */ -export interface BillingSubscriptionsGetOptionalParams +export interface InvoiceSectionsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type BillingSubscriptionsGetResponse = BillingSubscription; - -/** Optional parameters. */ -export interface BillingSubscriptionsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type BillingSubscriptionsUpdateResponse = BillingSubscription; +export type InvoiceSectionsGetResponse = InvoiceSection; /** Optional parameters. */ -export interface BillingSubscriptionsMoveOptionalParams +export interface InvoiceSectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -3157,176 +9624,173 @@ export interface BillingSubscriptionsMoveOptionalParams resumeFrom?: string; } -/** Contains response data for the move operation. */ -export type BillingSubscriptionsMoveResponse = BillingSubscription; +/** Contains response data for the createOrUpdate operation. */ +export type InvoiceSectionsCreateOrUpdateResponse = InvoiceSection; /** Optional parameters. */ -export interface BillingSubscriptionsValidateMoveOptionalParams - extends coreClient.OperationOptions {} +export interface InvoiceSectionsListByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; + /** Can be used to get deleted invoice sections. */ + includeDeleted?: boolean; +} -/** Contains response data for the validateMove operation. */ -export type BillingSubscriptionsValidateMoveResponse = ValidateSubscriptionTransferEligibilityResult; +/** Contains response data for the listByBillingProfile operation. */ +export type InvoiceSectionsListByBillingProfileResponse = + InvoiceSectionListResult; /** Optional parameters. */ -export interface BillingSubscriptionsListByCustomerNextOptionalParams +export interface InvoiceSectionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByCustomerNext operation. */ -export type BillingSubscriptionsListByCustomerNextResponse = BillingSubscriptionsListResult; +/** Contains response data for the listByBillingProfileNext operation. */ +export type InvoiceSectionsListByBillingProfileNextResponse = + InvoiceSectionListResult; /** Optional parameters. */ -export interface BillingSubscriptionsListByBillingAccountNextOptionalParams +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccountNext operation. */ -export type BillingSubscriptionsListByBillingAccountNextResponse = BillingSubscriptionsListResult; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; /** Optional parameters. */ -export interface BillingSubscriptionsListByBillingProfileNextOptionalParams +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfileNext operation. */ -export type BillingSubscriptionsListByBillingProfileNextResponse = BillingSubscriptionsListResult; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; /** Optional parameters. */ -export interface BillingSubscriptionsListByInvoiceSectionNextOptionalParams +export interface PaymentMethodsListByBillingProfileOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByInvoiceSectionNext operation. */ -export type BillingSubscriptionsListByInvoiceSectionNextResponse = BillingSubscriptionsListResult; +/** Contains response data for the listByBillingProfile operation. */ +export type PaymentMethodsListByBillingProfileResponse = + PaymentMethodLinksListResult; /** Optional parameters. */ -export interface ProductsListByCustomerOptionalParams +export interface PaymentMethodsGetByBillingProfileOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByCustomer operation. */ -export type ProductsListByCustomerResponse = ProductsListResult; +/** Contains response data for the getByBillingProfile operation. */ +export type PaymentMethodsGetByBillingProfileResponse = PaymentMethodLink; /** Optional parameters. */ -export interface ProductsListByBillingAccountOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value are separated by a colon (:). */ - filter?: string; -} +export interface PaymentMethodsListByBillingAccountOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the listByBillingAccount operation. */ -export type ProductsListByBillingAccountResponse = ProductsListResult; - -/** Optional parameters. */ -export interface ProductsListByBillingProfileOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value are separated by a colon (:). */ - filter?: string; -} - -/** Contains response data for the listByBillingProfile operation. */ -export type ProductsListByBillingProfileResponse = ProductsListResult; +export type PaymentMethodsListByBillingAccountResponse = + PaymentMethodsListResult; /** Optional parameters. */ -export interface ProductsListByInvoiceSectionOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value are separated by a colon (:). */ - filter?: string; -} +export interface PaymentMethodsGetByBillingAccountOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByInvoiceSection operation. */ -export type ProductsListByInvoiceSectionResponse = ProductsListResult; +/** Contains response data for the getByBillingAccount operation. */ +export type PaymentMethodsGetByBillingAccountResponse = PaymentMethod; /** Optional parameters. */ -export interface ProductsGetOptionalParams +export interface PaymentMethodsListByUserOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type ProductsGetResponse = Product; +/** Contains response data for the listByUser operation. */ +export type PaymentMethodsListByUserResponse = PaymentMethodsListResult; /** Optional parameters. */ -export interface ProductsUpdateOptionalParams +export interface PaymentMethodsDeleteByUserOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the update operation. */ -export type ProductsUpdateResponse = Product; - /** Optional parameters. */ -export interface ProductsMoveOptionalParams +export interface PaymentMethodsGetByUserOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the move operation. */ -export type ProductsMoveResponse = Product; +/** Contains response data for the getByUser operation. */ +export type PaymentMethodsGetByUserResponse = PaymentMethod; /** Optional parameters. */ -export interface ProductsValidateMoveOptionalParams +export interface PaymentMethodsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the validateMove operation. */ -export type ProductsValidateMoveResponse = ValidateProductTransferEligibilityResult; +/** Contains response data for the listByBillingProfileNext operation. */ +export type PaymentMethodsListByBillingProfileNextResponse = + PaymentMethodLinksListResult; /** Optional parameters. */ -export interface ProductsListByCustomerNextOptionalParams +export interface PaymentMethodsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByCustomerNext operation. */ -export type ProductsListByCustomerNextResponse = ProductsListResult; +/** Contains response data for the listByBillingAccountNext operation. */ +export type PaymentMethodsListByBillingAccountNextResponse = + PaymentMethodsListResult; /** Optional parameters. */ -export interface ProductsListByBillingAccountNextOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value are separated by a colon (:). */ - filter?: string; -} +export interface PaymentMethodsListByUserNextOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccountNext operation. */ -export type ProductsListByBillingAccountNextResponse = ProductsListResult; +/** Contains response data for the listByUserNext operation. */ +export type PaymentMethodsListByUserNextResponse = PaymentMethodsListResult; /** Optional parameters. */ -export interface ProductsListByBillingProfileNextOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value are separated by a colon (:). */ - filter?: string; -} +export interface PoliciesGetByCustomerOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfileNext operation. */ -export type ProductsListByBillingProfileNextResponse = ProductsListResult; +/** Contains response data for the getByCustomer operation. */ +export type PoliciesGetByCustomerResponse = CustomerPolicy; /** Optional parameters. */ -export interface ProductsListByInvoiceSectionNextOptionalParams +export interface PoliciesCreateOrUpdateByCustomerOptionalParams extends coreClient.OperationOptions { - /** May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value are separated by a colon (:). */ - filter?: string; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** Contains response data for the listByInvoiceSectionNext operation. */ -export type ProductsListByInvoiceSectionNextResponse = ProductsListResult; - -/** Optional parameters. */ -export interface InvoicesListByBillingAccountOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByBillingAccount operation. */ -export type InvoicesListByBillingAccountResponse = InvoiceListResult; +/** Contains response data for the createOrUpdateByCustomer operation. */ +export type PoliciesCreateOrUpdateByCustomerResponse = CustomerPolicy; /** Optional parameters. */ -export interface InvoicesListByBillingProfileOptionalParams +export interface PoliciesGetByBillingProfileOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfile operation. */ -export type InvoicesListByBillingProfileResponse = InvoiceListResult; +/** Contains response data for the getByBillingProfile operation. */ +export type PoliciesGetByBillingProfileResponse = BillingProfilePolicy; /** Optional parameters. */ -export interface InvoicesGetOptionalParams - extends coreClient.OperationOptions {} +export interface PoliciesCreateOrUpdateByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** Contains response data for the get operation. */ -export type InvoicesGetResponse = Invoice; +/** Contains response data for the createOrUpdateByBillingProfile operation. */ +export type PoliciesCreateOrUpdateByBillingProfileResponse = + BillingProfilePolicy; /** Optional parameters. */ -export interface InvoicesGetByIdOptionalParams +export interface PoliciesGetByCustomerAtBillingAccountOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getById operation. */ -export type InvoicesGetByIdResponse = Invoice; +/** Contains response data for the getByCustomerAtBillingAccount operation. */ +export type PoliciesGetByCustomerAtBillingAccountResponse = CustomerPolicy; /** Optional parameters. */ -export interface InvoicesDownloadInvoiceOptionalParams +export interface PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -3334,11 +9798,19 @@ export interface InvoicesDownloadInvoiceOptionalParams resumeFrom?: string; } -/** Contains response data for the downloadInvoice operation. */ -export type InvoicesDownloadInvoiceResponse = DownloadUrl; +/** Contains response data for the createOrUpdateByCustomerAtBillingAccount operation. */ +export type PoliciesCreateOrUpdateByCustomerAtBillingAccountResponse = + CustomerPolicy; + +/** Optional parameters. */ +export interface PoliciesGetByBillingAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getByBillingAccount operation. */ +export type PoliciesGetByBillingAccountResponse = BillingAccountPolicy; /** Optional parameters. */ -export interface InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams +export interface PoliciesCreateOrUpdateByBillingAccountOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -3346,37 +9818,79 @@ export interface InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams resumeFrom?: string; } -/** Contains response data for the downloadMultipleBillingProfileInvoices operation. */ -export type InvoicesDownloadMultipleBillingProfileInvoicesResponse = DownloadUrl; +/** Contains response data for the createOrUpdateByBillingAccount operation. */ +export type PoliciesCreateOrUpdateByBillingAccountResponse = + BillingAccountPolicy; /** Optional parameters. */ -export interface InvoicesListByBillingSubscriptionOptionalParams +export interface PoliciesGetBySubscriptionOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingSubscription operation. */ -export type InvoicesListByBillingSubscriptionResponse = InvoiceListResult; +/** Contains response data for the getBySubscription operation. */ +export type PoliciesGetBySubscriptionResponse = SubscriptionPolicy; /** Optional parameters. */ -export interface InvoicesGetBySubscriptionAndInvoiceIdOptionalParams - extends coreClient.OperationOptions {} +export interface ProductsListByInvoiceSectionOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} -/** Contains response data for the getBySubscriptionAndInvoiceId operation. */ -export type InvoicesGetBySubscriptionAndInvoiceIdResponse = Invoice; +/** Contains response data for the listByInvoiceSection operation. */ +export type ProductsListByInvoiceSectionResponse = ProductListResult; /** Optional parameters. */ -export interface InvoicesDownloadBillingSubscriptionInvoiceOptionalParams +export interface ProductsListByBillingProfileOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} + +/** Contains response data for the listByBillingProfile operation. */ +export type ProductsListByBillingProfileResponse = ProductListResult; + +/** Optional parameters. */ +export interface ProductsListByCustomerOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; } -/** Contains response data for the downloadBillingSubscriptionInvoice operation. */ -export type InvoicesDownloadBillingSubscriptionInvoiceResponse = DownloadUrl; +/** Contains response data for the listByCustomer operation. */ +export type ProductsListByCustomerResponse = ProductListResult; /** Optional parameters. */ -export interface InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams +export interface ProductsMoveOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -3384,402 +9898,460 @@ export interface InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalPara resumeFrom?: string; } -/** Contains response data for the downloadMultipleBillingSubscriptionInvoices operation. */ -export type InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse = DownloadUrl; - -/** Optional parameters. */ -export interface InvoicesListByBillingAccountNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByBillingAccountNext operation. */ -export type InvoicesListByBillingAccountNextResponse = InvoiceListResult; +/** Contains response data for the move operation. */ +export type ProductsMoveResponse = Product; /** Optional parameters. */ -export interface InvoicesListByBillingProfileNextOptionalParams +export interface ProductsValidateMoveEligibilityOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfileNext operation. */ -export type InvoicesListByBillingProfileNextResponse = InvoiceListResult; +/** Contains response data for the validateMoveEligibility operation. */ +export type ProductsValidateMoveEligibilityResponse = + MoveProductEligibilityResult; /** Optional parameters. */ -export interface InvoicesListByBillingSubscriptionNextOptionalParams +export interface ProductsGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingSubscriptionNext operation. */ -export type InvoicesListByBillingSubscriptionNextResponse = InvoiceListResult; +/** Contains response data for the get operation. */ +export type ProductsGetResponse = Product; /** Optional parameters. */ -export interface TransactionsListByInvoiceOptionalParams +export interface ProductsUpdateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByInvoice operation. */ -export type TransactionsListByInvoiceResponse = TransactionListResult; +/** Contains response data for the update operation. */ +export type ProductsUpdateResponse = Product; /** Optional parameters. */ -export interface TransactionsListByInvoiceNextOptionalParams - extends coreClient.OperationOptions {} +export interface ProductsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} -/** Contains response data for the listByInvoiceNext operation. */ -export type TransactionsListByInvoiceNextResponse = TransactionListResult; +/** Contains response data for the listByBillingAccount operation. */ +export type ProductsListByBillingAccountResponse = ProductListResult; /** Optional parameters. */ -export interface PoliciesGetByBillingProfileOptionalParams +export interface ProductsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getByBillingProfile operation. */ -export type PoliciesGetByBillingProfileResponse = Policy; +/** Contains response data for the listByInvoiceSectionNext operation. */ +export type ProductsListByInvoiceSectionNextResponse = ProductListResult; /** Optional parameters. */ -export interface PoliciesUpdateOptionalParams +export interface ProductsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the update operation. */ -export type PoliciesUpdateResponse = Policy; +/** Contains response data for the listByBillingProfileNext operation. */ +export type ProductsListByBillingProfileNextResponse = ProductListResult; /** Optional parameters. */ -export interface PoliciesGetByCustomerOptionalParams +export interface ProductsListByCustomerNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getByCustomer operation. */ -export type PoliciesGetByCustomerResponse = CustomerPolicy; +/** Contains response data for the listByCustomerNext operation. */ +export type ProductsListByCustomerNextResponse = ProductListResult; /** Optional parameters. */ -export interface PoliciesUpdateCustomerOptionalParams +export interface ProductsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the updateCustomer operation. */ -export type PoliciesUpdateCustomerResponse = CustomerPolicy; +/** Contains response data for the listByBillingAccountNext operation. */ +export type ProductsListByBillingAccountNextResponse = ProductListResult; /** Optional parameters. */ -export interface BillingPropertyGetOptionalParams - extends coreClient.OperationOptions {} +export interface ReservationsListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The number of reservations to skip from the list before returning results */ + skiptoken?: number; + /** The number of reservations to return in API response. */ + take?: number; + /** The selected provisioning state */ + selectedState?: string; + /** To indicate whether to refresh the roll up counts of the reservations group by provisioning states */ + refreshSummary?: string; +} -/** Contains response data for the get operation. */ -export type BillingPropertyGetResponse = BillingProperty; +/** Contains response data for the listByBillingAccount operation. */ +export type ReservationsListByBillingAccountResponse = ReservationsListResult; /** Optional parameters. */ -export interface BillingPropertyUpdateOptionalParams - extends coreClient.OperationOptions {} +export interface ReservationsListByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The number of reservations to skip from the list before returning results */ + skiptoken?: number; + /** The number of reservations to return in API response. */ + take?: number; + /** The selected provisioning state */ + selectedState?: string; + /** To indicate whether to refresh the roll up counts of the reservations group by provisioning states */ + refreshSummary?: string; +} -/** Contains response data for the update operation. */ -export type BillingPropertyUpdateResponse = BillingProperty; +/** Contains response data for the listByBillingProfile operation. */ +export type ReservationsListByBillingProfileResponse = ReservationsListResult; /** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} +export interface ReservationsGetByReservationOrderOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the detail information of some properties. */ + expand?: string; +} -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; +/** Contains response data for the getByReservationOrder operation. */ +export type ReservationsGetByReservationOrderResponse = Reservation; /** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} +export interface ReservationsUpdateByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; +/** Contains response data for the updateByBillingAccount operation. */ +export type ReservationsUpdateByBillingAccountResponse = Reservation; /** Optional parameters. */ -export interface BillingRoleDefinitionsGetByBillingAccountOptionalParams +export interface ReservationsListByReservationOrderOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getByBillingAccount operation. */ -export type BillingRoleDefinitionsGetByBillingAccountResponse = BillingRoleDefinition; +/** Contains response data for the listByReservationOrder operation. */ +export type ReservationsListByReservationOrderResponse = ReservationList; /** Optional parameters. */ -export interface BillingRoleDefinitionsGetByInvoiceSectionOptionalParams +export interface ReservationsListByBillingAccountNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getByInvoiceSection operation. */ -export type BillingRoleDefinitionsGetByInvoiceSectionResponse = BillingRoleDefinition; +/** Contains response data for the listByBillingAccountNext operation. */ +export type ReservationsListByBillingAccountNextResponse = + ReservationsListResult; /** Optional parameters. */ -export interface BillingRoleDefinitionsGetByBillingProfileOptionalParams +export interface ReservationsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getByBillingProfile operation. */ -export type BillingRoleDefinitionsGetByBillingProfileResponse = BillingRoleDefinition; +/** Contains response data for the listByBillingProfileNext operation. */ +export type ReservationsListByBillingProfileNextResponse = + ReservationsListResult; /** Optional parameters. */ -export interface BillingRoleDefinitionsListByBillingAccountOptionalParams +export interface ReservationsListByReservationOrderNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccount operation. */ -export type BillingRoleDefinitionsListByBillingAccountResponse = BillingRoleDefinitionListResult; +/** Contains response data for the listByReservationOrderNext operation. */ +export type ReservationsListByReservationOrderNextResponse = ReservationList; /** Optional parameters. */ -export interface BillingRoleDefinitionsListByInvoiceSectionOptionalParams - extends coreClient.OperationOptions {} +export interface ReservationOrdersGetByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** May be used to expand the detail information of some properties. */ + expand?: string; +} -/** Contains response data for the listByInvoiceSection operation. */ -export type BillingRoleDefinitionsListByInvoiceSectionResponse = BillingRoleDefinitionListResult; +/** Contains response data for the getByBillingAccount operation. */ +export type ReservationOrdersGetByBillingAccountResponse = ReservationOrder; /** Optional parameters. */ -export interface BillingRoleDefinitionsListByBillingProfileOptionalParams - extends coreClient.OperationOptions {} +export interface ReservationOrdersListByBillingAccountOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The number of reservations to skip from the list before returning results */ + skiptoken?: number; +} -/** Contains response data for the listByBillingProfile operation. */ -export type BillingRoleDefinitionsListByBillingProfileResponse = BillingRoleDefinitionListResult; +/** Contains response data for the listByBillingAccount operation. */ +export type ReservationOrdersListByBillingAccountResponse = + ReservationOrderList; /** Optional parameters. */ -export interface BillingRoleDefinitionsListByBillingAccountNextOptionalParams +export interface ReservationOrdersListByBillingAccountNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByBillingAccountNext operation. */ -export type BillingRoleDefinitionsListByBillingAccountNextResponse = BillingRoleDefinitionListResult; +export type ReservationOrdersListByBillingAccountNextResponse = + ReservationOrderList; /** Optional parameters. */ -export interface BillingRoleDefinitionsListByInvoiceSectionNextOptionalParams - extends coreClient.OperationOptions {} +export interface TransactionsListByCustomerOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} -/** Contains response data for the listByInvoiceSectionNext operation. */ -export type BillingRoleDefinitionsListByInvoiceSectionNextResponse = BillingRoleDefinitionListResult; +/** Contains response data for the listByCustomer operation. */ +export type TransactionsListByCustomerResponse = TransactionListResult; /** Optional parameters. */ -export interface BillingRoleDefinitionsListByBillingProfileNextOptionalParams - extends coreClient.OperationOptions {} +export interface TransactionsListByInvoiceSectionOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} -/** Contains response data for the listByBillingProfileNext operation. */ -export type BillingRoleDefinitionsListByBillingProfileNextResponse = BillingRoleDefinitionListResult; +/** Contains response data for the listByInvoiceSection operation. */ +export type TransactionsListByInvoiceSectionResponse = TransactionListResult; /** Optional parameters. */ -export interface BillingRoleAssignmentsGetByBillingAccountOptionalParams - extends coreClient.OperationOptions {} +export interface TransactionsListByBillingProfileOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} -/** Contains response data for the getByBillingAccount operation. */ -export type BillingRoleAssignmentsGetByBillingAccountResponse = BillingRoleAssignment; +/** Contains response data for the listByBillingProfile operation. */ +export type TransactionsListByBillingProfileResponse = TransactionListResult; /** Optional parameters. */ -export interface BillingRoleAssignmentsDeleteByBillingAccountOptionalParams - extends coreClient.OperationOptions {} +export interface TransactionsListByInvoiceOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter a collection of resources that are addressed by a request URL. */ + filter?: string; + /** The orderby query option allows clients to request resources in a particular order. */ + orderBy?: string; + /** The top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. */ + top?: number; + /** The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. */ + skip?: number; + /** The count query option allows clients to request a count of the matching resources included with the resources in the response. */ + count?: boolean; + /** The search query option allows clients to request items within a collection matching a free-text search expression. search is only supported for string fields. */ + search?: string; +} -/** Contains response data for the deleteByBillingAccount operation. */ -export type BillingRoleAssignmentsDeleteByBillingAccountResponse = BillingRoleAssignment; +/** Contains response data for the listByInvoice operation. */ +export type TransactionsListByInvoiceResponse = TransactionListResult; /** Optional parameters. */ -export interface BillingRoleAssignmentsGetByInvoiceSectionOptionalParams - extends coreClient.OperationOptions {} +export interface TransactionsTransactionsDownloadByInvoiceOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** Contains response data for the getByInvoiceSection operation. */ -export type BillingRoleAssignmentsGetByInvoiceSectionResponse = BillingRoleAssignment; +/** Contains response data for the transactionsDownloadByInvoice operation. */ +export type TransactionsTransactionsDownloadByInvoiceResponse = + DocumentDownloadResult; /** Optional parameters. */ -export interface BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams - extends coreClient.OperationOptions {} +export interface TransactionsGetTransactionSummaryByInvoiceOptionalParams + extends coreClient.OperationOptions { + /** The filter query option allows clients to filter the line items that are aggregated to create the line item summary. */ + filter?: string; + /** The search query option allows clients to filter the line items that are aggregated to create the line item summary. */ + search?: string; +} -/** Contains response data for the deleteByInvoiceSection operation. */ -export type BillingRoleAssignmentsDeleteByInvoiceSectionResponse = BillingRoleAssignment; +/** Contains response data for the getTransactionSummaryByInvoice operation. */ +export type TransactionsGetTransactionSummaryByInvoiceResponse = + TransactionSummary; /** Optional parameters. */ -export interface BillingRoleAssignmentsGetByBillingProfileOptionalParams +export interface TransactionsListByCustomerNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the getByBillingProfile operation. */ -export type BillingRoleAssignmentsGetByBillingProfileResponse = BillingRoleAssignment; +/** Contains response data for the listByCustomerNext operation. */ +export type TransactionsListByCustomerNextResponse = TransactionListResult; /** Optional parameters. */ -export interface BillingRoleAssignmentsDeleteByBillingProfileOptionalParams +export interface TransactionsListByInvoiceSectionNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the deleteByBillingProfile operation. */ -export type BillingRoleAssignmentsDeleteByBillingProfileResponse = BillingRoleAssignment; +/** Contains response data for the listByInvoiceSectionNext operation. */ +export type TransactionsListByInvoiceSectionNextResponse = + TransactionListResult; /** Optional parameters. */ -export interface BillingRoleAssignmentsListByBillingAccountOptionalParams +export interface TransactionsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccount operation. */ -export type BillingRoleAssignmentsListByBillingAccountResponse = BillingRoleAssignmentListResult; +/** Contains response data for the listByBillingProfileNext operation. */ +export type TransactionsListByBillingProfileNextResponse = + TransactionListResult; /** Optional parameters. */ -export interface BillingRoleAssignmentsListByInvoiceSectionOptionalParams +export interface TransactionsListByInvoiceNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByInvoiceSection operation. */ -export type BillingRoleAssignmentsListByInvoiceSectionResponse = BillingRoleAssignmentListResult; +/** Contains response data for the listByInvoiceNext operation. */ +export type TransactionsListByInvoiceNextResponse = TransactionListResult; /** Optional parameters. */ -export interface BillingRoleAssignmentsListByBillingProfileOptionalParams +export interface TransfersGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfile operation. */ -export type BillingRoleAssignmentsListByBillingProfileResponse = BillingRoleAssignmentListResult; +/** Contains response data for the get operation. */ +export type TransfersGetResponse = TransferDetails; /** Optional parameters. */ -export interface BillingRoleAssignmentsListByBillingAccountNextOptionalParams +export interface TransfersInitiateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccountNext operation. */ -export type BillingRoleAssignmentsListByBillingAccountNextResponse = BillingRoleAssignmentListResult; +/** Contains response data for the initiate operation. */ +export type TransfersInitiateResponse = TransferDetails; /** Optional parameters. */ -export interface BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams +export interface TransfersCancelOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByInvoiceSectionNext operation. */ -export type BillingRoleAssignmentsListByInvoiceSectionNextResponse = BillingRoleAssignmentListResult; +/** Contains response data for the cancel operation. */ +export type TransfersCancelResponse = TransferDetails; /** Optional parameters. */ -export interface BillingRoleAssignmentsListByBillingProfileNextOptionalParams +export interface TransfersListOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfileNext operation. */ -export type BillingRoleAssignmentsListByBillingProfileNextResponse = BillingRoleAssignmentListResult; +/** Contains response data for the list operation. */ +export type TransfersListResponse = TransferDetailsListResult; /** Optional parameters. */ -export interface AgreementsListByBillingAccountOptionalParams - extends coreClient.OperationOptions { - /** May be used to expand the participants. */ - expand?: string; -} +export interface TransfersListNextOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccount operation. */ -export type AgreementsListByBillingAccountResponse = AgreementListResult; +/** Contains response data for the listNext operation. */ +export type TransfersListNextResponse = TransferDetailsListResult; /** Optional parameters. */ -export interface AgreementsGetOptionalParams - extends coreClient.OperationOptions { - /** May be used to expand the participants. */ - expand?: string; -} +export interface PartnerTransfersGetOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type AgreementsGetResponse = Agreement; +export type PartnerTransfersGetResponse = PartnerTransferDetails; /** Optional parameters. */ -export interface AgreementsListByBillingAccountNextOptionalParams - extends coreClient.OperationOptions { - /** May be used to expand the participants. */ - expand?: string; -} +export interface PartnerTransfersInitiateOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccountNext operation. */ -export type AgreementsListByBillingAccountNextResponse = AgreementListResult; +/** Contains response data for the initiate operation. */ +export type PartnerTransfersInitiateResponse = PartnerTransferDetails; /** Optional parameters. */ -export interface ReservationsListByBillingAccountOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. */ - filter?: string; - /** May be used to sort order by reservation properties. */ - orderby?: string; - /** To indicate whether to refresh the roll up counts of the reservations group by provisioning states */ - refreshSummary?: string; - /** The selected provisioning state */ - selectedState?: string; -} +export interface PartnerTransfersCancelOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccount operation. */ -export type ReservationsListByBillingAccountResponse = ReservationsListResult; +/** Contains response data for the cancel operation. */ +export type PartnerTransfersCancelResponse = PartnerTransferDetails; /** Optional parameters. */ -export interface ReservationsListByBillingProfileOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. */ - filter?: string; - /** May be used to sort order by reservation properties. */ - orderby?: string; - /** To indicate whether to refresh the roll up counts of the reservations group by provisioning state */ - refreshSummary?: string; - /** The selected provisioning state */ - selectedState?: string; -} +export interface PartnerTransfersListOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfile operation. */ -export type ReservationsListByBillingProfileResponse = ReservationsListResult; +/** Contains response data for the list operation. */ +export type PartnerTransfersListResponse = PartnerTransferDetailsListResult; /** Optional parameters. */ -export interface ReservationsListByBillingAccountNextOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. */ - filter?: string; - /** May be used to sort order by reservation properties. */ - orderby?: string; - /** To indicate whether to refresh the roll up counts of the reservations group by provisioning states */ - refreshSummary?: string; - /** The selected provisioning state */ - selectedState?: string; -} +export interface PartnerTransfersListNextOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingAccountNext operation. */ -export type ReservationsListByBillingAccountNextResponse = ReservationsListResult; +/** Contains response data for the listNext operation. */ +export type PartnerTransfersListNextResponse = PartnerTransferDetailsListResult; /** Optional parameters. */ -export interface ReservationsListByBillingProfileNextOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. */ - filter?: string; - /** May be used to sort order by reservation properties. */ - orderby?: string; - /** To indicate whether to refresh the roll up counts of the reservations group by provisioning state */ - refreshSummary?: string; - /** The selected provisioning state */ - selectedState?: string; -} +export interface RecipientTransfersAcceptOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the listByBillingProfileNext operation. */ -export type ReservationsListByBillingProfileNextResponse = ReservationsListResult; +/** Contains response data for the accept operation. */ +export type RecipientTransfersAcceptResponse = RecipientTransferDetails; /** Optional parameters. */ -export interface EnrollmentAccountsListOptionalParams +export interface RecipientTransfersValidateOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type EnrollmentAccountsListResponse = EnrollmentAccountListResult; +/** Contains response data for the validate operation. */ +export type RecipientTransfersValidateResponse = ValidateTransferListResponse; /** Optional parameters. */ -export interface EnrollmentAccountsGetOptionalParams +export interface RecipientTransfersDeclineOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type EnrollmentAccountsGetResponse = EnrollmentAccountSummary; +/** Contains response data for the decline operation. */ +export type RecipientTransfersDeclineResponse = RecipientTransferDetails; /** Optional parameters. */ -export interface EnrollmentAccountsListNextOptionalParams +export interface RecipientTransfersGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type EnrollmentAccountsListNextResponse = EnrollmentAccountListResult; +/** Contains response data for the get operation. */ +export type RecipientTransfersGetResponse = RecipientTransferDetails; /** Optional parameters. */ -export interface BillingPeriodsListOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. */ - filter?: string; - /** Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. */ - skiptoken?: string; - /** May be used to limit the number of results to the most recent N billing periods. */ - top?: number; -} +export interface RecipientTransfersListOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type BillingPeriodsListResponse = BillingPeriodsListResult; +export type RecipientTransfersListResponse = RecipientTransferDetailsListResult; /** Optional parameters. */ -export interface BillingPeriodsGetOptionalParams +export interface RecipientTransfersListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type BillingPeriodsGetResponse = BillingPeriod; - -/** Optional parameters. */ -export interface BillingPeriodsListNextOptionalParams - extends coreClient.OperationOptions { - /** May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. */ - filter?: string; - /** Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. */ - skiptoken?: string; - /** May be used to limit the number of results to the most recent N billing periods. */ - top?: number; -} - /** Contains response data for the listNext operation. */ -export type BillingPeriodsListNextResponse = BillingPeriodsListResult; +export type RecipientTransfersListNextResponse = + RecipientTransferDetailsListResult; /** Optional parameters. */ export interface BillingManagementClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; + /** Api Version */ + apiVersion?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/billing/arm-billing/src/models/mappers.ts b/sdk/billing/arm-billing/src/models/mappers.ts index cab4b62c81e0..a86e3a5d7283 100644 --- a/sdk/billing/arm-billing/src/models/mappers.ts +++ b/sdk/billing/arm-billing/src/models/mappers.ts @@ -8,233 +8,164 @@ import * as coreClient from "@azure/core-client"; -export const BillingAccountListResult: coreClient.CompositeMapper = { +export const AgreementProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingAccountListResult", + className: "AgreementProperties", modelProperties: { - value: { - serializedName: "value", + acceptanceMode: { + serializedName: "acceptanceMode", readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BillingAccount" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + agreementLink: { + serializedName: "agreementLink", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const AddressDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AddressDetails", - modelProperties: { - firstName: { - serializedName: "firstName", - type: { - name: "String" - } - }, - middleName: { - serializedName: "middleName", - type: { - name: "String" - } - }, - lastName: { - serializedName: "lastName", - type: { - name: "String" - } - }, - companyName: { - serializedName: "companyName", - type: { - name: "String" - } - }, - addressLine1: { - serializedName: "addressLine1", - required: true, - type: { - name: "String" - } + name: "String", + }, }, - addressLine2: { - serializedName: "addressLine2", + billingProfileInfo: { + serializedName: "billingProfileInfo", + readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingProfileInfo", + }, + }, + }, }, - addressLine3: { - serializedName: "addressLine3", + category: { + serializedName: "category", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - city: { - serializedName: "city", + displayName: { + serializedName: "displayName", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - district: { - serializedName: "district", + effectiveDate: { + serializedName: "effectiveDate", + readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - region: { - serializedName: "region", + expirationDate: { + serializedName: "expirationDate", + readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - country: { - serializedName: "country", - required: true, + participants: { + serializedName: "participants", + readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Participant", + }, + }, + }, }, - postalCode: { - serializedName: "postalCode", + status: { + serializedName: "status", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - email: { - serializedName: "email", + leadBillingAccountName: { + serializedName: "leadBillingAccountName", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - phoneNumber: { - serializedName: "phoneNumber", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const BillingProfilesOnExpand: coreClient.CompositeMapper = { +export const BillingProfileInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingProfilesOnExpand", + className: "BillingProfileInfo", modelProperties: { - hasMoreResults: { - serializedName: "hasMoreResults", - readOnly: true, + billingAccountId: { + serializedName: "billingAccountId", type: { - name: "Boolean" - } + name: "String", + }, }, - value: { - serializedName: "value", + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BillingProfile" - } - } - } - } - } - } -}; - -export const IndirectRelationshipInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "IndirectRelationshipInfo", - modelProperties: { - billingAccountName: { - serializedName: "billingAccountName", + name: "String", + }, + }, + billingProfileId: { + serializedName: "billingProfileId", type: { - name: "String" - } + name: "String", + }, }, - billingProfileName: { - serializedName: "billingProfileName", + billingProfileSystemId: { + serializedName: "billingProfileSystemId", type: { - name: "String" - } + name: "String", + }, }, - displayName: { - serializedName: "displayName", + indirectRelationshipOrganizationName: { + serializedName: "indirectRelationshipOrganizationName", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const AzurePlan: coreClient.CompositeMapper = { +export const Participant: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzurePlan", + className: "Participant", modelProperties: { - skuId: { - serializedName: "skuId", + email: { + serializedName: "email", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - skuDescription: { - serializedName: "skuDescription", + status: { + serializedName: "status", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const InvoiceSectionsOnExpand: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InvoiceSectionsOnExpand", - modelProperties: { - hasMoreResults: { - serializedName: "hasMoreResults", + name: "String", + }, + }, + statusDate: { + serializedName: "statusDate", readOnly: true, type: { - name: "Boolean" - } + name: "DateTime", + }, }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InvoiceSection" - } - } - } - } - } - } + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -246,132 +177,77 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + }, + }, }; -export const Enrollment: coreClient.CompositeMapper = { +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Enrollment", + className: "SystemData", modelProperties: { - startDate: { - serializedName: "startDate", - type: { - name: "DateTime" - } - }, - endDate: { - serializedName: "endDate", - type: { - name: "DateTime" - } - }, - currency: { - serializedName: "currency", - readOnly: true, - type: { - name: "String" - } - }, - channel: { - serializedName: "channel", - readOnly: true, - type: { - name: "String" - } - }, - policies: { - serializedName: "policies", - type: { - name: "Composite", - className: "EnrollmentPolicies" - } - }, - language: { - serializedName: "language", - readOnly: true, + createdBy: { + serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, - countryCode: { - serializedName: "countryCode", - readOnly: true, + createdByType: { + serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, - status: { - serializedName: "status", - readOnly: true, + createdAt: { + serializedName: "createdAt", type: { - name: "String" - } + name: "DateTime", + }, }, - billingCycle: { - serializedName: "billingCycle", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const EnrollmentPolicies: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EnrollmentPolicies", - modelProperties: { - accountOwnerViewCharges: { - serializedName: "accountOwnerViewCharges", - readOnly: true, + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { - name: "Boolean" - } + name: "String", + }, }, - departmentAdminViewCharges: { - serializedName: "departmentAdminViewCharges", - readOnly: true, + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { - name: "Boolean" - } + name: "String", + }, }, - marketplaceEnabled: { - serializedName: "marketplaceEnabled", - readOnly: true, + lastModifiedAt: { + serializedName: "lastModifiedAt", type: { - name: "Boolean" - } + name: "DateTime", + }, }, - reservedInstancesEnabled: { - serializedName: "reservedInstancesEnabled", - readOnly: true, - type: { - name: "Boolean" - } - } - } - } + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -383,38 +259,38 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetails" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; -export const ErrorDetails: coreClient.CompositeMapper = { +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetails", + className: "ErrorDetail", modelProperties: { code: { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -424,892 +300,990 @@ export const ErrorDetails: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorSubDetailsItem" - } - } - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; -export const ErrorSubDetailsItem: coreClient.CompositeMapper = { +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorSubDetailsItem", + className: "ErrorAdditionalInfo", modelProperties: { - code: { - serializedName: "code", + type: { + serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - message: { - serializedName: "message", + info: { + serializedName: "info", readOnly: true, type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "any" } }, + }, }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const BillingAccountUpdateRequest: coreClient.CompositeMapper = { +export const AgreementListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingAccountUpdateRequest", + className: "AgreementListResult", modelProperties: { - displayName: { - serializedName: "properties.displayName", - type: { - name: "String" - } - }, - soldTo: { - serializedName: "properties.soldTo", - type: { - name: "Composite", - className: "AddressDetails" - } - }, - agreementType: { - serializedName: "properties.agreementType", + nextLink: { + serializedName: "nextLink", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - accountType: { - serializedName: "properties.accountType", + value: { + serializedName: "value", readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Agreement", + }, + }, + }, }, - accountStatus: { - serializedName: "properties.accountStatus", + }, + }, +}; + +export const AssociatedTenantProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AssociatedTenantProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingProfiles: { - serializedName: "properties.billingProfiles", + displayName: { + serializedName: "displayName", type: { - name: "Composite", - className: "BillingProfilesOnExpand" - } + name: "String", + }, }, - enrollmentDetails: { - serializedName: "properties.enrollmentDetails", + tenantId: { + serializedName: "tenantId", type: { - name: "Composite", - className: "Enrollment" - } + name: "String", + }, }, - departments: { - serializedName: "properties.departments", + billingManagementState: { + serializedName: "billingManagementState", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Department" - } - } - } + name: "String", + }, }, - enrollmentAccounts: { - serializedName: "properties.enrollmentAccounts", + provisioningManagementState: { + serializedName: "provisioningManagementState", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EnrollmentAccount" - } - } - } + name: "String", + }, }, - hasReadAccess: { - serializedName: "properties.hasReadAccess", + provisioningBillingRequestId: { + serializedName: "provisioningBillingRequestId", readOnly: true, type: { - name: "Boolean" - } + name: "String", + }, }, - notificationEmailAddress: { - serializedName: "properties.notificationEmailAddress", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const InvoiceSectionListWithCreateSubPermissionResult: coreClient.CompositeMapper = { +export const AssociatedTenantListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "InvoiceSectionListWithCreateSubPermissionResult", + className: "AssociatedTenantListResult", modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, value: { serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "InvoiceSectionWithCreateSubPermission" - } - } - } + className: "AssociatedTenant", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", + }, + }, +}; + +export const AvailableBalanceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableBalanceProperties", + modelProperties: { + amount: { + serializedName: "amount", + type: { + name: "Composite", + className: "AvailableBalancePropertiesAmount", + }, + }, + paymentsOnAccount: { + serializedName: "paymentsOnAccount", readOnly: true, type: { - name: "String" - } - } - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentOnAccount", + }, + }, + }, + }, + totalPaymentsOnAccount: { + serializedName: "totalPaymentsOnAccount", + type: { + name: "Composite", + className: "AvailableBalancePropertiesTotalPaymentsOnAccount", + }, + }, + }, + }, }; -export const InvoiceSectionWithCreateSubPermission: coreClient.CompositeMapper = { +export const Amount: coreClient.CompositeMapper = { type: { name: "Composite", - className: "InvoiceSectionWithCreateSubPermission", + className: "Amount", modelProperties: { - invoiceSectionId: { - serializedName: "invoiceSectionId", + currency: { + serializedName: "currency", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - invoiceSectionDisplayName: { - serializedName: "invoiceSectionDisplayName", + value: { + serializedName: "value", readOnly: true, type: { - name: "String" - } + name: "Number", + }, }, - invoiceSectionSystemId: { - serializedName: "invoiceSectionSystemId", - readOnly: true, + }, + }, +}; + +export const PaymentOnAccount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentOnAccount", + modelProperties: { + amount: { + serializedName: "amount", type: { - name: "String" - } + name: "Composite", + className: "PaymentOnAccountAmount", + }, }, billingProfileId: { serializedName: "billingProfileId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, billingProfileDisplayName: { serializedName: "billingProfileDisplayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingProfileStatus: { - serializedName: "billingProfileStatus", + invoiceId: { + serializedName: "invoiceId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingProfileStatusReasonCode: { - serializedName: "billingProfileStatusReasonCode", + invoiceName: { + serializedName: "invoiceName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingProfileSpendingLimit: { - serializedName: "billingProfileSpendingLimit", + date: { + serializedName: "date", readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - billingProfileSystemId: { - serializedName: "billingProfileSystemId", + paymentMethodType: { + serializedName: "paymentMethodType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - enabledAzurePlans: { - serializedName: "enabledAzurePlans", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzurePlan" - } - } - } - } - } - } + }, + }, }; -export const ValidateAddressResponse: coreClient.CompositeMapper = { +export const PaymentTerm: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ValidateAddressResponse", + className: "PaymentTerm", modelProperties: { - status: { - serializedName: "status", + term: { + serializedName: "term", type: { - name: "String" - } + name: "String", + }, }, - suggestedAddresses: { - serializedName: "suggestedAddresses", + startDate: { + serializedName: "startDate", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AddressDetails" - } - } - } + name: "DateTime", + }, }, - validationMessage: { - serializedName: "validationMessage", + endDate: { + serializedName: "endDate", type: { - name: "String" - } - } - } - } -}; - -export const Amount: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Amount", - modelProperties: { - currency: { - serializedName: "currency", + name: "DateTime", + }, + }, + isDefault: { + serializedName: "isDefault", readOnly: true, type: { - name: "String" - } + name: "Boolean", + }, }, - value: { - serializedName: "value", - type: { - name: "Number" - } - } - } - } + }, + }, }; -export const InstructionListResult: coreClient.CompositeMapper = { +export const BillingAccountProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "InstructionListResult", + className: "BillingAccountProperties", modelProperties: { - value: { - serializedName: "value", + provisioningState: { + serializedName: "provisioningState", readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Instruction" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + accountStatus: { + serializedName: "accountStatus", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const BillingProfileListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BillingProfileListResult", - modelProperties: { - value: { - serializedName: "value", + name: "String", + }, + }, + accountType: { + serializedName: "accountType", readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BillingProfile" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + accountSubType: { + serializedName: "accountSubType", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const CustomerListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CustomerListResult", - modelProperties: { - value: { - serializedName: "value", + name: "String", + }, + }, + accountStatusReasonCode: { + serializedName: "accountStatusReasonCode", readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Customer" - } - } - } + name: "String", + }, }, - totalCount: { - serializedName: "totalCount", + agreementType: { + serializedName: "agreementType", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, + displayName: { + serializedName: "displayName", type: { - name: "String" - } - } - } - } -}; - -export const Reseller: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Reseller", - modelProperties: { - resellerId: { - serializedName: "resellerId", - readOnly: true, + name: "String", + }, + }, + enrollmentDetails: { + serializedName: "enrollmentDetails", type: { - name: "String" - } + name: "Composite", + className: "BillingAccountPropertiesEnrollmentDetails", + }, }, - description: { - serializedName: "description", - readOnly: true, + hasReadAccess: { + serializedName: "hasReadAccess", type: { - name: "String" - } - } - } - } -}; - -export const InvoiceSectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InvoiceSectionListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, + name: "Boolean", + }, + }, + hasNoBillingProfiles: { + serializedName: "hasNoBillingProfiles", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InvoiceSection" - } - } - } + name: "Boolean", + }, }, - totalCount: { - serializedName: "totalCount", - readOnly: true, + notificationEmailAddress: { + serializedName: "notificationEmailAddress", type: { - name: "Number" - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, + primaryBillingTenantId: { + serializedName: "primaryBillingTenantId", type: { - name: "String" - } - } - } - } -}; - -export const BillingPermissionsListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BillingPermissionsListResult", - modelProperties: { - value: { - serializedName: "value", + name: "String", + }, + }, + soldTo: { + serializedName: "soldTo", + type: { + name: "Composite", + className: "BillingAccountPropertiesSoldTo", + }, + }, + registrationNumber: { + serializedName: "registrationNumber", + type: { + name: "Composite", + className: "BillingAccountPropertiesRegistrationNumber", + }, + }, + billingRelationshipTypes: { + serializedName: "billingRelationshipTypes", readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "BillingPermissionsProperties" - } - } - } + name: "String", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const BillingPermissionsProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BillingPermissionsProperties", - modelProperties: { - actions: { - serializedName: "actions", + qualifications: { + serializedName: "qualifications", readOnly: true, type: { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, - notActions: { - serializedName: "notActions", - readOnly: true, + taxIds: { + serializedName: "taxIds", type: { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "Composite", + className: "TaxIdentifier", + }, + }, + }, + }, + }, + }, }; -export const BillingSubscriptionsListResult: coreClient.CompositeMapper = { +export const EnrollmentDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingSubscriptionsListResult", + className: "EnrollmentDetails", modelProperties: { - value: { - serializedName: "value", - readOnly: true, + startDate: { + serializedName: "startDate", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BillingSubscription" - } - } - } + name: "DateTime", + }, }, - totalCount: { - serializedName: "totalCount", + endDate: { + serializedName: "endDate", + type: { + name: "DateTime", + }, + }, + currency: { + serializedName: "currency", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + channel: { + serializedName: "channel", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const ProductsListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProductsListResult", - modelProperties: { - value: { - serializedName: "value", + name: "String", + }, + }, + language: { + serializedName: "language", readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Product" - } - } - } + name: "String", + }, }, - totalCount: { - serializedName: "totalCount", + countryCode: { + serializedName: "countryCode", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + billingCycle: { + serializedName: "billingCycle", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const InvoiceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InvoiceListResult", - modelProperties: { - value: { - serializedName: "value", + name: "String", + }, + }, + extendedTermOption: { + serializedName: "extendedTermOption", readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Invoice" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + supportLevel: { + serializedName: "supportLevel", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - totalCount: { - serializedName: "totalCount", + supportCoverage: { + serializedName: "supportCoverage", readOnly: true, type: { - name: "Number" - } - } - } - } -}; - -export const Document: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Document", - modelProperties: { - kind: { - serializedName: "kind", + name: "String", + }, + }, + cloud: { + serializedName: "cloud", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - url: { - serializedName: "url", + poNumber: { + serializedName: "poNumber", + type: { + name: "String", + }, + }, + markupStatus: { + serializedName: "markupStatus", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - source: { - serializedName: "source", + indirectRelationshipInfo: { + serializedName: "indirectRelationshipInfo", + type: { + name: "Composite", + className: "EnrollmentDetailsIndirectRelationshipInfo", + }, + }, + invoiceRecipient: { + serializedName: "invoiceRecipient", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const PaymentProperties: coreClient.CompositeMapper = { +export const IndirectRelationshipInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PaymentProperties", + className: "IndirectRelationshipInfo", modelProperties: { - paymentType: { - serializedName: "paymentType", - readOnly: true, - type: { - name: "String" - } - }, - amount: { - serializedName: "amount", + billingAccountName: { + serializedName: "billingAccountName", type: { - name: "Composite", - className: "Amount" - } + name: "String", + }, }, - date: { - serializedName: "date", - readOnly: true, + billingProfileName: { + serializedName: "billingProfileName", type: { - name: "DateTime" - } + name: "String", + }, }, - paymentMethodFamily: { - serializedName: "paymentMethodFamily", + displayName: { + serializedName: "displayName", type: { - name: "String" - } + name: "String", + }, }, - paymentMethodType: { - serializedName: "paymentMethodType", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const RebillDetails: coreClient.CompositeMapper = { +export const AddressDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RebillDetails", + className: "AddressDetails", modelProperties: { - creditNoteDocumentId: { - serializedName: "creditNoteDocumentId", - readOnly: true, + addressLine1: { + constraints: { + MinLength: 1, + }, + serializedName: "addressLine1", + required: true, type: { - name: "String" - } + name: "String", + }, }, - invoiceDocumentId: { - serializedName: "invoiceDocumentId", - readOnly: true, + addressLine2: { + serializedName: "addressLine2", type: { - name: "String" - } + name: "String", + }, }, - rebillDetails: { - serializedName: "rebillDetails", - readOnly: true, + addressLine3: { + serializedName: "addressLine3", type: { - name: "Dictionary", - value: { type: { name: "Composite", className: "RebillDetails" } } - } - } - } - } + name: "String", + }, + }, + city: { + serializedName: "city", + type: { + name: "String", + }, + }, + companyName: { + serializedName: "companyName", + type: { + name: "String", + }, + }, + country: { + constraints: { + MinLength: 1, + }, + serializedName: "country", + required: true, + type: { + name: "String", + }, + }, + district: { + serializedName: "district", + type: { + name: "String", + }, + }, + email: { + serializedName: "email", + type: { + name: "String", + }, + }, + firstName: { + serializedName: "firstName", + type: { + name: "String", + }, + }, + lastName: { + serializedName: "lastName", + type: { + name: "String", + }, + }, + middleName: { + serializedName: "middleName", + type: { + name: "String", + }, + }, + phoneNumber: { + serializedName: "phoneNumber", + type: { + name: "String", + }, + }, + postalCode: { + serializedName: "postalCode", + type: { + name: "String", + }, + }, + region: { + serializedName: "region", + type: { + name: "String", + }, + }, + isValidAddress: { + serializedName: "isValidAddress", + type: { + name: "Boolean", + }, + }, + }, + }, }; -export const DownloadUrl: coreClient.CompositeMapper = { +export const RegistrationNumber: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DownloadUrl", + className: "RegistrationNumber", modelProperties: { - expiryTime: { - serializedName: "expiryTime", + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + required: { + serializedName: "required", readOnly: true, type: { - name: "DateTime" - } + name: "Boolean", + }, }, - url: { - serializedName: "url", + type: { + serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, }; -export const TransferBillingSubscriptionRequestProperties: coreClient.CompositeMapper = { +export const TaxIdentifier: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TransferBillingSubscriptionRequestProperties", + className: "TaxIdentifier", modelProperties: { - destinationInvoiceSectionId: { - serializedName: "destinationInvoiceSectionId", - required: true, + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + scope: { + serializedName: "scope", + type: { + name: "String", + }, + }, + country: { + serializedName: "country", + type: { + name: "String", + }, + }, + status: { + serializedName: "status", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const ValidateSubscriptionTransferEligibilityResult: coreClient.CompositeMapper = { +export const TransitionDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ValidateSubscriptionTransferEligibilityResult", + className: "TransitionDetails", modelProperties: { - isMoveEligible: { - serializedName: "isMoveEligible", + transitionDate: { + serializedName: "transitionDate", readOnly: true, type: { - name: "Boolean" - } + name: "DateTime", + }, }, - errorDetails: { - serializedName: "errorDetails", + anniversaryDay: { + serializedName: "anniversaryDay", + readOnly: true, type: { - name: "Composite", - className: "ValidateSubscriptionTransferEligibilityError" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const ValidateSubscriptionTransferEligibilityError: coreClient.CompositeMapper = { +export const InvoiceSectionWithCreateSubPermissionListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoiceSectionWithCreateSubPermissionListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InvoiceSectionWithCreateSubPermission", + }, + }, + }, + }, + }, + }, + }; + +export const InvoiceSectionWithCreateSubPermission: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoiceSectionWithCreateSubPermission", + modelProperties: { + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "billingProfileId", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileSystemId: { + serializedName: "billingProfileSystemId", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileStatus: { + serializedName: "billingProfileStatus", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileStatusReasonCode: { + serializedName: "billingProfileStatusReasonCode", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileSpendingLimit: { + serializedName: "billingProfileSpendingLimit", + readOnly: true, + type: { + name: "String", + }, + }, + enabledAzurePlans: { + serializedName: "enabledAzurePlans", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzurePlan", + }, + }, + }, + }, + invoiceSectionDisplayName: { + serializedName: "invoiceSectionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionId: { + serializedName: "invoiceSectionId", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionSystemId: { + serializedName: "invoiceSectionSystemId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const AzurePlan: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ValidateSubscriptionTransferEligibilityError", + className: "AzurePlan", modelProperties: { - code: { - serializedName: "code", + productId: { + serializedName: "productId", type: { - name: "String" - } + name: "String", + }, }, - message: { - serializedName: "message", + skuId: { + serializedName: "skuId", type: { - name: "String" - } + name: "String", + }, }, - details: { - serializedName: "details", - type: { - name: "String" - } - } - } - } -}; - -export const TransferProductRequestProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TransferProductRequestProperties", - modelProperties: { - destinationInvoiceSectionId: { - serializedName: "destinationInvoiceSectionId", + skuDescription: { + serializedName: "skuDescription", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const ValidateProductTransferEligibilityResult: coreClient.CompositeMapper = { +export const PaymentTermsEligibilityResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ValidateProductTransferEligibilityResult", + className: "PaymentTermsEligibilityResult", modelProperties: { - isMoveEligible: { - serializedName: "isMoveEligible", - readOnly: true, + eligibilityStatus: { + serializedName: "eligibilityStatus", type: { - name: "Boolean" - } + name: "String", + }, }, - errorDetails: { - serializedName: "errorDetails", + eligibilityDetails: { + serializedName: "eligibilityDetails", type: { - name: "Composite", - className: "ValidateProductTransferEligibilityError" - } - } - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentTermsEligibilityDetail", + }, + }, + }, + }, + }, + }, }; -export const ValidateProductTransferEligibilityError: coreClient.CompositeMapper = { +export const PaymentTermsEligibilityDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ValidateProductTransferEligibilityError", + className: "PaymentTermsEligibilityDetail", modelProperties: { code: { serializedName: "code", type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", type: { - name: "String" - } + name: "String", + }, }, - details: { - serializedName: "details", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const TransactionListResult: coreClient.CompositeMapper = { +export const BillingAccountListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TransactionListResult", + className: "BillingAccountListResult", modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, value: { serializedName: "value", readOnly: true, @@ -1318,130 +1292,63 @@ export const TransactionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Transaction" - } - } - } - }, - totalCount: { - serializedName: "totalCount", - readOnly: true, - type: { - name: "Number" - } + className: "BillingAccount", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const OperationListResult: coreClient.CompositeMapper = { +export const AddressValidationResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "AddressValidationResponse", modelProperties: { - value: { - serializedName: "value", + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String", + }, + }, + suggestedAddresses: { + serializedName: "suggestedAddresses", readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "AddressDetails", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", + validationMessage: { + serializedName: "validationMessage", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const Operation: coreClient.CompositeMapper = { +export const BillingPermissionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "BillingPermissionListResult", modelProperties: { - name: { - serializedName: "name", + nextLink: { + serializedName: "nextLink", readOnly: true, type: { - name: "String" - } + 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 = { - type: { - name: "Composite", - className: "BillingRoleDefinitionListResult", - modelProperties: { value: { serializedName: "value", readOnly: true, @@ -1450,1190 +1357,7849 @@ export const BillingRoleDefinitionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "BillingRoleDefinition" - } - } - } + className: "BillingPermission", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const BillingRoleAssignmentListResult: coreClient.CompositeMapper = { +export const BillingPermission: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingRoleAssignmentListResult", + className: "BillingPermission", modelProperties: { - value: { - serializedName: "value", + actions: { + serializedName: "actions", readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "BillingRoleAssignment" - } - } - } + name: "String", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const AgreementListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AgreementListResult", - modelProperties: { - value: { - serializedName: "value", + notActions: { + serializedName: "notActions", readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Agreement" - } - } - } + name: "String", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const Participants: coreClient.CompositeMapper = { +export const CheckAccessRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Participants", + className: "CheckAccessRequest", modelProperties: { - status: { - serializedName: "status", - readOnly: true, - type: { - name: "String" - } - }, - statusDate: { - serializedName: "statusDate", - readOnly: true, + actions: { + serializedName: "actions", type: { - name: "DateTime" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - email: { - serializedName: "email", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const ReservationsListResult: coreClient.CompositeMapper = { +export const CheckAccessResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ReservationsListResult", + className: "CheckAccessResponse", modelProperties: { - value: { - serializedName: "value", + accessDecision: { + serializedName: "accessDecision", readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Reservation" - } - } - } + name: "String", + }, }, - nextLink: { - serializedName: "nextLink", + action: { + serializedName: "action", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - summary: { - serializedName: "summary", - type: { - name: "Composite", - className: "ReservationSummary" - } - } - } - } + }, + }, }; -export const Reservation: coreClient.CompositeMapper = { +export const DeleteBillingProfileEligibilityResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DeleteBillingProfileEligibilityResult", + modelProperties: { + eligibilityStatus: { + serializedName: "eligibilityStatus", + type: { + name: "String", + }, + }, + eligibilityDetails: { + serializedName: "eligibilityDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeleteBillingProfileEligibilityDetail", + }, + }, + }, + }, + }, + }, + }; + +export const DeleteBillingProfileEligibilityDetail: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DeleteBillingProfileEligibilityDetail", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const BillingProfileProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Reservation", + className: "BillingProfileProperties", modelProperties: { - id: { - serializedName: "id", + provisioningState: { + serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - name: { - serializedName: "name", + billingRelationshipType: { + serializedName: "billingRelationshipType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - type: { - serializedName: "type", - readOnly: true, + billTo: { + serializedName: "billTo", type: { - name: "String" - } + name: "Composite", + className: "BillingProfilePropertiesBillTo", + }, }, - location: { - serializedName: "location", + currency: { + serializedName: "currency", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - sku: { - serializedName: "sku", + displayName: { + serializedName: "displayName", type: { - name: "Composite", - className: "ReservationSkuProperty" - } + name: "String", + }, }, - appliedScopes: { - serializedName: "properties.appliedScopes", + enabledAzurePlans: { + serializedName: "enabledAzurePlans", type: { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "Composite", + className: "AzurePlan", + }, + }, + }, }, - appliedScopeType: { - serializedName: "properties.appliedScopeType", + hasReadAccess: { + serializedName: "hasReadAccess", readOnly: true, type: { - name: "String" - } + name: "Boolean", + }, }, - reservedResourceType: { - serializedName: "properties.reservedResourceType", - readOnly: true, + indirectRelationshipInfo: { + serializedName: "indirectRelationshipInfo", type: { - name: "String" - } + name: "Composite", + className: "BillingProfilePropertiesIndirectRelationshipInfo", + }, }, - quantity: { - serializedName: "properties.quantity", + invoiceDay: { + serializedName: "invoiceDay", readOnly: true, type: { - name: "Number" - } + name: "Number", + }, }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + invoiceEmailOptIn: { + serializedName: "invoiceEmailOptIn", type: { - name: "String" - } + name: "Boolean", + }, }, - expiryDate: { - serializedName: "properties.expiryDate", - readOnly: true, + invoiceRecipients: { + serializedName: "invoiceRecipients", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - provisioningSubState: { - serializedName: "properties.provisioningSubState", - readOnly: true, + poNumber: { + serializedName: "poNumber", type: { - name: "String" - } + name: "String", + }, }, - displayName: { - serializedName: "properties.displayName", - readOnly: true, + shipTo: { + serializedName: "shipTo", type: { - name: "String" - } + name: "Composite", + className: "BillingProfilePropertiesShipTo", + }, }, - displayProvisioningState: { - serializedName: "properties.displayProvisioningState", - readOnly: true, + soldTo: { + serializedName: "soldTo", type: { - name: "String" - } + name: "Composite", + className: "BillingProfilePropertiesSoldTo", + }, }, - userFriendlyRenewState: { - serializedName: "properties.userFriendlyRenewState", + spendingLimit: { + serializedName: "spendingLimit", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - userFriendlyAppliedScopeType: { - serializedName: "properties.userFriendlyAppliedScopeType", + spendingLimitDetails: { + serializedName: "spendingLimitDetails", readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SpendingLimitDetails", + }, + }, + }, }, - effectiveDateTime: { - serializedName: "properties.effectiveDateTime", + status: { + serializedName: "status", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - skuDescription: { - serializedName: "properties.skuDescription", + statusReasonCode: { + serializedName: "statusReasonCode", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - term: { - serializedName: "properties.term", + systemId: { + serializedName: "systemId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - renew: { - serializedName: "properties.renew", - readOnly: true, + tags: { + serializedName: "tags", type: { - name: "Boolean" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - renewSource: { - serializedName: "properties.renewSource", + targetClouds: { + serializedName: "targetClouds", readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - utilization: { - serializedName: "properties.utilization", + currentPaymentTerm: { + serializedName: "currentPaymentTerm", type: { name: "Composite", - className: "ReservationPropertyUtilization" - } - } - } - } + className: "BillingProfilePropertiesCurrentPaymentTerm", + }, + }, + otherPaymentTerms: { + serializedName: "otherPaymentTerms", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentTerm", + }, + }, + }, + }, + }, + }, }; -export const ReservationSkuProperty: coreClient.CompositeMapper = { +export const SpendingLimitDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ReservationSkuProperty", + className: "SpendingLimitDetails", modelProperties: { - name: { - serializedName: "name", - readOnly: true, + amount: { + serializedName: "amount", + type: { + name: "Number", + }, + }, + currency: { + serializedName: "currency", + type: { + name: "String", + }, + }, + startDate: { + serializedName: "startDate", + type: { + name: "DateTime", + }, + }, + endDate: { + serializedName: "endDate", + type: { + name: "DateTime", + }, + }, + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + status: { + serializedName: "status", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const ReservationPropertyUtilization: coreClient.CompositeMapper = { +export const BillingProfileListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ReservationPropertyUtilization", + className: "BillingProfileListResult", modelProperties: { - trend: { - serializedName: "trend", + nextLink: { + serializedName: "nextLink", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - aggregates: { - serializedName: "aggregates", + value: { + serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "ReservationUtilizationAggregates" - } - } - } - } - } - } + className: "BillingProfile", + }, + }, + }, + }, + }, + }, }; -export const ReservationUtilizationAggregates: coreClient.CompositeMapper = { +export const BillingPropertyProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ReservationUtilizationAggregates", + className: "BillingPropertyProperties", modelProperties: { - grain: { - serializedName: "grain", + billingAccountAgreementType: { + serializedName: "billingAccountAgreementType", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - grainUnit: { - serializedName: "grainUnit", + billingAccountDisplayName: { + serializedName: "billingAccountDisplayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - value: { - serializedName: "value", + billingAccountId: { + serializedName: "billingAccountId", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - valueUnit: { - serializedName: "valueUnit", + accountAdminNotificationEmailAddress: { + serializedName: "accountAdminNotificationEmailAddress", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const ReservationSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ReservationSummary", - modelProperties: { - succeededCount: { - serializedName: "succeededCount", + name: "String", + }, + }, + billingAccountSoldToCountry: { + serializedName: "billingAccountSoldToCountry", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - failedCount: { - serializedName: "failedCount", + billingAccountStatus: { + serializedName: "billingAccountStatus", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - expiringCount: { - serializedName: "expiringCount", + billingAccountStatusReasonCode: { + serializedName: "billingAccountStatusReasonCode", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - expiredCount: { - serializedName: "expiredCount", + billingAccountType: { + serializedName: "billingAccountType", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - pendingCount: { - serializedName: "pendingCount", + billingAccountSubType: { + serializedName: "billingAccountSubType", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - cancelledCount: { - serializedName: "cancelledCount", + billingCurrency: { + serializedName: "billingCurrency", readOnly: true, type: { - name: "Number" - } - } - } - } -}; - -export const EnrollmentAccountListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EnrollmentAccountListResult", - modelProperties: { - value: { - serializedName: "value", + name: "String", + }, + }, + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "billingProfileId", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileSpendingLimit: { + serializedName: "billingProfileSpendingLimit", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileSpendingLimitDetails: { + serializedName: "billingProfileSpendingLimitDetails", readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "EnrollmentAccountSummary" - } - } - } + className: "SpendingLimitDetails", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", + billingProfileStatus: { + serializedName: "billingProfileStatus", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const BillingPeriodsListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BillingPeriodsListResult", - modelProperties: { - value: { - serializedName: "value", + name: "String", + }, + }, + billingProfileStatusReasonCode: { + serializedName: "billingProfileStatusReasonCode", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfilePaymentMethodFamily: { + serializedName: "billingProfilePaymentMethodFamily", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfilePaymentMethodType: { + serializedName: "billingProfilePaymentMethodType", + readOnly: true, + type: { + name: "String", + }, + }, + billingTenantId: { + serializedName: "billingTenantId", + readOnly: true, + type: { + name: "String", + }, + }, + costCenter: { + serializedName: "costCenter", + type: { + name: "String", + }, + }, + customerDisplayName: { + serializedName: "customerDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + customerId: { + serializedName: "customerId", + readOnly: true, + type: { + name: "String", + }, + }, + customerStatus: { + serializedName: "customerStatus", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionDisplayName: { + serializedName: "invoiceSectionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionId: { + serializedName: "invoiceSectionId", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionStatus: { + serializedName: "invoiceSectionStatus", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionStatusReasonCode: { + serializedName: "invoiceSectionStatusReasonCode", + readOnly: true, + type: { + name: "String", + }, + }, + isTransitionedBillingAccount: { + serializedName: "isTransitionedBillingAccount", + readOnly: true, + type: { + name: "Boolean", + }, + }, + skuDescription: { + serializedName: "skuDescription", + readOnly: true, + type: { + name: "String", + }, + }, + skuId: { + serializedName: "skuId", + readOnly: true, + type: { + name: "String", + }, + }, + subscriptionBillingStatus: { + serializedName: "subscriptionBillingStatus", + readOnly: true, + type: { + name: "String", + }, + }, + subscriptionBillingStatusDetails: { + serializedName: "subscriptionBillingStatusDetails", readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "BillingPeriod" - } - } - } + className: "BillingSubscriptionStatusDetails", + }, + }, + }, }, - nextLink: { - serializedName: "nextLink", + subscriptionBillingType: { + serializedName: "subscriptionBillingType", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const BillingProfileCreationRequest: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BillingProfileCreationRequest", - modelProperties: { - displayName: { - serializedName: "displayName", + name: "String", + }, + }, + subscriptionServiceUsageAddress: { + serializedName: "subscriptionServiceUsageAddress", type: { - name: "String" - } + name: "Composite", + className: "BillingPropertyPropertiesSubscriptionServiceUsageAddress", + }, }, - poNumber: { - serializedName: "poNumber", + subscriptionWorkloadType: { + serializedName: "subscriptionWorkloadType", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billTo: { - serializedName: "billTo", + enrollmentDetails: { + serializedName: "enrollmentDetails", type: { name: "Composite", - className: "AddressDetails" - } + className: "BillingPropertyPropertiesEnrollmentDetails", + }, }, - invoiceEmailOptIn: { - serializedName: "invoiceEmailOptIn", + isAccountAdmin: { + serializedName: "isAccountAdmin", + readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, - enabledAzurePlans: { - serializedName: "enabledAzurePlans", + productId: { + serializedName: "productId", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzurePlan" - } - } - } - } - } - } -}; - -export const InvoiceSectionCreationRequest: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InvoiceSectionCreationRequest", - modelProperties: { - displayName: { - serializedName: "displayName", + name: "String", + }, + }, + productName: { + serializedName: "productName", + readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const EnrollmentAccountContext: coreClient.CompositeMapper = { +export const BillingSubscriptionStatusDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnrollmentAccountContext", + className: "BillingSubscriptionStatusDetails", modelProperties: { - costCenter: { - serializedName: "costCenter", - type: { - name: "String" - } - }, - startDate: { - serializedName: "startDate", + effectiveDate: { + serializedName: "effectiveDate", + readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, - endDate: { - serializedName: "endDate", + reason: { + serializedName: "reason", + readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - enrollmentAccountName: { - serializedName: "enrollmentAccountName", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const InvoiceSection: coreClient.CompositeMapper = { +export const SubscriptionEnrollmentDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "InvoiceSection", + className: "SubscriptionEnrollmentDetails", modelProperties: { - ...Resource.type.modelProperties, - displayName: { - serializedName: "properties.displayName", + departmentDisplayName: { + serializedName: "departmentDisplayName", type: { - name: "String" - } + name: "String", + }, }, - labels: { - serializedName: "properties.labels", + departmentId: { + serializedName: "departmentId", type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - state: { - serializedName: "properties.state", - readOnly: true, + enrollmentAccountStatus: { + serializedName: "enrollmentAccountStatus", type: { - name: "String" - } + name: "String", + }, }, - systemId: { - serializedName: "properties.systemId", - readOnly: true, + enrollmentAccountDisplayName: { + serializedName: "enrollmentAccountDisplayName", type: { - name: "String" - } + name: "String", + }, }, - tags: { - serializedName: "properties.tags", + enrollmentAccountId: { + serializedName: "enrollmentAccountId", type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - targetCloud: { - serializedName: "properties.targetCloud", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const BillingProfile: coreClient.CompositeMapper = { +export const BillingRequestListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingProfile", + className: "BillingRequestListResult", modelProperties: { - ...Resource.type.modelProperties, - displayName: { - serializedName: "properties.displayName", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - poNumber: { - serializedName: "properties.poNumber", + value: { + serializedName: "value", + readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingRequest", + }, + }, + }, }, - billingRelationshipType: { - serializedName: "properties.billingRelationshipType", + }, + }, +}; + +export const BillingRequestProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRequestProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billTo: { - serializedName: "properties.billTo", + additionalInformation: { + serializedName: "additionalInformation", type: { - name: "Composite", - className: "AddressDetails" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - indirectRelationshipInfo: { - serializedName: "properties.indirectRelationshipInfo", + reviewedBy: { + serializedName: "reviewedBy", type: { name: "Composite", - className: "IndirectRelationshipInfo" - } + className: "BillingRequestPropertiesReviewedBy", + }, }, - invoiceEmailOptIn: { - serializedName: "properties.invoiceEmailOptIn", + reviewalDate: { + serializedName: "reviewalDate", + readOnly: true, type: { - name: "Boolean" - } + name: "DateTime", + }, }, - invoiceDay: { - serializedName: "properties.invoiceDay", + billingAccountId: { + serializedName: "billingAccountId", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - currency: { - serializedName: "properties.currency", + billingAccountName: { + serializedName: "billingAccountName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - enabledAzurePlans: { - serializedName: "properties.enabledAzurePlans", + billingAccountDisplayName: { + serializedName: "billingAccountDisplayName", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzurePlan" - } - } - } + name: "String", + }, }, - invoiceSections: { - serializedName: "properties.invoiceSections", + billingAccountPrimaryBillingTenantId: { + serializedName: "billingAccountPrimaryBillingTenantId", + readOnly: true, type: { - name: "Composite", - className: "InvoiceSectionsOnExpand" - } + name: "String", + }, }, - hasReadAccess: { - serializedName: "properties.hasReadAccess", + billingProfileId: { + serializedName: "billingProfileId", readOnly: true, type: { - name: "Boolean" - } + name: "String", + }, }, - systemId: { - serializedName: "properties.systemId", + billingProfileName: { + serializedName: "billingProfileName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - status: { - serializedName: "properties.status", + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - statusReasonCode: { - serializedName: "properties.statusReasonCode", - readOnly: true, + createdBy: { + serializedName: "createdBy", type: { - name: "String" - } + name: "Composite", + className: "BillingRequestPropertiesCreatedBy", + }, }, - spendingLimit: { - serializedName: "properties.spendingLimit", + creationDate: { + serializedName: "creationDate", readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - targetClouds: { - serializedName: "properties.targetClouds", + expirationDate: { + serializedName: "expirationDate", readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } + name: "DateTime", + }, }, - tags: { - serializedName: "properties.tags", + decisionReason: { + serializedName: "decisionReason", + type: { + name: "String", + }, + }, + invoiceSectionId: { + serializedName: "invoiceSectionId", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionName: { + serializedName: "invoiceSectionName", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionDisplayName: { + serializedName: "invoiceSectionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + customerId: { + serializedName: "customerId", + readOnly: true, + type: { + name: "String", + }, + }, + customerName: { + serializedName: "customerName", + readOnly: true, + type: { + name: "String", + }, + }, + customerDisplayName: { + serializedName: "customerDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String", + }, + }, + subscriptionName: { + serializedName: "subscriptionName", + readOnly: true, + type: { + name: "String", + }, + }, + subscriptionDisplayName: { + serializedName: "subscriptionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + justification: { + serializedName: "justification", + type: { + name: "String", + }, + }, + recipients: { + serializedName: "recipients", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Principal", + }, + }, + }, + }, + requestScope: { + serializedName: "requestScope", + type: { + name: "String", + }, + }, + billingScope: { + serializedName: "billingScope", + readOnly: true, + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + lastUpdatedBy: { + serializedName: "lastUpdatedBy", + type: { + name: "Composite", + className: "BillingRequestPropertiesLastUpdatedBy", + }, + }, + lastUpdatedDate: { + serializedName: "lastUpdatedDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const Principal: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Principal", + modelProperties: { + tenantId: { + serializedName: "tenantId", + type: { + name: "String", + }, + }, + objectId: { + serializedName: "objectId", + type: { + name: "String", + }, + }, + upn: { + serializedName: "upn", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingRoleAssignmentProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRoleAssignmentProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + createdOn: { + serializedName: "createdOn", + readOnly: true, + type: { + name: "DateTime", + }, + }, + createdByPrincipalTenantId: { + serializedName: "createdByPrincipalTenantId", + readOnly: true, + type: { + name: "String", + }, + }, + createdByPrincipalId: { + serializedName: "createdByPrincipalId", + readOnly: true, + type: { + name: "String", + }, + }, + createdByPrincipalPuid: { + serializedName: "createdByPrincipalPuid", + readOnly: true, + type: { + name: "String", + }, + }, + createdByUserEmailAddress: { + serializedName: "createdByUserEmailAddress", + readOnly: true, + type: { + name: "String", + }, + }, + modifiedOn: { + serializedName: "modifiedOn", + readOnly: true, + type: { + name: "DateTime", + }, + }, + modifiedByPrincipalPuid: { + serializedName: "modifiedByPrincipalPuid", + readOnly: true, + type: { + name: "String", + }, + }, + modifiedByUserEmailAddress: { + serializedName: "modifiedByUserEmailAddress", + readOnly: true, + type: { + name: "String", + }, + }, + modifiedByPrincipalId: { + serializedName: "modifiedByPrincipalId", + readOnly: true, + type: { + name: "String", + }, + }, + modifiedByPrincipalTenantId: { + serializedName: "modifiedByPrincipalTenantId", + readOnly: true, + type: { + name: "String", + }, + }, + principalPuid: { + serializedName: "principalPuid", + type: { + name: "String", + }, + }, + principalId: { + serializedName: "principalId", + type: { + name: "String", + }, + }, + principalTenantId: { + serializedName: "principalTenantId", + type: { + name: "String", + }, + }, + roleDefinitionId: { + constraints: { + MinLength: 1, + }, + serializedName: "roleDefinitionId", + required: true, + type: { + name: "String", + }, + }, + scope: { + serializedName: "scope", + type: { + name: "String", + }, + }, + userAuthenticationType: { + serializedName: "userAuthenticationType", + type: { + name: "String", + }, + }, + userEmailAddress: { + serializedName: "userEmailAddress", + type: { + name: "String", + }, + }, + principalTenantName: { + serializedName: "principalTenantName", + readOnly: true, + type: { + name: "String", + }, + }, + principalDisplayName: { + serializedName: "principalDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + principalType: { + serializedName: "principalType", + readOnly: true, + type: { + name: "String", + }, + }, + billingRequestId: { + serializedName: "billingRequestId", + readOnly: true, + type: { + name: "String", + }, + }, + billingAccountId: { + serializedName: "billingAccountId", + readOnly: true, + type: { + name: "String", + }, + }, + billingAccountDisplayName: { + serializedName: "billingAccountDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "billingProfileId", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionId: { + serializedName: "invoiceSectionId", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionDisplayName: { + serializedName: "invoiceSectionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + customerId: { + serializedName: "customerId", + readOnly: true, + type: { + name: "String", + }, + }, + customerDisplayName: { + serializedName: "customerDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingRoleAssignmentListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRoleAssignmentListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingRoleAssignment", + }, + }, + }, + }, + }, + }, +}; + +export const BillingRoleDefinitionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRoleDefinitionProperties", + modelProperties: { + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + permissions: { + serializedName: "permissions", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingPermission", + }, + }, + }, + }, + roleName: { + constraints: { + MinLength: 1, + }, + serializedName: "roleName", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingRoleDefinitionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRoleDefinitionListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingRoleDefinition", + }, + }, + }, + }, + }, + }, +}; + +export const Sku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingPlanInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingPlanInformation", + modelProperties: { + pricingCurrencyTotal: { + serializedName: "pricingCurrencyTotal", + type: { + name: "Composite", + className: "Price", + }, + }, + startDate: { + serializedName: "startDate", + type: { + name: "Date", + }, + }, + nextPaymentDueDate: { + serializedName: "nextPaymentDueDate", + type: { + name: "Date", + }, + }, + transactions: { + serializedName: "transactions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentDetail", + }, + }, + }, + }, + }, + }, +}; + +export const Price: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Price", + modelProperties: { + currencyCode: { + serializedName: "currencyCode", + type: { + name: "String", + }, + }, + amount: { + serializedName: "amount", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const PaymentDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentDetail", + modelProperties: { + dueDate: { + serializedName: "dueDate", + type: { + name: "Date", + }, + }, + paymentDate: { + serializedName: "paymentDate", + type: { + name: "Date", + }, + }, + pricingCurrencyTotal: { + serializedName: "pricingCurrencyTotal", + type: { + name: "Composite", + className: "Price", + }, + }, + billingCurrencyTotal: { + serializedName: "billingCurrencyTotal", + type: { + name: "Composite", + className: "Price", + }, + }, + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + extendedStatusInfo: { + serializedName: "extendedStatusInfo", + type: { + name: "Composite", + className: "ExtendedStatusInfo", + }, + }, + }, + }, +}; + +export const ExtendedStatusInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtendedStatusInfo", + modelProperties: { + statusCode: { + serializedName: "statusCode", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + subscriptionId: { + serializedName: "properties.subscriptionId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SavingsPlanOrderModelList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanOrderModelList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SavingsPlanOrderModel", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SavingsPlanModelList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanModelList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SavingsPlanModel", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RenewProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RenewProperties", + modelProperties: { + purchaseProperties: { + serializedName: "purchaseProperties", + type: { + name: "Composite", + className: "PurchaseRequest", + }, + }, + }, + }, +}; + +export const PurchaseRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PurchaseRequest", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + billingScopeId: { + serializedName: "properties.billingScopeId", + type: { + name: "String", + }, + }, + term: { + serializedName: "properties.term", + type: { + name: "String", + }, + }, + billingPlan: { + serializedName: "properties.billingPlan", + type: { + name: "String", + }, + }, + appliedScopeType: { + serializedName: "properties.appliedScopeType", + type: { + name: "String", + }, + }, + commitment: { + serializedName: "properties.commitment", + type: { + name: "Composite", + className: "Commitment", + }, + }, + renew: { + defaultValue: false, + serializedName: "properties.renew", + type: { + name: "Boolean", + }, + }, + appliedScopeProperties: { + serializedName: "properties.appliedScopeProperties", + type: { + name: "Composite", + className: "AppliedScopeProperties", + }, + }, + }, + }, +}; + +export const AppliedScopeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AppliedScopeProperties", + modelProperties: { + tenantId: { + serializedName: "tenantId", + type: { + name: "String", + }, + }, + managementGroupId: { + serializedName: "managementGroupId", + type: { + name: "String", + }, + }, + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String", + }, + }, + resourceGroupId: { + serializedName: "resourceGroupId", + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Utilization: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Utilization", + modelProperties: { + trend: { + serializedName: "trend", + readOnly: true, + type: { + name: "String", + }, + }, + aggregates: { + serializedName: "aggregates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UtilizationAggregates", + }, + }, + }, + }, + }, + }, +}; + +export const UtilizationAggregates: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UtilizationAggregates", + modelProperties: { + grain: { + serializedName: "grain", + readOnly: true, + type: { + name: "Number", + }, + }, + grainUnit: { + serializedName: "grainUnit", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Number", + }, + }, + valueUnit: { + serializedName: "valueUnit", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SavingsPlanModelListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanModelListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SavingsPlanModel", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + summary: { + serializedName: "summary", + type: { + name: "Composite", + className: "SavingsPlanSummaryCount", + }, + }, + }, + }, +}; + +export const SavingsPlanSummaryCount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanSummaryCount", + modelProperties: { + succeededCount: { + serializedName: "succeededCount", + readOnly: true, + type: { + name: "Number", + }, + }, + failedCount: { + serializedName: "failedCount", + readOnly: true, + type: { + name: "Number", + }, + }, + expiringCount: { + serializedName: "expiringCount", + readOnly: true, + type: { + name: "Number", + }, + }, + expiredCount: { + serializedName: "expiredCount", + readOnly: true, + type: { + name: "Number", + }, + }, + pendingCount: { + serializedName: "pendingCount", + readOnly: true, + type: { + name: "Number", + }, + }, + cancelledCount: { + serializedName: "cancelledCount", + readOnly: true, + type: { + name: "Number", + }, + }, + processingCount: { + serializedName: "processingCount", + readOnly: true, + type: { + name: "Number", + }, + }, + noBenefitCount: { + serializedName: "noBenefitCount", + readOnly: true, + type: { + name: "Number", + }, + }, + warningCount: { + serializedName: "warningCount", + readOnly: true, + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const SavingsPlanUpdateRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanUpdateRequest", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "SavingsPlanUpdateRequestProperties", + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const SavingsPlanUpdateRequestProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanUpdateRequestProperties", + modelProperties: { + displayName: { + serializedName: "displayName", + type: { + name: "String", + }, + }, + appliedScopeType: { + serializedName: "appliedScopeType", + type: { + name: "String", + }, + }, + appliedScopeProperties: { + serializedName: "appliedScopeProperties", + type: { + name: "Composite", + className: "AppliedScopeProperties", + }, + }, + renew: { + defaultValue: false, + serializedName: "renew", + type: { + name: "Boolean", + }, + }, + renewProperties: { + serializedName: "renewProperties", + type: { + name: "Composite", + className: "RenewProperties", + }, + }, + }, + }, +}; + +export const SavingsPlanUpdateValidateRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanUpdateValidateRequest", + modelProperties: { + benefits: { + serializedName: "benefits", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SavingsPlanUpdateRequestProperties", + }, + }, + }, + }, + }, + }, +}; + +export const SavingsPlanValidateResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanValidateResponse", + modelProperties: { + benefits: { + serializedName: "benefits", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SavingsPlanValidResponseProperty", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SavingsPlanValidResponseProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanValidResponseProperty", + modelProperties: { + valid: { + serializedName: "valid", + type: { + name: "Boolean", + }, + }, + reasonCode: { + serializedName: "reasonCode", + type: { + name: "String", + }, + }, + reason: { + serializedName: "reason", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingSubscriptionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingSubscriptionProperties", + modelProperties: { + autoRenew: { + serializedName: "autoRenew", + type: { + name: "String", + }, + }, + beneficiaryTenantId: { + serializedName: "beneficiaryTenantId", + type: { + name: "String", + }, + }, + beneficiary: { + serializedName: "beneficiary", + type: { + name: "Composite", + className: "Beneficiary", + }, + }, + billingFrequency: { + serializedName: "billingFrequency", + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "billingProfileId", + type: { + name: "String", + }, + }, + billingPolicies: { + serializedName: "billingPolicies", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileName: { + serializedName: "billingProfileName", + readOnly: true, + type: { + name: "String", + }, + }, + consumptionCostCenter: { + serializedName: "consumptionCostCenter", + type: { + name: "String", + }, + }, + customerId: { + serializedName: "customerId", + type: { + name: "String", + }, + }, + customerDisplayName: { + serializedName: "customerDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + customerName: { + serializedName: "customerName", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + type: { + name: "String", + }, + }, + enrollmentAccountId: { + serializedName: "enrollmentAccountId", + readOnly: true, + type: { + name: "String", + }, + }, + enrollmentAccountDisplayName: { + serializedName: "enrollmentAccountDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionId: { + serializedName: "invoiceSectionId", + type: { + name: "String", + }, + }, + invoiceSectionDisplayName: { + serializedName: "invoiceSectionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionName: { + serializedName: "invoiceSectionName", + readOnly: true, + type: { + name: "String", + }, + }, + lastMonthCharges: { + serializedName: "lastMonthCharges", + type: { + name: "Composite", + className: "Amount", + }, + }, + monthToDateCharges: { + serializedName: "monthToDateCharges", + type: { + name: "Composite", + className: "Amount", + }, + }, + nextBillingCycleDetails: { + serializedName: "nextBillingCycleDetails", + type: { + name: "Composite", + className: "NextBillingCycleDetails", + }, + }, + offerId: { + serializedName: "offerId", + readOnly: true, + type: { + name: "String", + }, + }, + productCategory: { + serializedName: "productCategory", + readOnly: true, + type: { + name: "String", + }, + }, + productType: { + serializedName: "productType", + readOnly: true, + type: { + name: "String", + }, + }, + productTypeId: { + serializedName: "productTypeId", + type: { + name: "String", + }, + }, + purchaseDate: { + serializedName: "purchaseDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + quantity: { + serializedName: "quantity", + type: { + name: "Number", + }, + }, + reseller: { + serializedName: "reseller", + type: { + name: "Composite", + className: "Reseller", + }, + }, + renewalTermDetails: { + serializedName: "renewalTermDetails", + type: { + name: "Composite", + className: "RenewalTermDetails", + }, + }, + skuId: { + serializedName: "skuId", + type: { + name: "String", + }, + }, + skuDescription: { + serializedName: "skuDescription", + readOnly: true, + type: { + name: "String", + }, + }, + systemOverrides: { + serializedName: "systemOverrides", + type: { + name: "Composite", + className: "SystemOverrides", + }, + }, + resourceUri: { + serializedName: "resourceUri", + readOnly: true, + type: { + name: "String", + }, + }, + termDuration: { + serializedName: "termDuration", + type: { + name: "String", + }, + }, + termStartDate: { + serializedName: "termStartDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + termEndDate: { + serializedName: "termEndDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + provisioningTenantId: { + serializedName: "provisioningTenantId", + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String", + }, + }, + operationStatus: { + serializedName: "operationStatus", + readOnly: true, + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String", + }, + }, + suspensionReasons: { + serializedName: "suspensionReasons", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + suspensionReasonDetails: { + serializedName: "suspensionReasonDetails", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingSubscriptionStatusDetails", + }, + }, + }, + }, + enrollmentAccountStartDate: { + serializedName: + "enrollmentAccountSubscriptionDetails.enrollmentAccountStartDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + subscriptionEnrollmentAccountStatus: { + serializedName: + "enrollmentAccountSubscriptionDetails.subscriptionEnrollmentAccountStatus", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Beneficiary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Beneficiary", + modelProperties: { + tenantId: { + serializedName: "tenantId", + type: { + name: "String", + }, + }, + objectId: { + serializedName: "objectId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const NextBillingCycleDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NextBillingCycleDetails", + modelProperties: { + billingFrequency: { + serializedName: "billingFrequency", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Reseller: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Reseller", + modelProperties: { + resellerId: { + serializedName: "resellerId", + readOnly: true, + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RenewalTermDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RenewalTermDetails", + modelProperties: { + billingFrequency: { + serializedName: "billingFrequency", + readOnly: true, + type: { + name: "String", + }, + }, + productId: { + serializedName: "productId", + readOnly: true, + type: { + name: "String", + }, + }, + productTypeId: { + serializedName: "productTypeId", + readOnly: true, + type: { + name: "String", + }, + }, + skuId: { + serializedName: "skuId", + readOnly: true, + type: { + name: "String", + }, + }, + termDuration: { + serializedName: "termDuration", + readOnly: true, + type: { + name: "String", + }, + }, + quantity: { + serializedName: "quantity", + type: { + name: "Number", + }, + }, + termEndDate: { + serializedName: "termEndDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const SystemOverrides: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemOverrides", + modelProperties: { + cancellation: { + serializedName: "cancellation", + readOnly: true, + type: { + name: "String", + }, + }, + cancellationAllowedEndDate: { + serializedName: "cancellationAllowedEndDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const BillingSubscriptionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingSubscriptionListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + totalCount: { + serializedName: "totalCount", + readOnly: true, + type: { + name: "Number", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingSubscription", + }, + }, + }, + }, + }, + }, +}; + +export const BillingSubscriptionAliasListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingSubscriptionAliasListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingSubscriptionAlias", + }, + }, + }, + }, + }, + }, +}; + +export const CancelSubscriptionRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CancelSubscriptionRequest", + modelProperties: { + cancellationReason: { + serializedName: "cancellationReason", + required: true, + type: { + name: "String", + }, + }, + customerId: { + serializedName: "customerId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingSubscriptionMergeRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingSubscriptionMergeRequest", + modelProperties: { + targetBillingSubscriptionName: { + serializedName: "targetBillingSubscriptionName", + type: { + name: "String", + }, + }, + quantity: { + serializedName: "quantity", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const MoveBillingSubscriptionRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MoveBillingSubscriptionRequest", + modelProperties: { + destinationInvoiceSectionId: { + serializedName: "destinationInvoiceSectionId", + type: { + name: "String", + }, + }, + destinationEnrollmentAccountId: { + serializedName: "destinationEnrollmentAccountId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingSubscriptionSplitRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingSubscriptionSplitRequest", + modelProperties: { + targetProductTypeId: { + serializedName: "targetProductTypeId", + type: { + name: "String", + }, + }, + targetSkuId: { + serializedName: "targetSkuId", + type: { + name: "String", + }, + }, + quantity: { + serializedName: "quantity", + type: { + name: "Number", + }, + }, + termDuration: { + serializedName: "termDuration", + type: { + name: "String", + }, + }, + billingFrequency: { + serializedName: "billingFrequency", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const MoveBillingSubscriptionEligibilityResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "MoveBillingSubscriptionEligibilityResult", + modelProperties: { + isMoveEligible: { + serializedName: "isMoveEligible", + readOnly: true, + type: { + name: "Boolean", + }, + }, + errorDetails: { + serializedName: "errorDetails", + type: { + name: "Composite", + className: "MoveBillingSubscriptionErrorDetails", + }, + }, + }, + }, + }; + +export const MoveBillingSubscriptionErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MoveBillingSubscriptionErrorDetails", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + details: { + serializedName: "details", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CustomerProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomerProperties", + modelProperties: { + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "billingProfileId", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + systemId: { + serializedName: "systemId", + readOnly: true, + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String", + }, + }, + enabledAzurePlans: { + serializedName: "enabledAzurePlans", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AzurePlan", + }, + }, + }, + }, + resellers: { + serializedName: "resellers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Reseller", + }, + }, + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const CustomerListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomerListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Customer", + }, + }, + }, + }, + }, + }, +}; + +export const DepartmentProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DepartmentProperties", + modelProperties: { + costCenter: { + serializedName: "costCenter", + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + type: { + name: "String", + }, + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DepartmentListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DepartmentListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Department", + }, + }, + }, + }, + }, + }, +}; + +export const EnrollmentAccountProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnrollmentAccountProperties", + modelProperties: { + costCenter: { + serializedName: "costCenter", + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + type: { + name: "String", + }, + }, + departmentDisplayName: { + serializedName: "departmentDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + departmentId: { + serializedName: "departmentId", + readOnly: true, + type: { + name: "String", + }, + }, + isDevTestEnabled: { + serializedName: "isDevTestEnabled", + type: { + name: "Boolean", + }, + }, + accountOwner: { + serializedName: "accountOwner", + readOnly: true, + type: { + name: "String", + }, + }, + authType: { + serializedName: "authType", + readOnly: true, + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String", + }, + }, + startDate: { + serializedName: "startDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + endDate: { + serializedName: "endDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const EnrollmentAccountListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnrollmentAccountListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnrollmentAccount", + }, + }, + }, + }, + }, + }, +}; + +export const InvoiceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoiceListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Invoice", + }, + }, + }, + }, + }, + }, +}; + +export const InvoiceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoiceProperties", + modelProperties: { + amountDue: { + serializedName: "amountDue", + type: { + name: "Composite", + className: "InvoicePropertiesAmountDue", + }, + }, + azurePrepaymentApplied: { + serializedName: "azurePrepaymentApplied", + type: { + name: "Composite", + className: "InvoicePropertiesAzurePrepaymentApplied", + }, + }, + billedAmount: { + serializedName: "billedAmount", + type: { + name: "Composite", + className: "InvoicePropertiesBilledAmount", + }, + }, + billedDocumentId: { + serializedName: "billedDocumentId", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "billingProfileId", + readOnly: true, + type: { + name: "String", + }, + }, + creditAmount: { + serializedName: "creditAmount", + type: { + name: "Composite", + className: "InvoicePropertiesCreditAmount", + }, + }, + creditForDocumentId: { + serializedName: "creditForDocumentId", + readOnly: true, + type: { + name: "String", + }, + }, + documents: { + serializedName: "documents", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InvoiceDocument", + }, + }, + }, + }, + documentType: { + serializedName: "documentType", + readOnly: true, + type: { + name: "String", + }, + }, + dueDate: { + serializedName: "dueDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + failedPayments: { + serializedName: "failedPayments", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FailedPayment", + }, + }, + }, + }, + freeAzureCreditApplied: { + serializedName: "freeAzureCreditApplied", + type: { + name: "Composite", + className: "InvoicePropertiesFreeAzureCreditApplied", + }, + }, + invoiceDate: { + serializedName: "invoiceDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + invoicePeriodEndDate: { + serializedName: "invoicePeriodEndDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + invoicePeriodStartDate: { + serializedName: "invoicePeriodStartDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + invoiceType: { + serializedName: "invoiceType", + readOnly: true, + type: { + name: "String", + }, + }, + isMonthlyInvoice: { + serializedName: "isMonthlyInvoice", + readOnly: true, + type: { + name: "Boolean", + }, + }, + payments: { + serializedName: "payments", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Payment", + }, + }, + }, + }, + purchaseOrderNumber: { + serializedName: "purchaseOrderNumber", + readOnly: true, + type: { + name: "String", + }, + }, + rebillDetails: { + serializedName: "rebillDetails", + type: { + name: "Composite", + className: "InvoicePropertiesRebillDetails", + }, + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String", + }, + }, + subscriptionDisplayName: { + serializedName: "subscriptionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "String", + }, + }, + specialTaxationType: { + serializedName: "specialTaxationType", + readOnly: true, + type: { + name: "String", + }, + }, + subTotal: { + serializedName: "subTotal", + type: { + name: "Composite", + className: "InvoicePropertiesSubTotal", + }, + }, + taxAmount: { + serializedName: "taxAmount", + type: { + name: "Composite", + className: "InvoicePropertiesTaxAmount", + }, + }, + totalAmount: { + serializedName: "totalAmount", + type: { + name: "Composite", + className: "InvoicePropertiesTotalAmount", + }, + }, + refundDetails: { + serializedName: "refundDetails", + type: { + name: "Composite", + className: "InvoicePropertiesRefundDetails", + }, + }, + }, + }, +}; + +export const InvoiceDocument: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoiceDocument", + modelProperties: { + documentNumbers: { + serializedName: "documentNumbers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + externalUrl: { + serializedName: "externalUrl", + readOnly: true, + type: { + name: "String", + }, + }, + kind: { + serializedName: "kind", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + url: { + serializedName: "url", + readOnly: true, + type: { + name: "String", + }, + }, + source: { + serializedName: "source", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const FailedPayment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FailedPayment", + modelProperties: { + date: { + serializedName: "date", + readOnly: true, + type: { + name: "DateTime", + }, + }, + failedPaymentReason: { + serializedName: "failedPaymentReason", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Payment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Payment", + modelProperties: { + amount: { + serializedName: "amount", + type: { + name: "Composite", + className: "PaymentAmount", + }, + }, + date: { + serializedName: "date", + readOnly: true, + type: { + name: "DateTime", + }, + }, + paymentMethodId: { + serializedName: "paymentMethodId", + readOnly: true, + type: { + name: "String", + }, + }, + paymentMethodFamily: { + serializedName: "paymentMethodFamily", + readOnly: true, + type: { + name: "String", + }, + }, + paymentMethodType: { + serializedName: "paymentMethodType", + readOnly: true, + type: { + name: "String", + }, + }, + paymentType: { + serializedName: "paymentType", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RebillDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RebillDetails", + modelProperties: { + invoiceDocumentId: { + serializedName: "invoiceDocumentId", + readOnly: true, + type: { + name: "String", + }, + }, + creditNoteDocumentId: { + serializedName: "creditNoteDocumentId", + readOnly: true, + type: { + name: "String", + }, + }, + rebillDetails: { + serializedName: "rebillDetails", + type: { + name: "Composite", + className: "RebillDetails", + }, + }, + }, + }, +}; + +export const RefundDetailsSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundDetailsSummary", + modelProperties: { + requestedOn: { + serializedName: "requestedOn", + readOnly: true, + type: { + name: "DateTime", + }, + }, + approvedOn: { + serializedName: "approvedOn", + readOnly: true, + type: { + name: "DateTime", + }, + }, + completedOn: { + serializedName: "completedOn", + readOnly: true, + type: { + name: "DateTime", + }, + }, + amountRequested: { + serializedName: "amountRequested", + type: { + name: "Composite", + className: "RefundDetailsSummaryAmountRequested", + }, + }, + amountRefunded: { + serializedName: "amountRefunded", + type: { + name: "Composite", + className: "RefundDetailsSummaryAmountRefunded", + }, + }, + rebillInvoiceId: { + serializedName: "rebillInvoiceId", + readOnly: true, + type: { + name: "String", + }, + }, + transactionCount: { + serializedName: "transactionCount", + readOnly: true, + type: { + name: "Number", + }, + }, + refundStatus: { + serializedName: "refundStatus", + readOnly: true, + type: { + name: "String", + }, + }, + refundOperationId: { + serializedName: "refundOperationId", + readOnly: true, + type: { + name: "String", + }, + }, + refundReason: { + serializedName: "refundReason", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DocumentDownloadRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DocumentDownloadRequest", + modelProperties: { + documentName: { + serializedName: "documentName", + type: { + name: "String", + }, + }, + invoiceName: { + serializedName: "invoiceName", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DocumentDownloadResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DocumentDownloadResult", + modelProperties: { + expiryTime: { + serializedName: "expiryTime", + readOnly: true, + type: { + name: "String", + }, + }, + url: { + serializedName: "url", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DeleteInvoiceSectionEligibilityResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DeleteInvoiceSectionEligibilityResult", + modelProperties: { + eligibilityStatus: { + serializedName: "eligibilityStatus", + type: { + name: "String", + }, + }, + eligibilityDetails: { + serializedName: "eligibilityDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeleteInvoiceSectionEligibilityDetail", + }, + }, + }, + }, + }, + }, + }; + +export const DeleteInvoiceSectionEligibilityDetail: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DeleteInvoiceSectionEligibilityDetail", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const InvoiceSectionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoiceSectionProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + type: { + name: "String", + }, + }, + state: { + serializedName: "state", + type: { + name: "String", + }, + }, + reasonCode: { + serializedName: "reasonCode", + type: { + name: "String", + }, + }, + systemId: { + serializedName: "systemId", + readOnly: true, + type: { + name: "String", + }, + }, + targetCloud: { + serializedName: "targetCloud", + type: { + name: "String", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const InvoiceSectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoiceSectionListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InvoiceSection", + }, + }, + }, + }, + }, + }, +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation", + }, + }, + }, + }, + }, + }, +}; + +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: { + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String", + }, + }, + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String", + }, + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PaymentMethodLinksListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentMethodLinksListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentMethodLink", + }, + }, + }, + }, + }, + }, +}; + +export const PaymentMethodLogo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentMethodLogo", + modelProperties: { + mimeType: { + serializedName: "mimeType", + readOnly: true, + type: { + name: "String", + }, + }, + url: { + serializedName: "url", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PaymentMethodProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentMethodProperties", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + accountHolderName: { + serializedName: "accountHolderName", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + expiration: { + serializedName: "expiration", + readOnly: true, + type: { + name: "String", + }, + }, + family: { + serializedName: "family", + type: { + name: "String", + }, + }, + lastFourDigits: { + serializedName: "lastFourDigits", + readOnly: true, + type: { + name: "String", + }, + }, + logos: { + serializedName: "logos", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentMethodLogo", + }, + }, + }, + }, + paymentMethodType: { + serializedName: "paymentMethodType", + readOnly: true, + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PaymentMethodsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentMethodsListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentMethod", + }, + }, + }, + }, + }, + }, +}; + +export const CustomerPolicyProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomerPolicyProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + viewCharges: { + serializedName: "viewCharges", + required: true, + type: { + name: "String", + }, + }, + policies: { + serializedName: "policies", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicySummary", + }, + }, + }, + }, + }, + }, +}; + +export const PolicySummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicySummary", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "String", + }, + }, + policyType: { + serializedName: "policyType", + type: { + name: "String", + }, + }, + scope: { + serializedName: "scope", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingProfilePolicyProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingProfilePolicyProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + enterpriseAgreementPolicies: { + serializedName: "enterpriseAgreementPolicies", + type: { + name: "Composite", + className: + "BillingProfilePolicyPropertiesEnterpriseAgreementPolicies", + }, + }, + invoiceSectionLabelManagement: { + serializedName: "invoiceSectionLabelManagement", + type: { + name: "String", + }, + }, + marketplacePurchases: { + serializedName: "marketplacePurchases", + type: { + name: "String", + }, + }, + reservationPurchases: { + serializedName: "reservationPurchases", + type: { + name: "String", + }, + }, + savingsPlanPurchases: { + serializedName: "savingsPlanPurchases", + type: { + name: "String", + }, + }, + viewCharges: { + serializedName: "viewCharges", + type: { + name: "String", + }, + }, + policies: { + serializedName: "policies", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicySummary", + }, + }, + }, + }, + }, + }, +}; + +export const EnterpriseAgreementPolicies: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnterpriseAgreementPolicies", + modelProperties: { + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String", + }, + }, + accountOwnerViewCharges: { + serializedName: "accountOwnerViewCharges", + type: { + name: "String", + }, + }, + departmentAdminViewCharges: { + serializedName: "departmentAdminViewCharges", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingAccountPolicyProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingAccountPolicyProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + enterpriseAgreementPolicies: { + serializedName: "enterpriseAgreementPolicies", + type: { + name: "Composite", + className: + "BillingAccountPolicyPropertiesEnterpriseAgreementPolicies", + }, + }, + marketplacePurchases: { + serializedName: "marketplacePurchases", + type: { + name: "String", + }, + }, + reservationPurchases: { + serializedName: "reservationPurchases", + type: { + name: "String", + }, + }, + savingsPlanPurchases: { + serializedName: "savingsPlanPurchases", + type: { + name: "String", + }, + }, + policies: { + serializedName: "policies", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicySummary", + }, + }, + }, + }, + }, + }, +}; + +export const SubscriptionPolicyProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionPolicyProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + policies: { + serializedName: "policies", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicySummary", + }, + }, + }, + }, + }, + }, +}; + +export const ProductListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProductListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Product", + }, + }, + }, + }, + }, + }, +}; + +export const ProductProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProductProperties", + modelProperties: { + autoRenew: { + serializedName: "autoRenew", + type: { + name: "String", + }, + }, + availabilityId: { + serializedName: "availabilityId", + readOnly: true, + type: { + name: "String", + }, + }, + billingFrequency: { + serializedName: "billingFrequency", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "billingProfileId", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + customerId: { + serializedName: "customerId", + readOnly: true, + type: { + name: "String", + }, + }, + customerDisplayName: { + serializedName: "customerDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + readOnly: true, + type: { + name: "String", + }, + }, + endDate: { + serializedName: "endDate", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionId: { + serializedName: "invoiceSectionId", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionDisplayName: { + serializedName: "invoiceSectionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + lastCharge: { + serializedName: "lastCharge", + type: { + name: "Composite", + className: "ProductPropertiesLastCharge", + }, + }, + lastChargeDate: { + serializedName: "lastChargeDate", + readOnly: true, + type: { + name: "String", + }, + }, + productType: { + serializedName: "productType", + readOnly: true, + type: { + name: "String", + }, + }, + productTypeId: { + serializedName: "productTypeId", + readOnly: true, + type: { + name: "String", + }, + }, + skuId: { + serializedName: "skuId", + readOnly: true, + type: { + name: "String", + }, + }, + skuDescription: { + serializedName: "skuDescription", + readOnly: true, + type: { + name: "String", + }, + }, + purchaseDate: { + serializedName: "purchaseDate", + readOnly: true, + type: { + name: "String", + }, + }, + quantity: { + serializedName: "quantity", + readOnly: true, + type: { + name: "Number", + }, + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String", + }, + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String", + }, + }, + reseller: { + serializedName: "reseller", + type: { + name: "Composite", + className: "ProductPropertiesReseller", + }, + }, + }, + }, +}; + +export const MoveProductRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MoveProductRequest", + modelProperties: { + destinationInvoiceSectionId: { + constraints: { + MinLength: 1, + }, + serializedName: "destinationInvoiceSectionId", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const MoveProductEligibilityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MoveProductEligibilityResult", + modelProperties: { + isMoveEligible: { + serializedName: "isMoveEligible", + type: { + name: "Boolean", + }, + }, + errorDetails: { + serializedName: "errorDetails", + type: { + name: "Composite", + className: "MoveProductEligibilityResultErrorDetails", + }, + }, + }, + }, +}; + +export const MoveProductErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MoveProductErrorDetails", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ReservationsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationsListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + summary: { + serializedName: "summary", + type: { + name: "Composite", + className: "ReservationSummary", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Reservation", + }, + }, + }, + }, + }, + }, +}; + +export const ReservationSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationSummary", + modelProperties: { + cancelledCount: { + serializedName: "cancelledCount", + readOnly: true, + type: { + name: "Number", + }, + }, + expiredCount: { + serializedName: "expiredCount", + readOnly: true, + type: { + name: "Number", + }, + }, + expiringCount: { + serializedName: "expiringCount", + readOnly: true, + type: { + name: "Number", + }, + }, + failedCount: { + serializedName: "failedCount", + readOnly: true, + type: { + name: "Number", + }, + }, + pendingCount: { + serializedName: "pendingCount", + readOnly: true, + type: { + name: "Number", + }, + }, + succeededCount: { + serializedName: "succeededCount", + readOnly: true, + type: { + name: "Number", + }, + }, + noBenefitCount: { + serializedName: "noBenefitCount", + readOnly: true, + type: { + name: "Number", + }, + }, + warningCount: { + serializedName: "warningCount", + readOnly: true, + type: { + name: "Number", + }, + }, + processingCount: { + serializedName: "processingCount", + readOnly: true, + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ReservationExtendedStatusInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationExtendedStatusInfo", + modelProperties: { + statusCode: { + serializedName: "statusCode", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ExtendedStatusDefinitionProperties", + }, + }, + }, + }, +}; + +export const ExtendedStatusDefinitionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtendedStatusDefinitionProperties", + modelProperties: { + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ReservationSplitProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationSplitProperties", + modelProperties: { + splitDestinations: { + serializedName: "splitDestinations", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + splitSource: { + serializedName: "splitSource", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ReservationMergeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationMergeProperties", + modelProperties: { + mergeDestination: { + serializedName: "mergeDestination", + type: { + name: "String", + }, + }, + mergeSources: { + serializedName: "mergeSources", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const ReservationSwapProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationSwapProperties", + modelProperties: { + swapSource: { + serializedName: "swapSource", + type: { + name: "String", + }, + }, + swapDestination: { + serializedName: "swapDestination", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ReservationAppliedScopeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationAppliedScopeProperties", + modelProperties: { + tenantId: { + serializedName: "tenantId", + type: { + name: "String", + }, + }, + managementGroupId: { + serializedName: "managementGroupId", + type: { + name: "String", + }, + }, + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String", + }, + }, + resourceGroupId: { + serializedName: "resourceGroupId", + type: { + name: "String", + }, + }, + displayName: { + serializedName: "displayName", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RenewPropertiesResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RenewPropertiesResponse", + modelProperties: { + purchaseProperties: { + serializedName: "purchaseProperties", + type: { + name: "Composite", + className: "ReservationPurchaseRequest", + }, + }, + pricingCurrencyTotal: { + serializedName: "pricingCurrencyTotal", + type: { + name: "Composite", + className: "Price", + }, + }, + billingCurrencyTotal: { + serializedName: "billingCurrencyTotal", + type: { + name: "Composite", + className: "Price", + }, + }, + }, + }, +}; + +export const ReservationPurchaseRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationPurchaseRequest", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "SkuName", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + reservedResourceType: { + serializedName: "properties.reservedResourceType", + readOnly: true, + type: { + name: "String", + }, + }, + billingScopeId: { + serializedName: "properties.billingScopeId", + readOnly: true, + type: { + name: "String", + }, + }, + term: { + serializedName: "properties.term", + readOnly: true, + type: { + name: "String", + }, + }, + billingPlan: { + serializedName: "properties.billingPlan", + type: { + name: "String", + }, + }, + quantity: { + serializedName: "properties.quantity", + type: { + name: "Number", + }, + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + appliedScopeType: { + serializedName: "properties.appliedScopeType", + type: { + name: "String", + }, + }, + appliedScopes: { + serializedName: "properties.appliedScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + appliedScopeProperties: { + serializedName: "properties.appliedScopeProperties", + type: { + name: "Composite", + className: "ReservationAppliedScopeProperties", + }, + }, + renew: { + defaultValue: false, + serializedName: "properties.renew", + type: { + name: "Boolean", + }, + }, + instanceFlexibilityPropertiesInstanceFlexibility: { + serializedName: "properties.instanceFlexibility", + type: { + name: "String", + }, + }, + reviewDateTime: { + serializedName: "properties.reviewDateTime", + type: { + name: "DateTime", + }, + }, + instanceFlexibilityPropertiesReservedResourcePropertiesInstanceFlexibility: + { + serializedName: + "properties.reservedResourceProperties.instanceFlexibility", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SkuName: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuName", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ReservationUtilizationAggregates: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationUtilizationAggregates", + modelProperties: { + grain: { + serializedName: "grain", + readOnly: true, + type: { + name: "Number", + }, + }, + grainUnit: { + serializedName: "grainUnit", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Number", + }, + }, + valueUnit: { + serializedName: "valueUnit", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ReservationSkuProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationSkuProperty", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Patch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Patch", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ReservationSkuProperty", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + appliedScopeType: { + serializedName: "properties.appliedScopeType", + type: { + name: "String", + }, + }, + appliedScopeProperties: { + serializedName: "properties.appliedScopeProperties", + type: { + name: "Composite", + className: "ReservationAppliedScopeProperties", + }, + }, + instanceFlexibility: { + serializedName: "properties.instanceFlexibility", + type: { + name: "String", + }, + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + renew: { + defaultValue: false, + serializedName: "properties.renew", + type: { + name: "Boolean", + }, + }, + reviewDateTime: { + serializedName: "properties.reviewDateTime", + type: { + name: "DateTime", + }, + }, + purchaseProperties: { + serializedName: "properties.renewProperties.purchaseProperties", + type: { + name: "Composite", + className: "ReservationPurchaseRequest", + }, + }, + }, + }, +}; + +export const ReservationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Reservation", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ReservationOrderBillingPlanInformation: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ReservationOrderBillingPlanInformation", + modelProperties: { + pricingCurrencyTotal: { + serializedName: "pricingCurrencyTotal", + type: { + name: "Composite", + className: "Price", + }, + }, + startDate: { + serializedName: "startDate", + type: { + name: "Date", + }, + }, + nextPaymentDueDate: { + serializedName: "nextPaymentDueDate", + type: { + name: "Date", + }, + }, + transactions: { + serializedName: "transactions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationPaymentDetail", + }, + }, + }, + }, + }, + }, + }; + +export const ReservationPaymentDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationPaymentDetail", + modelProperties: { + dueDate: { + serializedName: "dueDate", + type: { + name: "Date", + }, + }, + paymentDate: { + serializedName: "paymentDate", + type: { + name: "Date", + }, + }, + pricingCurrencyTotal: { + serializedName: "pricingCurrencyTotal", + type: { + name: "Composite", + className: "Price", + }, + }, + billingCurrencyTotal: { + serializedName: "billingCurrencyTotal", + type: { + name: "Composite", + className: "Price", + }, + }, + billingAccount: { + serializedName: "billingAccount", + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + extendedStatusInfo: { + serializedName: "extendedStatusInfo", + type: { + name: "Composite", + className: "ReservationExtendedStatusInfo", + }, + }, + }, + }, +}; + +export const ReservationOrderList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationOrderList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationOrder", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TransactionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransactionListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Transaction", + }, + }, + }, + }, + }, + }, +}; + +export const TransactionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransactionProperties", + modelProperties: { + azureCreditApplied: { + serializedName: "azureCreditApplied", + type: { + name: "Composite", + className: "TransactionPropertiesAzureCreditApplied", + }, + }, + azurePlan: { + serializedName: "azurePlan", + type: { + name: "String", + }, + }, + billingCurrency: { + serializedName: "billingCurrency", + type: { + name: "String", + }, + }, + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", + type: { + name: "any", + }, + }, + billingProfileId: { + serializedName: "billingProfileId", + type: { + name: "String", + }, + }, + consumptionCommitmentDecremented: { + serializedName: "consumptionCommitmentDecremented", + type: { + name: "Composite", + className: "TransactionPropertiesConsumptionCommitmentDecremented", + }, + }, + customerDisplayName: { + serializedName: "customerDisplayName", + type: { + name: "String", + }, + }, + customerId: { + serializedName: "customerId", + type: { + name: "String", + }, + }, + creditType: { + serializedName: "creditType", + type: { + name: "String", + }, + }, + date: { + serializedName: "date", + type: { + name: "DateTime", + }, + }, + discount: { + serializedName: "discount", + type: { + name: "Number", + }, + }, + effectivePrice: { + serializedName: "effectivePrice", + type: { + name: "Composite", + className: "TransactionPropertiesEffectivePrice", + }, + }, + exchangeRate: { + serializedName: "exchangeRate", + type: { + name: "Number", + }, + }, + invoice: { + serializedName: "invoice", + type: { + name: "String", + }, + }, + invoiceId: { + serializedName: "invoiceId", + type: { + name: "String", + }, + }, + invoiceSectionDisplayName: { + serializedName: "invoiceSectionDisplayName", + type: { + name: "String", + }, + }, + invoiceSectionId: { + serializedName: "invoiceSectionId", + type: { + name: "String", + }, + }, + isThirdParty: { + serializedName: "isThirdParty", + type: { + name: "Boolean", + }, + }, + kind: { + serializedName: "kind", + type: { + name: "String", + }, + }, + marketPrice: { + serializedName: "marketPrice", + type: { + name: "Composite", + className: "TransactionPropertiesMarketPrice", + }, + }, + partNumber: { + serializedName: "partNumber", + type: { + name: "String", + }, + }, + pricingCurrency: { + serializedName: "pricingCurrency", + type: { + name: "String", + }, + }, + productDescription: { + serializedName: "productDescription", + type: { + name: "String", + }, + }, + productFamily: { + serializedName: "productFamily", + type: { + name: "String", + }, + }, + productTypeId: { + serializedName: "productTypeId", + type: { + name: "String", + }, + }, + productType: { + serializedName: "productType", + type: { + name: "String", + }, + }, + quantity: { + serializedName: "quantity", + type: { + name: "Number", + }, + }, + reasonCode: { + serializedName: "reasonCode", + type: { + name: "String", + }, + }, + servicePeriodStartDate: { + serializedName: "servicePeriodStartDate", + type: { + name: "DateTime", + }, + }, + servicePeriodEndDate: { + serializedName: "servicePeriodEndDate", + type: { + name: "DateTime", + }, + }, + subTotal: { + serializedName: "subTotal", + type: { + name: "Composite", + className: "TransactionPropertiesSubTotal", + }, + }, + tax: { + serializedName: "tax", + type: { + name: "Composite", + className: "TransactionPropertiesTax", + }, + }, + transactionAmount: { + serializedName: "transactionAmount", + type: { + name: "Composite", + className: "TransactionPropertiesTransactionAmount", + }, + }, + transactionType: { + serializedName: "transactionType", + type: { + name: "String", + }, + }, + units: { + serializedName: "units", + type: { + name: "Number", + }, + }, + unitOfMeasure: { + serializedName: "unitOfMeasure", + type: { + name: "String", + }, + }, + unitType: { + serializedName: "unitType", + type: { + name: "String", + }, + }, + specialTaxationType: { + serializedName: "specialTaxationType", + type: { + name: "String", + }, + }, + refundTransactionDetails: { + serializedName: "refundTransactionDetails", + type: { + name: "Composite", + className: "TransactionPropertiesRefundTransactionDetails", + }, + }, + }, + }, +}; + +export const RefundTransactionDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundTransactionDetails", + modelProperties: { + amountRequested: { + serializedName: "amountRequested", + type: { + name: "Composite", + className: "RefundTransactionDetailsAmountRequested", + }, + }, + amountRefunded: { + serializedName: "amountRefunded", + type: { + name: "Composite", + className: "RefundTransactionDetailsAmountRefunded", + }, + }, + refundOperationId: { + serializedName: "refundOperationId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TransactionSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransactionSummary", + modelProperties: { + azureCreditApplied: { + serializedName: "azureCreditApplied", + readOnly: true, + type: { + name: "Number", + }, + }, + billingCurrency: { + serializedName: "billingCurrency", + readOnly: true, + type: { + name: "String", + }, + }, + consumptionCommitmentDecremented: { + serializedName: "consumptionCommitmentDecremented", + readOnly: true, + type: { + name: "Number", + }, + }, + subTotal: { + serializedName: "subTotal", + readOnly: true, + type: { + name: "Number", + }, + }, + tax: { + serializedName: "tax", + readOnly: true, + type: { + name: "Number", + }, + }, + total: { + serializedName: "total", + readOnly: true, + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DetailedTransferStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DetailedTransferStatus", + modelProperties: { + productType: { + serializedName: "productType", + readOnly: true, + type: { + name: "String", + }, + }, + productId: { + serializedName: "productId", + readOnly: true, + type: { + name: "String", + }, + }, + productName: { + serializedName: "productName", + readOnly: true, + type: { + name: "String", + }, + }, + skuDescription: { + serializedName: "skuDescription", + readOnly: true, + type: { + name: "String", + }, + }, + transferStatus: { + serializedName: "transferStatus", + readOnly: true, + type: { + name: "String", + }, + }, + errorDetails: { + serializedName: "errorDetails", + type: { + name: "Composite", + className: "TransferError", + }, + }, + }, + }, +}; + +export const TransferError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransferError", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const InitiateTransferRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InitiateTransferRequest", + modelProperties: { + recipientEmailId: { + serializedName: "properties.recipientEmailId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TransferDetailsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransferDetailsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TransferDetails", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PartnerInitiateTransferRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PartnerInitiateTransferRequest", + modelProperties: { + recipientEmailId: { + serializedName: "properties.recipientEmailId", + type: { + name: "String", + }, + }, + resellerId: { + serializedName: "properties.resellerId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PartnerTransferDetailsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PartnerTransferDetailsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PartnerTransferDetails", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AcceptTransferRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AcceptTransferRequest", + modelProperties: { + productDetails: { + serializedName: "properties.productDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProductDetails", + }, + }, + }, + }, + }, + }, +}; + +export const ProductDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProductDetails", + modelProperties: { + productType: { + serializedName: "productType", + type: { + name: "String", + }, + }, + productId: { + serializedName: "productId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ValidateTransferListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidateTransferListResponse", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ValidateTransferResponse", + }, + }, + }, + }, + }, + }, +}; + +export const ValidateTransferResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidateTransferResponse", + modelProperties: { + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String", + }, + }, + productId: { + serializedName: "properties.productId", + readOnly: true, + type: { + name: "String", + }, + }, + results: { + serializedName: "properties.results", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ValidationResultProperties", + }, + }, + }, + }, + }, + }, +}; + +export const ValidationResultProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidationResultProperties", + modelProperties: { + level: { + serializedName: "level", + readOnly: true, + type: { + name: "String", + }, + }, + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RecipientTransferDetailsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RecipientTransferDetailsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RecipientTransferDetails", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ExternalReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExternalReference", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + url: { + serializedName: "url", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TransferItemQueryParameter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransferItemQueryParameter", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const AvailableBalancePropertiesAmount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableBalancePropertiesAmount", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const PaymentOnAccountAmount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentOnAccountAmount", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const AvailableBalancePropertiesTotalPaymentsOnAccount: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "AvailableBalancePropertiesTotalPaymentsOnAccount", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, + }; + +export const InvoicePropertiesAmountDue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoicePropertiesAmountDue", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const InvoicePropertiesAzurePrepaymentApplied: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoicePropertiesAzurePrepaymentApplied", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, + }; + +export const InvoicePropertiesBilledAmount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoicePropertiesBilledAmount", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const InvoicePropertiesCreditAmount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoicePropertiesCreditAmount", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const InvoicePropertiesFreeAzureCreditApplied: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoicePropertiesFreeAzureCreditApplied", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, + }; + +export const PaymentAmount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentAmount", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const InvoicePropertiesSubTotal: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoicePropertiesSubTotal", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const InvoicePropertiesTaxAmount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoicePropertiesTaxAmount", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const InvoicePropertiesTotalAmount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoicePropertiesTotalAmount", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const RefundDetailsSummaryAmountRequested: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundDetailsSummaryAmountRequested", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const RefundDetailsSummaryAmountRefunded: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundDetailsSummaryAmountRefunded", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const ProductPropertiesLastCharge: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProductPropertiesLastCharge", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const TransactionPropertiesAzureCreditApplied: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "TransactionPropertiesAzureCreditApplied", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, + }; + +export const TransactionPropertiesConsumptionCommitmentDecremented: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "TransactionPropertiesConsumptionCommitmentDecremented", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, + }; + +export const TransactionPropertiesEffectivePrice: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransactionPropertiesEffectivePrice", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const TransactionPropertiesMarketPrice: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransactionPropertiesMarketPrice", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const TransactionPropertiesSubTotal: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransactionPropertiesSubTotal", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const TransactionPropertiesTax: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransactionPropertiesTax", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, +}; + +export const TransactionPropertiesTransactionAmount: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "TransactionPropertiesTransactionAmount", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, + }; + +export const RefundTransactionDetailsAmountRequested: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RefundTransactionDetailsAmountRequested", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, + }; + +export const RefundTransactionDetailsAmountRefunded: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RefundTransactionDetailsAmountRefunded", + modelProperties: { + ...Amount.type.modelProperties, + }, + }, + }; + +export const BillingProfilePropertiesCurrentPaymentTerm: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingProfilePropertiesCurrentPaymentTerm", + modelProperties: { + ...PaymentTerm.type.modelProperties, + }, + }, + }; + +export const BillingAccountPropertiesEnrollmentDetails: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingAccountPropertiesEnrollmentDetails", + modelProperties: { + ...EnrollmentDetails.type.modelProperties, + }, + }, + }; + +export const EnrollmentDetailsIndirectRelationshipInfo: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "EnrollmentDetailsIndirectRelationshipInfo", + modelProperties: { + ...IndirectRelationshipInfo.type.modelProperties, + }, + }, + }; + +export const BillingProfilePropertiesIndirectRelationshipInfo: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingProfilePropertiesIndirectRelationshipInfo", + modelProperties: { + ...IndirectRelationshipInfo.type.modelProperties, + }, + }, + }; + +export const BillingAccountPropertiesSoldTo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingAccountPropertiesSoldTo", + modelProperties: { + ...AddressDetails.type.modelProperties, + }, + }, +}; + +export const BillingProfilePropertiesBillTo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingProfilePropertiesBillTo", + modelProperties: { + ...AddressDetails.type.modelProperties, + }, + }, +}; + +export const BillingProfilePropertiesShipTo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingProfilePropertiesShipTo", + modelProperties: { + ...AddressDetails.type.modelProperties, + }, + }, +}; + +export const BillingProfilePropertiesSoldTo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingProfilePropertiesSoldTo", + modelProperties: { + ...AddressDetails.type.modelProperties, + }, + }, +}; + +export const BillingPropertyPropertiesSubscriptionServiceUsageAddress: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingPropertyPropertiesSubscriptionServiceUsageAddress", + modelProperties: { + ...AddressDetails.type.modelProperties, + }, + }, + }; + +export const BillingAccountPropertiesRegistrationNumber: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingAccountPropertiesRegistrationNumber", + modelProperties: { + ...RegistrationNumber.type.modelProperties, + }, + }, + }; + +export const BillingPropertyPropertiesEnrollmentDetails: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingPropertyPropertiesEnrollmentDetails", + modelProperties: { + ...SubscriptionEnrollmentDetails.type.modelProperties, + }, + }, + }; + +export const BillingRequestPropertiesReviewedBy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRequestPropertiesReviewedBy", + modelProperties: { + ...Principal.type.modelProperties, + }, + }, +}; + +export const BillingRequestPropertiesCreatedBy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRequestPropertiesCreatedBy", + modelProperties: { + ...Principal.type.modelProperties, + }, + }, +}; + +export const BillingRequestPropertiesLastUpdatedBy: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRequestPropertiesLastUpdatedBy", + modelProperties: { + ...Principal.type.modelProperties, + }, + }, + }; + +export const Commitment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Commitment", + modelProperties: { + ...Price.type.modelProperties, + grain: { + serializedName: "grain", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingSubscriptionAliasProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingSubscriptionAliasProperties", + modelProperties: { + ...BillingSubscriptionProperties.type.modelProperties, + billingSubscriptionId: { + serializedName: "billingSubscriptionId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ProductPropertiesReseller: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProductPropertiesReseller", + modelProperties: { + ...Reseller.type.modelProperties, + }, + }, +}; + +export const InvoicePropertiesRebillDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoicePropertiesRebillDetails", + modelProperties: { + ...RebillDetails.type.modelProperties, + }, + }, +}; + +export const InvoicePropertiesRefundDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoicePropertiesRefundDetails", + modelProperties: { + ...RefundDetailsSummary.type.modelProperties, + }, + }, +}; + +export const BillingProfilePolicyPropertiesEnterpriseAgreementPolicies: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingProfilePolicyPropertiesEnterpriseAgreementPolicies", + modelProperties: { + ...EnterpriseAgreementPolicies.type.modelProperties, + }, + }, + }; + +export const BillingAccountPolicyPropertiesEnterpriseAgreementPolicies: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingAccountPolicyPropertiesEnterpriseAgreementPolicies", + modelProperties: { + ...EnterpriseAgreementPolicies.type.modelProperties, + }, + }, + }; + +export const MoveProductEligibilityResultErrorDetails: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "MoveProductEligibilityResultErrorDetails", + modelProperties: { + ...MoveProductErrorDetails.type.modelProperties, + }, + }, + }; + +export const TransactionPropertiesRefundTransactionDetails: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "TransactionPropertiesRefundTransactionDetails", + modelProperties: { + ...RefundTransactionDetails.type.modelProperties, + }, + }, + }; + +export const ProxyResourceWithTags: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResourceWithTags", + modelProperties: { + ...ProxyResource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const Reservation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Reservation", + modelProperties: { + ...ProxyResource.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + etag: { + serializedName: "etag", + type: { + name: "Number", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ReservationSkuProperty", + }, + }, + reservedResourceType: { + serializedName: "properties.reservedResourceType", + readOnly: true, + type: { + name: "String", + }, + }, + instanceFlexibility: { + serializedName: "properties.instanceFlexibility", + type: { + name: "String", + }, + }, + displayName: { + serializedName: "properties.displayName", + readOnly: true, + type: { + name: "String", + }, + }, + appliedScopes: { + serializedName: "properties.appliedScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + appliedScopeType: { + serializedName: "properties.appliedScopeType", + readOnly: true, + type: { + name: "String", + }, + }, + archived: { + serializedName: "properties.archived", + type: { + name: "Boolean", + }, + }, + capabilities: { + serializedName: "properties.capabilities", + type: { + name: "String", + }, + }, + quantity: { + serializedName: "properties.quantity", + readOnly: true, + type: { + name: "Number", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + effectiveDateTime: { + serializedName: "properties.effectiveDateTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + benefitStartTime: { + serializedName: "properties.benefitStartTime", + type: { + name: "DateTime", + }, + }, + lastUpdatedDateTime: { + serializedName: "properties.lastUpdatedDateTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + expiryDate: { + serializedName: "properties.expiryDate", + readOnly: true, + type: { + name: "String", + }, + }, + expiryDateTime: { + serializedName: "properties.expiryDateTime", + type: { + name: "DateTime", + }, + }, + reviewDateTime: { + serializedName: "properties.reviewDateTime", + type: { + name: "DateTime", + }, + }, + skuDescription: { + serializedName: "properties.skuDescription", + readOnly: true, + type: { + name: "String", + }, + }, + extendedStatusInfo: { + serializedName: "properties.extendedStatusInfo", + type: { + name: "Composite", + className: "ReservationExtendedStatusInfo", + }, + }, + billingPlan: { + serializedName: "properties.billingPlan", + type: { + name: "String", + }, + }, + displayProvisioningState: { + serializedName: "properties.displayProvisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + provisioningSubState: { + serializedName: "properties.provisioningSubState", + readOnly: true, + type: { + name: "String", + }, + }, + purchaseDate: { + serializedName: "properties.purchaseDate", + type: { + name: "Date", + }, + }, + purchaseDateTime: { + serializedName: "properties.purchaseDateTime", + type: { + name: "DateTime", + }, + }, + splitProperties: { + serializedName: "properties.splitProperties", + type: { + name: "Composite", + className: "ReservationSplitProperties", + }, + }, + mergeProperties: { + serializedName: "properties.mergeProperties", + type: { + name: "Composite", + className: "ReservationMergeProperties", + }, + }, + swapProperties: { + serializedName: "properties.swapProperties", + type: { + name: "Composite", + className: "ReservationSwapProperties", + }, + }, + appliedScopeProperties: { + serializedName: "properties.appliedScopeProperties", + type: { + name: "Composite", + className: "ReservationAppliedScopeProperties", + }, + }, + billingScopeId: { + serializedName: "properties.billingScopeId", + readOnly: true, + type: { + name: "String", + }, + }, + renew: { + serializedName: "properties.renew", + readOnly: true, + type: { + name: "Boolean", + }, + }, + renewSource: { + serializedName: "properties.renewSource", + readOnly: true, + type: { + name: "String", + }, + }, + renewDestination: { + serializedName: "properties.renewDestination", + type: { + name: "String", + }, + }, + renewProperties: { + serializedName: "properties.renewProperties", + type: { + name: "Composite", + className: "RenewPropertiesResponse", + }, + }, + term: { + serializedName: "properties.term", + readOnly: true, + type: { + name: "String", + }, + }, + userFriendlyAppliedScopeType: { + serializedName: "properties.userFriendlyAppliedScopeType", + readOnly: true, + type: { + name: "String", + }, + }, + userFriendlyRenewState: { + serializedName: "properties.userFriendlyRenewState", + readOnly: true, + type: { + name: "String", + }, + }, + productCode: { + serializedName: "properties.productCode", + type: { + name: "String", + }, + }, + trend: { + serializedName: "properties.utilization.trend", + readOnly: true, + type: { + name: "String", + }, + }, + aggregates: { + serializedName: "properties.utilization.aggregates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ReservationUtilizationAggregates", + }, + }, + }, + }, + }, + }, +}; + +export const ReservationOrder: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationOrder", + modelProperties: { + ...ProxyResource.type.modelProperties, + etag: { + serializedName: "etag", + type: { + name: "Number", + }, + }, + tags: { + serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + enrollmentId: { + serializedName: "properties.enrollmentId", + type: { + name: "String", + }, + }, + customerId: { + serializedName: "properties.customerId", + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "properties.billingProfileId", + type: { + name: "String", + }, + }, + billingAccountId: { + serializedName: "properties.billingAccountId", + type: { + name: "String", + }, + }, + requestDateTime: { + serializedName: "properties.requestDateTime", + type: { + name: "DateTime", + }, + }, + createdDateTime: { + serializedName: "properties.createdDateTime", + type: { + name: "DateTime", + }, + }, + expiryDate: { + serializedName: "properties.expiryDate", + type: { + name: "Date", + }, + }, + expiryDateTime: { + serializedName: "properties.expiryDateTime", + type: { + name: "DateTime", + }, + }, + benefitStartTime: { + serializedName: "properties.benefitStartTime", + type: { + name: "DateTime", + }, + }, + originalQuantity: { + serializedName: "properties.originalQuantity", + type: { + name: "Number", + }, + }, + term: { + serializedName: "properties.term", + readOnly: true, + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + billingPlan: { + serializedName: "properties.billingPlan", + type: { + name: "String", + }, + }, + planInformation: { + serializedName: "properties.planInformation", + type: { + name: "Composite", + className: "ReservationOrderBillingPlanInformation", + }, + }, + reservations: { + serializedName: "properties.reservations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Reservation", + }, + }, + }, + }, + reviewDateTime: { + serializedName: "properties.reviewDateTime", + type: { + name: "DateTime", + }, + }, + extendedStatusInfo: { + serializedName: "properties.extendedStatusInfo", + type: { + name: "Composite", + className: "ReservationExtendedStatusInfo", + }, + }, + productCode: { + serializedName: "properties.productCode", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Agreement: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Agreement", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AgreementProperties", + }, + }, + }, + }, +}; + +export const AssociatedTenant: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AssociatedTenant", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AssociatedTenantProperties", + }, + }, + }, + }, +}; + +export const AvailableBalance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailableBalance", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AvailableBalanceProperties", + }, + }, + }, + }, +}; + +export const BillingAccount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingAccount", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "BillingAccountProperties", + }, + }, + }, + }, +}; + +export const BillingAccountPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingAccountPatch", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "BillingAccountProperties", + }, + }, + }, + }, +}; + +export const BillingProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingProfile", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "BillingProfileProperties", + }, + }, + }, + }, +}; + +export const BillingProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingProperty", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "BillingPropertyProperties", + }, + }, + }, + }, +}; + +export const BillingRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRequest", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "BillingRequestProperties", + }, + }, + }, + }, +}; + +export const BillingRoleAssignment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRoleAssignment", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "BillingRoleAssignmentProperties", + }, + }, + }, + }, +}; + +export const BillingRoleDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingRoleDefinition", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "BillingRoleDefinitionProperties", + }, + }, + }, + }, +}; + +export const SavingsPlanOrderModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlanOrderModel", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku", + }, + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + billingScopeId: { + serializedName: "properties.billingScopeId", + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "properties.billingProfileId", + readOnly: true, + type: { + name: "String", + }, + }, + customerId: { + serializedName: "properties.customerId", + readOnly: true, + type: { + name: "String", + }, + }, + billingAccountId: { + serializedName: "properties.billingAccountId", + readOnly: true, + type: { + name: "String", + }, + }, + term: { + serializedName: "properties.term", + type: { + name: "String", + }, + }, + billingPlan: { + serializedName: "properties.billingPlan", + type: { + name: "String", + }, + }, + benefitStartTime: { + serializedName: "properties.benefitStartTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + expiryDateTime: { + serializedName: "properties.expiryDateTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + planInformation: { + serializedName: "properties.planInformation", + type: { + name: "Composite", + className: "BillingPlanInformation", + }, + }, + savingsPlans: { + serializedName: "properties.savingsPlans", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + extendedStatusInfo: { + serializedName: "properties.extendedStatusInfo", + type: { + name: "Composite", + className: "ExtendedStatusInfo", + }, + }, + productCode: { + serializedName: "properties.productCode", + type: { + name: "String", + }, + }, + }, + }, }; -export const EnrollmentAccount: coreClient.CompositeMapper = { +export const SavingsPlanModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnrollmentAccount", + className: "SavingsPlanModel", modelProperties: { - ...Resource.type.modelProperties, - accountName: { - serializedName: "properties.accountName", + ...ProxyResourceWithTags.type.modelProperties, + sku: { + serializedName: "sku", type: { - name: "String" - } + name: "Composite", + className: "Sku", + }, }, - costCenter: { - serializedName: "properties.costCenter", + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String", + }, + }, + displayProvisioningState: { + serializedName: "properties.displayProvisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + userFriendlyAppliedScopeType: { + serializedName: "properties.userFriendlyAppliedScopeType", + readOnly: true, + type: { + name: "String", + }, + }, + billingScopeId: { + serializedName: "properties.billingScopeId", + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "properties.billingProfileId", + readOnly: true, + type: { + name: "String", + }, + }, + customerId: { + serializedName: "properties.customerId", + readOnly: true, + type: { + name: "String", + }, + }, + billingAccountId: { + serializedName: "properties.billingAccountId", + readOnly: true, + type: { + name: "String", + }, + }, + term: { + serializedName: "properties.term", + type: { + name: "String", + }, + }, + renew: { + defaultValue: false, + serializedName: "properties.renew", + type: { + name: "Boolean", + }, + }, + renewSource: { + serializedName: "properties.renewSource", + type: { + name: "String", + }, + }, + renewDestination: { + serializedName: "properties.renewDestination", + type: { + name: "String", + }, + }, + renewProperties: { + serializedName: "properties.renewProperties", + type: { + name: "Composite", + className: "RenewProperties", + }, + }, + billingPlan: { + serializedName: "properties.billingPlan", + type: { + name: "String", + }, + }, + appliedScopeType: { + serializedName: "properties.appliedScopeType", + type: { + name: "String", + }, + }, + appliedScopeProperties: { + serializedName: "properties.appliedScopeProperties", + type: { + name: "Composite", + className: "AppliedScopeProperties", + }, + }, + commitment: { + serializedName: "properties.commitment", + type: { + name: "Composite", + className: "Commitment", + }, + }, + effectiveDateTime: { + serializedName: "properties.effectiveDateTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + benefitStartTime: { + serializedName: "properties.benefitStartTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + expiryDateTime: { + serializedName: "properties.expiryDateTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + purchaseDateTime: { + serializedName: "properties.purchaseDateTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + utilization: { + serializedName: "properties.utilization", + type: { + name: "Composite", + className: "Utilization", + }, + }, + extendedStatusInfo: { + serializedName: "properties.extendedStatusInfo", + type: { + name: "Composite", + className: "ExtendedStatusInfo", + }, + }, + productCode: { + serializedName: "properties.productCode", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const BillingSubscription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingSubscription", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + autoRenew: { + serializedName: "properties.autoRenew", + type: { + name: "String", + }, + }, + beneficiaryTenantId: { + serializedName: "properties.beneficiaryTenantId", + type: { + name: "String", + }, + }, + beneficiary: { + serializedName: "properties.beneficiary", + type: { + name: "Composite", + className: "Beneficiary", + }, + }, + billingFrequency: { + serializedName: "properties.billingFrequency", + type: { + name: "String", + }, + }, + billingProfileId: { + serializedName: "properties.billingProfileId", + type: { + name: "String", + }, + }, + billingPolicies: { + serializedName: "properties.billingPolicies", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + billingProfileDisplayName: { + serializedName: "properties.billingProfileDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + billingProfileName: { + serializedName: "properties.billingProfileName", + readOnly: true, + type: { + name: "String", + }, + }, + consumptionCostCenter: { + serializedName: "properties.consumptionCostCenter", + type: { + name: "String", + }, + }, + customerId: { + serializedName: "properties.customerId", + type: { + name: "String", + }, + }, + customerDisplayName: { + serializedName: "properties.customerDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + customerName: { + serializedName: "properties.customerName", + readOnly: true, + type: { + name: "String", + }, + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + enrollmentAccountId: { + serializedName: "properties.enrollmentAccountId", + readOnly: true, + type: { + name: "String", + }, + }, + enrollmentAccountDisplayName: { + serializedName: "properties.enrollmentAccountDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionId: { + serializedName: "properties.invoiceSectionId", + type: { + name: "String", + }, + }, + invoiceSectionDisplayName: { + serializedName: "properties.invoiceSectionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionName: { + serializedName: "properties.invoiceSectionName", + readOnly: true, + type: { + name: "String", + }, + }, + lastMonthCharges: { + serializedName: "properties.lastMonthCharges", + type: { + name: "Composite", + className: "Amount", + }, + }, + monthToDateCharges: { + serializedName: "properties.monthToDateCharges", + type: { + name: "Composite", + className: "Amount", + }, + }, + nextBillingCycleDetails: { + serializedName: "properties.nextBillingCycleDetails", + type: { + name: "Composite", + className: "NextBillingCycleDetails", + }, + }, + offerId: { + serializedName: "properties.offerId", + readOnly: true, + type: { + name: "String", + }, + }, + productCategory: { + serializedName: "properties.productCategory", + readOnly: true, + type: { + name: "String", + }, + }, + productType: { + serializedName: "properties.productType", + readOnly: true, + type: { + name: "String", + }, + }, + productTypeId: { + serializedName: "properties.productTypeId", + type: { + name: "String", + }, + }, + purchaseDate: { + serializedName: "properties.purchaseDate", + readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - accountOwner: { - serializedName: "properties.accountOwner", + quantity: { + serializedName: "properties.quantity", type: { - name: "String" - } + name: "Number", + }, }, - accountOwnerEmail: { - serializedName: "properties.accountOwnerEmail", + reseller: { + serializedName: "properties.reseller", type: { - name: "String" - } + name: "Composite", + className: "Reseller", + }, }, - status: { - serializedName: "properties.status", + renewalTermDetails: { + serializedName: "properties.renewalTermDetails", type: { - name: "String" - } + name: "Composite", + className: "RenewalTermDetails", + }, }, - startDate: { - serializedName: "properties.startDate", + skuId: { + serializedName: "properties.skuId", type: { - name: "DateTime" - } + name: "String", + }, }, - endDate: { - serializedName: "properties.endDate", + skuDescription: { + serializedName: "properties.skuDescription", + readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - department: { - serializedName: "properties.department", + systemOverrides: { + serializedName: "properties.systemOverrides", type: { name: "Composite", - className: "Department" - } - } - } - } -}; - -export const Department: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Department", - modelProperties: { - ...Resource.type.modelProperties, - departmentName: { - serializedName: "properties.departmentName", - type: { - name: "String" - } + className: "SystemOverrides", + }, }, - costCenter: { - serializedName: "properties.costCenter", + resourceUri: { + serializedName: "properties.resourceUri", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - status: { - serializedName: "properties.status", + termDuration: { + serializedName: "properties.termDuration", type: { - name: "String" - } + name: "String", + }, }, - enrollmentAccounts: { - serializedName: "properties.enrollmentAccounts", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EnrollmentAccount" - } - } - } - } - } - } -}; - -export const BillingAccount: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BillingAccount", - modelProperties: { - ...Resource.type.modelProperties, - displayName: { - serializedName: "properties.displayName", + termStartDate: { + serializedName: "properties.termStartDate", + readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - soldTo: { - serializedName: "properties.soldTo", + termEndDate: { + serializedName: "properties.termEndDate", + readOnly: true, type: { - name: "Composite", - className: "AddressDetails" - } + name: "DateTime", + }, }, - agreementType: { - serializedName: "properties.agreementType", - readOnly: true, + provisioningTenantId: { + serializedName: "properties.provisioningTenantId", type: { - name: "String" - } + name: "String", + }, }, - accountType: { - serializedName: "properties.accountType", + status: { + serializedName: "properties.status", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - accountStatus: { - serializedName: "properties.accountStatus", + operationStatus: { + serializedName: "properties.operationStatus", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingProfiles: { - serializedName: "properties.billingProfiles", + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { - name: "Composite", - className: "BillingProfilesOnExpand" - } + name: "String", + }, }, - enrollmentDetails: { - serializedName: "properties.enrollmentDetails", + subscriptionId: { + serializedName: "properties.subscriptionId", + readOnly: true, type: { - name: "Composite", - className: "Enrollment" - } + name: "String", + }, }, - departments: { - serializedName: "properties.departments", + suspensionReasons: { + serializedName: "properties.suspensionReasons", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Department" - } - } - } + name: "String", + }, + }, + }, }, - enrollmentAccounts: { - serializedName: "properties.enrollmentAccounts", + suspensionReasonDetails: { + serializedName: "properties.suspensionReasonDetails", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "EnrollmentAccount" - } - } - } + className: "BillingSubscriptionStatusDetails", + }, + }, + }, }, - hasReadAccess: { - serializedName: "properties.hasReadAccess", + enrollmentAccountStartDate: { + serializedName: + "properties.enrollmentAccountSubscriptionDetails.enrollmentAccountStartDate", readOnly: true, type: { - name: "Boolean" - } + name: "DateTime", + }, }, - notificationEmailAddress: { - serializedName: "properties.notificationEmailAddress", - type: { - name: "String" - } - } - } - } -}; - -export const AvailableBalance: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailableBalance", - modelProperties: { - ...Resource.type.modelProperties, - amount: { - serializedName: "properties.amount", + subscriptionEnrollmentAccountStatus: { + serializedName: + "properties.enrollmentAccountSubscriptionDetails.subscriptionEnrollmentAccountStatus", + readOnly: true, type: { - name: "Composite", - className: "Amount" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const Instruction: coreClient.CompositeMapper = { +export const BillingSubscriptionAlias: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Instruction", + className: "BillingSubscriptionAlias", modelProperties: { - ...Resource.type.modelProperties, - amount: { - serializedName: "properties.amount", + ...ProxyResourceWithTags.type.modelProperties, + autoRenew: { + serializedName: "properties.autoRenew", type: { - name: "Number" - } + name: "String", + }, }, - startDate: { - serializedName: "properties.startDate", + beneficiaryTenantId: { + serializedName: "properties.beneficiaryTenantId", type: { - name: "DateTime" - } + name: "String", + }, }, - endDate: { - serializedName: "properties.endDate", + beneficiary: { + serializedName: "properties.beneficiary", type: { - name: "DateTime" - } + name: "Composite", + className: "Beneficiary", + }, }, - creationDate: { - serializedName: "properties.creationDate", + billingFrequency: { + serializedName: "properties.billingFrequency", type: { - name: "DateTime" - } - } - } - } -}; - -export const Customer: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Customer", - modelProperties: { - ...Resource.type.modelProperties, + name: "String", + }, + }, billingProfileId: { serializedName: "properties.billingProfileId", + type: { + name: "String", + }, + }, + billingPolicies: { + serializedName: "properties.billingPolicies", readOnly: true, type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, billingProfileDisplayName: { serializedName: "properties.billingProfileDisplayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - displayName: { - serializedName: "properties.displayName", + billingProfileName: { + serializedName: "properties.billingProfileName", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - enabledAzurePlans: { - serializedName: "properties.enabledAzurePlans", + consumptionCostCenter: { + serializedName: "properties.consumptionCostCenter", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzurePlan" - } - } - } + name: "String", + }, }, - resellers: { - serializedName: "properties.resellers", + customerId: { + serializedName: "properties.customerId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Reseller" - } - } - } - } - } - } -}; - -export const BillingSubscription: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BillingSubscription", - modelProperties: { - ...Resource.type.modelProperties, + name: "String", + }, + }, + customerDisplayName: { + serializedName: "properties.customerDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + customerName: { + serializedName: "properties.customerName", + readOnly: true, + type: { + name: "String", + }, + }, displayName: { serializedName: "properties.displayName", + type: { + name: "String", + }, + }, + enrollmentAccountId: { + serializedName: "properties.enrollmentAccountId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - subscriptionId: { - serializedName: "properties.subscriptionId", + enrollmentAccountDisplayName: { + serializedName: "properties.enrollmentAccountDisplayName", readOnly: true, type: { - name: "Uuid" - } + name: "String", + }, }, - subscriptionBillingStatus: { - serializedName: "properties.subscriptionBillingStatus", + invoiceSectionId: { + serializedName: "properties.invoiceSectionId", + type: { + name: "String", + }, + }, + invoiceSectionDisplayName: { + serializedName: "properties.invoiceSectionDisplayName", + readOnly: true, + type: { + name: "String", + }, + }, + invoiceSectionName: { + serializedName: "properties.invoiceSectionName", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, lastMonthCharges: { serializedName: "properties.lastMonthCharges", type: { name: "Composite", - className: "Amount" - } + className: "Amount", + }, }, monthToDateCharges: { serializedName: "properties.monthToDateCharges", type: { name: "Composite", - className: "Amount" - } + className: "Amount", + }, }, - billingProfileId: { - serializedName: "properties.billingProfileId", - readOnly: true, + nextBillingCycleDetails: { + serializedName: "properties.nextBillingCycleDetails", type: { - name: "String" - } + name: "Composite", + className: "NextBillingCycleDetails", + }, }, - billingProfileDisplayName: { - serializedName: "properties.billingProfileDisplayName", + offerId: { + serializedName: "properties.offerId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - costCenter: { - serializedName: "properties.costCenter", + productCategory: { + serializedName: "properties.productCategory", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - customerId: { - serializedName: "properties.customerId", + productType: { + serializedName: "properties.productType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - customerDisplayName: { - serializedName: "properties.customerDisplayName", - readOnly: true, + productTypeId: { + serializedName: "properties.productTypeId", type: { - name: "String" - } + name: "String", + }, }, - invoiceSectionId: { - serializedName: "properties.invoiceSectionId", + purchaseDate: { + serializedName: "properties.purchaseDate", readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - invoiceSectionDisplayName: { - serializedName: "properties.invoiceSectionDisplayName", - readOnly: true, + quantity: { + serializedName: "properties.quantity", type: { - name: "String" - } + name: "Number", + }, }, reseller: { serializedName: "properties.reseller", type: { name: "Composite", - className: "Reseller" - } + className: "Reseller", + }, + }, + renewalTermDetails: { + serializedName: "properties.renewalTermDetails", + type: { + name: "Composite", + className: "RenewalTermDetails", + }, }, skuId: { serializedName: "properties.skuId", type: { - name: "String" - } + name: "String", + }, }, skuDescription: { serializedName: "properties.skuDescription", readOnly: true, type: { - name: "String" - } + name: "String", + }, + }, + systemOverrides: { + serializedName: "properties.systemOverrides", + type: { + name: "Composite", + className: "SystemOverrides", + }, + }, + resourceUri: { + serializedName: "properties.resourceUri", + readOnly: true, + type: { + name: "String", + }, + }, + termDuration: { + serializedName: "properties.termDuration", + type: { + name: "String", + }, + }, + termStartDate: { + serializedName: "properties.termStartDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + termEndDate: { + serializedName: "properties.termEndDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + provisioningTenantId: { + serializedName: "properties.provisioningTenantId", + type: { + name: "String", + }, + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String", + }, + }, + operationStatus: { + serializedName: "properties.operationStatus", + readOnly: true, + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + subscriptionId: { + serializedName: "properties.subscriptionId", + readOnly: true, + type: { + name: "String", + }, }, suspensionReasons: { serializedName: "properties.suspensionReasons", @@ -2642,1198 +9208,1910 @@ export const BillingSubscription: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + suspensionReasonDetails: { + serializedName: "properties.suspensionReasonDetails", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BillingSubscriptionStatusDetails", + }, + }, + }, + }, + enrollmentAccountStartDate: { + serializedName: + "properties.enrollmentAccountSubscriptionDetails.enrollmentAccountStartDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + subscriptionEnrollmentAccountStatus: { + serializedName: + "properties.enrollmentAccountSubscriptionDetails.subscriptionEnrollmentAccountStatus", + readOnly: true, + type: { + name: "String", + }, + }, + billingSubscriptionId: { + serializedName: "properties.billingSubscriptionId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; -export const Product: coreClient.CompositeMapper = { +export const BillingSubscriptionPatch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Product", + className: "BillingSubscriptionPatch", modelProperties: { - ...Resource.type.modelProperties, + ...ProxyResourceWithTags.type.modelProperties, autoRenew: { serializedName: "properties.autoRenew", type: { - name: "String" - } + name: "String", + }, }, - displayName: { - serializedName: "properties.displayName", - readOnly: true, + beneficiaryTenantId: { + serializedName: "properties.beneficiaryTenantId", type: { - name: "String" - } + name: "String", + }, }, - purchaseDate: { - serializedName: "properties.purchaseDate", - readOnly: true, + beneficiary: { + serializedName: "properties.beneficiary", type: { - name: "DateTime" - } + name: "Composite", + className: "Beneficiary", + }, }, - productTypeId: { - serializedName: "properties.productTypeId", - readOnly: true, + billingFrequency: { + serializedName: "properties.billingFrequency", type: { - name: "String" - } + name: "String", + }, }, - productType: { - serializedName: "properties.productType", - readOnly: true, + billingProfileId: { + serializedName: "properties.billingProfileId", type: { - name: "String" - } - }, - status: { - serializedName: "properties.status", + name: "String", + }, + }, + billingPolicies: { + serializedName: "properties.billingPolicies", + readOnly: true, type: { - name: "String" - } + name: "Dictionary", + value: { type: { name: "String" } }, + }, }, - endDate: { - serializedName: "properties.endDate", + billingProfileDisplayName: { + serializedName: "properties.billingProfileDisplayName", readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - billingFrequency: { - serializedName: "properties.billingFrequency", + billingProfileName: { + serializedName: "properties.billingProfileName", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - lastCharge: { - serializedName: "properties.lastCharge", + consumptionCostCenter: { + serializedName: "properties.consumptionCostCenter", type: { - name: "Composite", - className: "Amount" - } + name: "String", + }, }, - lastChargeDate: { - serializedName: "properties.lastChargeDate", - readOnly: true, + customerId: { + serializedName: "properties.customerId", type: { - name: "DateTime" - } + name: "String", + }, }, - quantity: { - serializedName: "properties.quantity", + customerDisplayName: { + serializedName: "properties.customerDisplayName", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - skuId: { - serializedName: "properties.skuId", + customerName: { + serializedName: "properties.customerName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - skuDescription: { - serializedName: "properties.skuDescription", - readOnly: true, + displayName: { + serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, - tenantId: { - serializedName: "properties.tenantId", + enrollmentAccountId: { + serializedName: "properties.enrollmentAccountId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - availabilityId: { - serializedName: "properties.availabilityId", + enrollmentAccountDisplayName: { + serializedName: "properties.enrollmentAccountDisplayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, invoiceSectionId: { serializedName: "properties.invoiceSectionId", - readOnly: true, type: { - name: "String" - } + name: "String", + }, }, invoiceSectionDisplayName: { serializedName: "properties.invoiceSectionDisplayName", readOnly: true, type: { - name: "String" - } - }, - billingProfileId: { - serializedName: "properties.billingProfileId", - readOnly: true, - type: { - name: "String" - } + name: "String", + }, }, - billingProfileDisplayName: { - serializedName: "properties.billingProfileDisplayName", + invoiceSectionName: { + serializedName: "properties.invoiceSectionName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - customerId: { - serializedName: "properties.customerId", - readOnly: true, + lastMonthCharges: { + serializedName: "properties.lastMonthCharges", type: { - name: "String" - } + name: "Composite", + className: "Amount", + }, }, - customerDisplayName: { - serializedName: "properties.customerDisplayName", - readOnly: true, + monthToDateCharges: { + serializedName: "properties.monthToDateCharges", type: { - name: "String" - } + name: "Composite", + className: "Amount", + }, }, - reseller: { - serializedName: "properties.reseller", + nextBillingCycleDetails: { + serializedName: "properties.nextBillingCycleDetails", type: { name: "Composite", - className: "Reseller" - } - } - } - } -}; - -export const Invoice: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Invoice", - modelProperties: { - ...Resource.type.modelProperties, - dueDate: { - serializedName: "properties.dueDate", + className: "NextBillingCycleDetails", + }, + }, + offerId: { + serializedName: "properties.offerId", readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - invoiceDate: { - serializedName: "properties.invoiceDate", + productCategory: { + serializedName: "properties.productCategory", readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - status: { - serializedName: "properties.status", + productType: { + serializedName: "properties.productType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - amountDue: { - serializedName: "properties.amountDue", + productTypeId: { + serializedName: "properties.productTypeId", type: { - name: "Composite", - className: "Amount" - } + name: "String", + }, }, - azurePrepaymentApplied: { - serializedName: "properties.azurePrepaymentApplied", + purchaseDate: { + serializedName: "properties.purchaseDate", + readOnly: true, type: { - name: "Composite", - className: "Amount" - } + name: "DateTime", + }, }, - billedAmount: { - serializedName: "properties.billedAmount", + quantity: { + serializedName: "properties.quantity", type: { - name: "Composite", - className: "Amount" - } + name: "Number", + }, }, - creditAmount: { - serializedName: "properties.creditAmount", + reseller: { + serializedName: "properties.reseller", type: { name: "Composite", - className: "Amount" - } + className: "Reseller", + }, }, - freeAzureCreditApplied: { - serializedName: "properties.freeAzureCreditApplied", + renewalTermDetails: { + serializedName: "properties.renewalTermDetails", type: { name: "Composite", - className: "Amount" - } + className: "RenewalTermDetails", + }, }, - subTotal: { - serializedName: "properties.subTotal", + skuId: { + serializedName: "properties.skuId", type: { - name: "Composite", - className: "Amount" - } + name: "String", + }, }, - taxAmount: { - serializedName: "properties.taxAmount", + skuDescription: { + serializedName: "properties.skuDescription", + readOnly: true, type: { - name: "Composite", - className: "Amount" - } + name: "String", + }, }, - totalAmount: { - serializedName: "properties.totalAmount", + systemOverrides: { + serializedName: "properties.systemOverrides", type: { name: "Composite", - className: "Amount" - } + className: "SystemOverrides", + }, }, - invoicePeriodStartDate: { - serializedName: "properties.invoicePeriodStartDate", + resourceUri: { + serializedName: "properties.resourceUri", readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - invoicePeriodEndDate: { - serializedName: "properties.invoicePeriodEndDate", + termDuration: { + serializedName: "properties.termDuration", + type: { + name: "String", + }, + }, + termStartDate: { + serializedName: "properties.termStartDate", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, - invoiceType: { - serializedName: "properties.invoiceType", + termEndDate: { + serializedName: "properties.termEndDate", readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - isMonthlyInvoice: { - serializedName: "properties.isMonthlyInvoice", + provisioningTenantId: { + serializedName: "properties.provisioningTenantId", + type: { + name: "String", + }, + }, + status: { + serializedName: "properties.status", readOnly: true, type: { - name: "Boolean" - } + name: "String", + }, }, - billingProfileId: { - serializedName: "properties.billingProfileId", + operationStatus: { + serializedName: "properties.operationStatus", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingProfileDisplayName: { - serializedName: "properties.billingProfileDisplayName", + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - purchaseOrderNumber: { - serializedName: "properties.purchaseOrderNumber", + subscriptionId: { + serializedName: "properties.subscriptionId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - documents: { - serializedName: "properties.documents", + suspensionReasons: { + serializedName: "properties.suspensionReasons", readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "Document" - } - } - } + name: "String", + }, + }, + }, }, - payments: { - serializedName: "properties.payments", + suspensionReasonDetails: { + serializedName: "properties.suspensionReasonDetails", readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "PaymentProperties" - } - } - } - }, - rebillDetails: { - serializedName: "properties.rebillDetails", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "Composite", className: "RebillDetails" } } - } + className: "BillingSubscriptionStatusDetails", + }, + }, + }, }, - documentType: { - serializedName: "properties.documentType", + enrollmentAccountStartDate: { + serializedName: + "properties.enrollmentAccountSubscriptionDetails.enrollmentAccountStartDate", readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - billedDocumentId: { - serializedName: "properties.billedDocumentId", + subscriptionEnrollmentAccountStatus: { + serializedName: + "properties.enrollmentAccountSubscriptionDetails.subscriptionEnrollmentAccountStatus", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - creditForDocumentId: { - serializedName: "properties.creditForDocumentId", - readOnly: true, + }, + }, +}; + +export const Customer: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Customer", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "CustomerProperties", + }, }, - subscriptionId: { - serializedName: "properties.subscriptionId", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const Transaction: coreClient.CompositeMapper = { +export const Department: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Transaction", + className: "Department", modelProperties: { - ...Resource.type.modelProperties, - kind: { - serializedName: "properties.kind", + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "DepartmentProperties", + }, }, - date: { - serializedName: "properties.date", - readOnly: true, + }, + }, +}; + +export const EnrollmentAccount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnrollmentAccount", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "DateTime" - } + name: "Composite", + className: "EnrollmentAccountProperties", + }, }, - invoice: { - serializedName: "properties.invoice", - readOnly: true, + }, + }, +}; + +export const Invoice: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Invoice", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "InvoiceProperties", + }, }, - invoiceId: { - serializedName: "properties.invoiceId", - readOnly: true, + }, + }, +}; + +export const InvoiceSection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InvoiceSection", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "InvoiceSectionProperties", + }, }, - orderId: { - serializedName: "properties.orderId", + }, + }, +}; + +export const PaymentMethodLink: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentMethodLink", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + accountHolderName: { + serializedName: "properties.accountHolderName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - orderName: { - serializedName: "properties.orderName", + displayName: { + serializedName: "properties.displayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - productFamily: { - serializedName: "properties.productFamily", + expiration: { + serializedName: "properties.expiration", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - productTypeId: { - serializedName: "properties.productTypeId", + family: { + serializedName: "properties.family", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - productType: { - serializedName: "properties.productType", + lastFourDigits: { + serializedName: "properties.lastFourDigits", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - productDescription: { - serializedName: "properties.productDescription", + logos: { + serializedName: "properties.logos", readOnly: true, type: { - name: "String" - } - }, - transactionType: { - serializedName: "properties.transactionType", - type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentMethodLogo", + }, + }, + }, }, - transactionAmount: { - serializedName: "properties.transactionAmount", + paymentMethod: { + serializedName: "properties.paymentMethod", type: { name: "Composite", - className: "Amount" - } - }, - quantity: { - serializedName: "properties.quantity", - readOnly: true, - type: { - name: "Number" - } - }, - invoiceSectionId: { - serializedName: "properties.invoiceSectionId", - readOnly: true, - type: { - name: "String" - } - }, - invoiceSectionDisplayName: { - serializedName: "properties.invoiceSectionDisplayName", - readOnly: true, - type: { - name: "String" - } - }, - billingProfileId: { - serializedName: "properties.billingProfileId", - readOnly: true, - type: { - name: "String" - } + className: "PaymentMethodProperties", + }, }, - billingProfileDisplayName: { - serializedName: "properties.billingProfileDisplayName", - readOnly: true, - type: { - name: "String" - } - }, - customerId: { - serializedName: "properties.customerId", - readOnly: true, + paymentMethodId: { + serializedName: "properties.paymentMethodId", type: { - name: "String" - } + name: "String", + }, }, - customerDisplayName: { - serializedName: "properties.customerDisplayName", + paymentMethodType: { + serializedName: "properties.paymentMethodType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - subscriptionId: { - serializedName: "properties.subscriptionId", + status: { + serializedName: "properties.status", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - subscriptionName: { - serializedName: "properties.subscriptionName", + }, + }, +}; + +export const PaymentMethod: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PaymentMethod", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + idPropertiesId: { + serializedName: "properties.id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - azurePlan: { - serializedName: "properties.azurePlan", + accountHolderName: { + serializedName: "properties.accountHolderName", readOnly: true, type: { - name: "String" - } - }, - azureCreditApplied: { - serializedName: "properties.azureCreditApplied", - type: { - name: "Composite", - className: "Amount" - } + name: "String", + }, }, - billingCurrency: { - serializedName: "properties.billingCurrency", + displayName: { + serializedName: "properties.displayName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - discount: { - serializedName: "properties.discount", + expiration: { + serializedName: "properties.expiration", readOnly: true, type: { - name: "Number" - } + name: "String", + }, }, - effectivePrice: { - serializedName: "properties.effectivePrice", + family: { + serializedName: "properties.family", type: { - name: "Composite", - className: "Amount" - } + name: "String", + }, }, - exchangeRate: { - serializedName: "properties.exchangeRate", + lastFourDigits: { + serializedName: "properties.lastFourDigits", readOnly: true, type: { - name: "Number" - } - }, - marketPrice: { - serializedName: "properties.marketPrice", - type: { - name: "Composite", - className: "Amount" - } + name: "String", + }, }, - pricingCurrency: { - serializedName: "properties.pricingCurrency", - readOnly: true, + logos: { + serializedName: "properties.logos", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentMethodLogo", + }, + }, + }, }, - servicePeriodStartDate: { - serializedName: "properties.servicePeriodStartDate", + paymentMethodType: { + serializedName: "properties.paymentMethodType", readOnly: true, type: { - name: "DateTime" - } + name: "String", + }, }, - servicePeriodEndDate: { - serializedName: "properties.servicePeriodEndDate", - readOnly: true, + status: { + serializedName: "properties.status", type: { - name: "DateTime" - } + name: "String", + }, }, - subTotal: { - serializedName: "properties.subTotal", + }, + }, +}; + +export const CustomerPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomerPolicy", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { name: "Composite", - className: "Amount" - } + className: "CustomerPolicyProperties", + }, }, - tax: { - serializedName: "properties.tax", + }, + }, +}; + +export const BillingProfilePolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingProfilePolicy", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { name: "Composite", - className: "Amount" - } + className: "BillingProfilePolicyProperties", + }, }, - unitOfMeasure: { - serializedName: "properties.unitOfMeasure", - readOnly: true, + }, + }, +}; + +export const BillingAccountPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingAccountPolicy", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "BillingAccountPolicyProperties", + }, }, - units: { - serializedName: "properties.units", - readOnly: true, + }, + }, +}; + +export const SubscriptionPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionPolicy", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "Number" - } + name: "Composite", + className: "SubscriptionPolicyProperties", + }, }, - unitType: { - serializedName: "properties.unitType", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const Policy: coreClient.CompositeMapper = { +export const Product: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Policy", + className: "Product", modelProperties: { - ...Resource.type.modelProperties, - marketplacePurchases: { - serializedName: "properties.marketplacePurchases", + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "ProductProperties", + }, }, - reservationPurchases: { - serializedName: "properties.reservationPurchases", + }, + }, +}; + +export const ProductPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProductPatch", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "ProductProperties", + }, }, - viewCharges: { - serializedName: "properties.viewCharges", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const CustomerPolicy: coreClient.CompositeMapper = { +export const Transaction: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CustomerPolicy", + className: "Transaction", modelProperties: { - ...Resource.type.modelProperties, - viewCharges: { - serializedName: "properties.viewCharges", + ...ProxyResourceWithTags.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } - } - } - } + name: "Composite", + className: "TransactionProperties", + }, + }, + }, + }, }; -export const BillingProperty: coreClient.CompositeMapper = { +export const TransferDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingProperty", + className: "TransferDetails", modelProperties: { - ...Resource.type.modelProperties, - accountAdminNotificationEmailAddress: { - serializedName: "properties.accountAdminNotificationEmailAddress", + ...ProxyResourceWithTags.type.modelProperties, + expirationTime: { + serializedName: "properties.expirationTime", readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - billingTenantId: { - serializedName: "properties.billingTenantId", + transferStatus: { + serializedName: "properties.transferStatus", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingAccountId: { - serializedName: "properties.billingAccountId", + recipientEmailId: { + serializedName: "properties.recipientEmailId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingAccountDisplayName: { - serializedName: "properties.billingAccountDisplayName", + initiatorEmailId: { + serializedName: "properties.initiatorEmailId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingProfileId: { - serializedName: "properties.billingProfileId", + canceledBy: { + serializedName: "properties.canceledBy", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingProfileDisplayName: { - serializedName: "properties.billingProfileDisplayName", + detailedTransferStatus: { + serializedName: "properties.detailedTransferStatus", readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DetailedTransferStatus", + }, + }, + }, }, - billingProfileStatus: { - serializedName: "properties.billingProfileStatus", + }, + }, +}; + +export const PartnerTransferDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PartnerTransferDetails", + modelProperties: { + ...ProxyResourceWithTags.type.modelProperties, + expirationTime: { + serializedName: "properties.expirationTime", readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - billingProfileStatusReasonCode: { - serializedName: "properties.billingProfileStatusReasonCode", + transferStatus: { + serializedName: "properties.transferStatus", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - billingProfileSpendingLimit: { - serializedName: "properties.billingProfileSpendingLimit", + recipientEmailId: { + serializedName: "properties.recipientEmailId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - costCenter: { - serializedName: "properties.costCenter", - type: { - name: "String" - } - }, - invoiceSectionId: { - serializedName: "properties.invoiceSectionId", + initiatorCustomerType: { + serializedName: "properties.initiatorCustomerType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - invoiceSectionDisplayName: { - serializedName: "properties.invoiceSectionDisplayName", + initiatorEmailId: { + serializedName: "properties.initiatorEmailId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - isAccountAdmin: { - serializedName: "properties.isAccountAdmin", + resellerId: { + serializedName: "properties.resellerId", readOnly: true, type: { - name: "Boolean" - } + name: "String", + }, }, - productId: { - serializedName: "properties.productId", + resellerName: { + serializedName: "properties.resellerName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - productName: { - serializedName: "properties.productName", + canceledBy: { + serializedName: "properties.canceledBy", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - skuId: { - serializedName: "properties.skuId", + detailedTransferStatus: { + serializedName: "properties.detailedTransferStatus", readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DetailedTransferStatus", + }, + }, + }, }, - skuDescription: { - serializedName: "properties.skuDescription", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const BillingRoleDefinition: coreClient.CompositeMapper = { +export const RecipientTransferDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingRoleDefinition", + className: "RecipientTransferDetails", modelProperties: { - ...Resource.type.modelProperties, - description: { - serializedName: "properties.description", + ...ProxyResourceWithTags.type.modelProperties, + expirationTime: { + serializedName: "properties.expirationTime", readOnly: true, type: { - name: "String" - } + name: "DateTime", + }, }, - permissions: { - serializedName: "properties.permissions", + allowedProductType: { + serializedName: "properties.allowedProductType", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "BillingPermissionsProperties" - } - } - } + name: "String", + }, + }, + }, }, - roleName: { - serializedName: "properties.roleName", + transferStatus: { + serializedName: "properties.transferStatus", readOnly: true, type: { - name: "String" - } - } - } - } -}; - -export const BillingRoleAssignment: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BillingRoleAssignment", - modelProperties: { - ...Resource.type.modelProperties, - createdOn: { - serializedName: "properties.createdOn", + name: "String", + }, + }, + recipientEmailId: { + serializedName: "properties.recipientEmailId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - createdByPrincipalTenantId: { - serializedName: "properties.createdByPrincipalTenantId", + initiatorEmailId: { + serializedName: "properties.initiatorEmailId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - createdByPrincipalId: { - serializedName: "properties.createdByPrincipalId", + resellerId: { + serializedName: "properties.resellerId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - createdByUserEmailAddress: { - serializedName: "properties.createdByUserEmailAddress", + resellerName: { + serializedName: "properties.resellerName", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - principalId: { - serializedName: "properties.principalId", + initiatorCustomerType: { + serializedName: "properties.initiatorCustomerType", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - principalTenantId: { - serializedName: "properties.principalTenantId", + canceledBy: { + serializedName: "properties.canceledBy", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", + detailedTransferStatus: { + serializedName: "properties.detailedTransferStatus", + readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DetailedTransferStatus", + }, + }, + }, }, - scope: { - serializedName: "properties.scope", + customerTenantId: { + serializedName: "properties.customerTenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - userAuthenticationType: { - serializedName: "properties.userAuthenticationType", + supportedAccounts: { + serializedName: "properties.supportedAccounts", + readOnly: true, type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - userEmailAddress: { - serializedName: "properties.userEmailAddress", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const Agreement: coreClient.CompositeMapper = { +export const AssociatedTenantsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Agreement", + className: "AssociatedTenantsDeleteHeaders", modelProperties: { - ...Resource.type.modelProperties, - agreementLink: { - serializedName: "properties.agreementLink", - readOnly: true, - type: { - name: "String" - } - }, - category: { - serializedName: "properties.category", - readOnly: true, - type: { - name: "String" - } - }, - acceptanceMode: { - serializedName: "properties.acceptanceMode", - readOnly: true, + location: { + serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, - effectiveDate: { - serializedName: "properties.effectiveDate", - readOnly: true, + retryAfter: { + serializedName: "retry-after", type: { - name: "DateTime" - } + name: "Number", + }, }, - expirationDate: { - serializedName: "properties.expirationDate", - readOnly: true, + }, + }, +}; + +export const AssociatedTenantsCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "AssociatedTenantsCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingAccountsAddPaymentTermsHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingAccountsAddPaymentTermsHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingAccountsCancelPaymentTermsHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingAccountsCancelPaymentTermsHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingAccountsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BillingAccountsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", type: { - name: "DateTime" - } + name: "String", + }, }, - participants: { - serializedName: "properties.participants", + retryAfter: { + serializedName: "retry-after", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Participants" - } - } - } + name: "Number", + }, }, - status: { - serializedName: "properties.status", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; -export const EnrollmentAccountSummary: coreClient.CompositeMapper = { +export const BillingProfilesDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnrollmentAccountSummary", + className: "BillingProfilesDeleteHeaders", modelProperties: { - ...Resource.type.modelProperties, - principalName: { - serializedName: "properties.principalName", - readOnly: true, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", type: { - name: "String" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const BillingPeriod: coreClient.CompositeMapper = { +export const BillingProfilesCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingProfilesCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRequestsCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRequestsCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsCreateByBillingProfileHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsCreateByBillingProfileHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsCreateByCustomerHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsCreateByCustomerHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsResolveByCustomerHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsResolveByCustomerHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsCreateByInvoiceSectionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsCreateByInvoiceSectionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsResolveByInvoiceSectionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsResolveByInvoiceSectionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsResolveByBillingProfileHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsResolveByBillingProfileHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsCreateOrUpdateByBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsCreateOrUpdateByBillingAccountHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsCreateByBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsCreateByBillingAccountHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsCreateOrUpdateByDepartmentHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsCreateOrUpdateByDepartmentHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: + "BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingRoleAssignmentsResolveByBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingRoleAssignmentsResolveByBillingAccountHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const SavingsPlansUpdateByBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SavingsPlansUpdateByBillingAccountHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const BillingSubscriptionsCancelHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingPeriod", + className: "BillingSubscriptionsCancelHeaders", modelProperties: { - ...Resource.type.modelProperties, - billingPeriodStartDate: { - serializedName: "properties.billingPeriodStartDate", - readOnly: true, + location: { + serializedName: "location", type: { - name: "Date" - } + name: "String", + }, }, - billingPeriodEndDate: { - serializedName: "properties.billingPeriodEndDate", - readOnly: true, + retryAfter: { + serializedName: "retry-after", type: { - name: "Date" - } + name: "Number", + }, }, - invoiceIds: { - serializedName: "properties.invoiceIds", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } + }, + }, }; -export const BillingProfilesCreateOrUpdateHeaders: coreClient.CompositeMapper = { +export const BillingSubscriptionsMergeHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingProfilesCreateOrUpdateHeaders", + className: "BillingSubscriptionsMergeHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, retryAfter: { serializedName: "retry-after", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const InvoiceSectionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { +export const BillingSubscriptionsMoveHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "InvoiceSectionsCreateOrUpdateHeaders", + className: "BillingSubscriptionsMoveHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, retryAfter: { serializedName: "retry-after", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const BillingSubscriptionsMoveHeaders: coreClient.CompositeMapper = { +export const BillingSubscriptionsSplitHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingSubscriptionsMoveHeaders", + className: "BillingSubscriptionsSplitHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, retryAfter: { serializedName: "retry-after", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const ProductsMoveHeaders: coreClient.CompositeMapper = { +export const BillingSubscriptionsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProductsMoveHeaders", + className: "BillingSubscriptionsDeleteHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, retryAfter: { serializedName: "retry-after", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const InvoicesDownloadInvoiceHeaders: coreClient.CompositeMapper = { +export const BillingSubscriptionsUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "InvoicesDownloadInvoiceHeaders", + className: "BillingSubscriptionsUpdateHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, retryAfter: { serializedName: "retry-after", type: { - name: "String" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const InvoicesDownloadMultipleBillingProfileInvoicesHeaders: coreClient.CompositeMapper = { +export const BillingSubscriptionsAliasesCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "BillingSubscriptionsAliasesCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const InvoicesDownloadDocumentsByBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoicesDownloadDocumentsByBillingAccountHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const InvoicesAmendHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "InvoicesDownloadMultipleBillingProfileInvoicesHeaders", + className: "InvoicesAmendHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, retryAfter: { serializedName: "retry-after", type: { - name: "String" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const InvoicesDownloadBillingSubscriptionInvoiceHeaders: coreClient.CompositeMapper = { +export const InvoicesDownloadByBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoicesDownloadByBillingAccountHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const InvoicesDownloadSummaryByBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoicesDownloadSummaryByBillingAccountHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const InvoicesDownloadDocumentsByBillingSubscriptionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoicesDownloadDocumentsByBillingSubscriptionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const InvoicesDownloadByBillingSubscriptionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoicesDownloadByBillingSubscriptionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const InvoiceSectionsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "InvoicesDownloadBillingSubscriptionInvoiceHeaders", + className: "InvoiceSectionsDeleteHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, retryAfter: { serializedName: "retry-after", type: { - name: "String" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; -export const InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders: coreClient.CompositeMapper = { +export const InvoiceSectionsCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "InvoiceSectionsCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const PoliciesCreateOrUpdateByCustomerHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PoliciesCreateOrUpdateByCustomerHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const PoliciesCreateOrUpdateByBillingProfileHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PoliciesCreateOrUpdateByBillingProfileHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const PoliciesCreateOrUpdateByCustomerAtBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PoliciesCreateOrUpdateByCustomerAtBillingAccountHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const PoliciesCreateOrUpdateByBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PoliciesCreateOrUpdateByBillingAccountHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const ProductsMoveHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders", + className: "ProductsMoveHeaders", modelProperties: { location: { serializedName: "location", type: { - name: "String" - } + name: "String", + }, }, retryAfter: { serializedName: "retry-after", type: { - name: "String" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; + +export const ReservationsUpdateByBillingAccountHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ReservationsUpdateByBillingAccountHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const TransactionsTransactionsDownloadByInvoiceHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "TransactionsTransactionsDownloadByInvoiceHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; diff --git a/sdk/billing/arm-billing/src/models/parameters.ts b/sdk/billing/arm-billing/src/models/parameters.ts index 2f397c5a956f..d9a4dc39223b 100644 --- a/sdk/billing/arm-billing/src/models/parameters.ts +++ b/sdk/billing/arm-billing/src/models/parameters.ts @@ -9,21 +9,36 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { - BillingAccountUpdateRequest as BillingAccountUpdateRequestMapper, + AssociatedTenant as AssociatedTenantMapper, + BillingAccountPatch as BillingAccountPatchMapper, AddressDetails as AddressDetailsMapper, - Instruction as InstructionMapper, + CheckAccessRequest as CheckAccessRequestMapper, BillingProfile as BillingProfileMapper, + BillingProperty as BillingPropertyMapper, + BillingRequest as BillingRequestMapper, + BillingRoleAssignmentProperties as BillingRoleAssignmentPropertiesMapper, + BillingRoleAssignment as BillingRoleAssignmentMapper, + SavingsPlanUpdateRequest as SavingsPlanUpdateRequestMapper, + SavingsPlanUpdateValidateRequest as SavingsPlanUpdateValidateRequestMapper, + CancelSubscriptionRequest as CancelSubscriptionRequestMapper, + BillingSubscriptionMergeRequest as BillingSubscriptionMergeRequestMapper, + MoveBillingSubscriptionRequest as MoveBillingSubscriptionRequestMapper, + BillingSubscriptionSplitRequest as BillingSubscriptionSplitRequestMapper, + BillingSubscriptionPatch as BillingSubscriptionPatchMapper, + BillingSubscriptionAlias as BillingSubscriptionAliasMapper, InvoiceSection as InvoiceSectionMapper, - BillingSubscription as BillingSubscriptionMapper, - TransferBillingSubscriptionRequestProperties as TransferBillingSubscriptionRequestPropertiesMapper, - Product as ProductMapper, - TransferProductRequestProperties as TransferProductRequestPropertiesMapper, - Policy as PolicyMapper, CustomerPolicy as CustomerPolicyMapper, - BillingProperty as BillingPropertyMapper + BillingProfilePolicy as BillingProfilePolicyMapper, + BillingAccountPolicy as BillingAccountPolicyMapper, + MoveProductRequest as MoveProductRequestMapper, + ProductPatch as ProductPatchMapper, + Patch as PatchMapper, + InitiateTransferRequest as InitiateTransferRequestMapper, + PartnerInitiateTransferRequest as PartnerInitiateTransferRequestMapper, + AcceptTransferRequest as AcceptTransferRequestMapper, } from "../models/mappers"; export const accept: OperationParameter = { @@ -33,9 +48,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -44,43 +59,90 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, + }, + skipEncoding: true, +}; + +export const billingAccountName: OperationURLParameter = { + parameterPath: "billingAccountName", + mapper: { + constraints: { + Pattern: new RegExp( + "^([0-9]+|([Pp][Cc][Nn]\\.[A-Za-z0-9]+)|[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}(:[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}_[0-9]{4}(-[0-9]{2}){2})?)$", + ), + }, + serializedName: "billingAccountName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const agreementName: OperationURLParameter = { + parameterPath: "agreementName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-fA-F0-9]{1,12}$"), + }, + serializedName: "agreementName", + required: true, + type: { + name: "String", + }, }, - skipEncoding: true }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2020-05-01", + defaultValue: "2024-04-01", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const expand: OperationQueryParameter = { parameterPath: ["options", "expand"], mapper: { - serializedName: "$expand", + serializedName: "expand", + type: { + name: "String", + }, + }, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, type: { - name: "String" - } - } + name: "String", + }, + }, + skipEncoding: true, }; -export const billingAccountName: OperationURLParameter = { - parameterPath: "billingAccountName", +export const associatedTenantName: OperationURLParameter = { + parameterPath: "associatedTenantName", mapper: { - serializedName: "billingAccountName", + constraints: { + Pattern: new RegExp( + "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$", + ), + }, + serializedName: "associatedTenantName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -90,346 +152,803 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: BillingAccountUpdateRequestMapper + mapper: AssociatedTenantMapper, }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", +export const includeRevoked: OperationQueryParameter = { + parameterPath: ["options", "includeRevoked"], mapper: { - serializedName: "nextLink", - required: true, + defaultValue: false, + serializedName: "includeRevoked", type: { - name: "String" - } + name: "Boolean", + }, }, - skipEncoding: true }; -export const address: OperationParameter = { - parameterPath: "address", - mapper: AddressDetailsMapper +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "filter", + type: { + name: "String", + }, + }, +}; + +export const orderBy: OperationQueryParameter = { + parameterPath: ["options", "orderBy"], + mapper: { + serializedName: "orderBy", + type: { + name: "String", + }, + }, +}; + +export const top: OperationQueryParameter = { + parameterPath: ["options", "top"], + mapper: { + serializedName: "top", + type: { + name: "Number", + }, + }, +}; + +export const skip: OperationQueryParameter = { + parameterPath: ["options", "skip"], + mapper: { + serializedName: "skip", + type: { + name: "Number", + }, + }, +}; + +export const count: OperationQueryParameter = { + parameterPath: ["options", "count"], + mapper: { + serializedName: "count", + type: { + name: "Boolean", + }, + }, +}; + +export const search: OperationQueryParameter = { + parameterPath: ["options", "search"], + mapper: { + serializedName: "search", + type: { + name: "String", + }, + }, }; export const billingProfileName: OperationURLParameter = { parameterPath: "billingProfileName", mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"), + }, serializedName: "billingProfileName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const instructionName: OperationURLParameter = { - parameterPath: "instructionName", +export const parameters1: OperationParameter = { + parameterPath: "parameters", mapper: { - serializedName: "instructionName", + serializedName: "parameters", required: true, type: { - name: "String" - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PaymentTerm", + }, + }, + }, + }, }; -export const parameters1: OperationParameter = { +export const parameters2: OperationParameter = { parameterPath: "parameters", - mapper: InstructionMapper + mapper: { + serializedName: "parameters", + required: true, + type: { + name: "DateTime", + }, + }, }; -export const parameters2: OperationParameter = { +export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: BillingProfileMapper + mapper: BillingAccountPatchMapper, }; -export const search: OperationQueryParameter = { - parameterPath: ["options", "search"], +export const includeAll: OperationQueryParameter = { + parameterPath: ["options", "includeAll"], + mapper: { + defaultValue: false, + serializedName: "includeAll", + type: { + name: "Boolean", + }, + }, +}; + +export const includeAllWithoutBillingProfiles: OperationQueryParameter = { + parameterPath: ["options", "includeAllWithoutBillingProfiles"], mapper: { - serializedName: "$search", + defaultValue: false, + serializedName: "includeAllWithoutBillingProfiles", type: { - name: "String" - } - } + name: "Boolean", + }, + }, }; -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], +export const includeDeleted: OperationQueryParameter = { + parameterPath: ["options", "includeDeleted"], + mapper: { + defaultValue: false, + serializedName: "includeDeleted", + type: { + name: "Boolean", + }, + }, +}; + +export const includePendingAgreement: OperationQueryParameter = { + parameterPath: ["options", "includePendingAgreement"], + mapper: { + defaultValue: false, + serializedName: "includePendingAgreement", + type: { + name: "Boolean", + }, + }, +}; + +export const includeResellee: OperationQueryParameter = { + parameterPath: ["options", "includeResellee"], + mapper: { + defaultValue: false, + serializedName: "includeResellee", + type: { + name: "Boolean", + }, + }, +}; + +export const legalOwnerTID: OperationQueryParameter = { + parameterPath: ["options", "legalOwnerTID"], + mapper: { + serializedName: "legalOwnerTID", + type: { + name: "String", + }, + }, +}; + +export const legalOwnerOID: OperationQueryParameter = { + parameterPath: ["options", "legalOwnerOID"], mapper: { - serializedName: "$filter", + serializedName: "legalOwnerOID", type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: AddressDetailsMapper, +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: CheckAccessRequestMapper, }; export const customerName: OperationURLParameter = { parameterPath: "customerName", mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"), + }, serializedName: "customerName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const invoiceSectionName: OperationURLParameter = { parameterPath: "invoiceSectionName", mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"), + }, serializedName: "invoiceSectionName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const parameters3: OperationParameter = { +export const departmentName: OperationURLParameter = { + parameterPath: "departmentName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"), + }, + serializedName: "departmentName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const enrollmentAccountName: OperationURLParameter = { + parameterPath: "enrollmentAccountName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"), + }, + serializedName: "enrollmentAccountName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const parameters6: OperationParameter = { parameterPath: "parameters", - mapper: InvoiceSectionMapper + mapper: BillingProfileMapper, }; export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { + constraints: { + Pattern: new RegExp( + "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$", + ), + }, serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const parameters4: OperationParameter = { +export const includeBillingCountry: OperationQueryParameter = { + parameterPath: ["options", "includeBillingCountry"], + mapper: { + defaultValue: false, + serializedName: "includeBillingCountry", + type: { + name: "Boolean", + }, + }, +}; + +export const includeTransitionStatus: OperationQueryParameter = { + parameterPath: ["options", "includeTransitionStatus"], + mapper: { + defaultValue: false, + serializedName: "includeTransitionStatus", + type: { + name: "Boolean", + }, + }, +}; + +export const parameters7: OperationParameter = { parameterPath: "parameters", - mapper: BillingSubscriptionMapper + mapper: BillingPropertyMapper, }; -export const parameters5: OperationParameter = { +export const billingRequestName: OperationURLParameter = { + parameterPath: "billingRequestName", + mapper: { + constraints: { + Pattern: new RegExp( + "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$", + ), + }, + serializedName: "billingRequestName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const parameters8: OperationParameter = { parameterPath: "parameters", - mapper: TransferBillingSubscriptionRequestPropertiesMapper + mapper: BillingRequestMapper, }; -export const productName: OperationURLParameter = { - parameterPath: "productName", +export const billingRoleAssignmentName: OperationURLParameter = { + parameterPath: "billingRoleAssignmentName", mapper: { - serializedName: "productName", + constraints: { + Pattern: new RegExp( + "^[a-fA-F0-9]{8}[-]?([a-fA-F0-9]{4}[-]?){3}[a-fA-F0-9]{12}(_[a-fA-F0-9]{8}[-]?([a-fA-F0-9]{4}[-]?){3}[a-fA-F0-9]{12})?$", + ), + }, + serializedName: "billingRoleAssignmentName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const parameters6: OperationParameter = { +export const parameters9: OperationParameter = { parameterPath: "parameters", - mapper: ProductMapper + mapper: BillingRoleAssignmentPropertiesMapper, }; -export const parameters7: OperationParameter = { +export const resolveScopeDisplayNames: OperationQueryParameter = { + parameterPath: ["options", "resolveScopeDisplayNames"], + mapper: { + defaultValue: false, + serializedName: "resolveScopeDisplayNames", + type: { + name: "Boolean", + }, + }, +}; + +export const parameters10: OperationParameter = { parameterPath: "parameters", - mapper: TransferProductRequestPropertiesMapper + mapper: BillingRoleAssignmentMapper, }; -export const periodStartDate: OperationQueryParameter = { - parameterPath: "periodStartDate", +export const roleDefinitionName: OperationURLParameter = { + parameterPath: "roleDefinitionName", mapper: { - serializedName: "periodStartDate", + constraints: { + Pattern: new RegExp( + "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$", + ), + }, + serializedName: "roleDefinitionName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const periodEndDate: OperationQueryParameter = { - parameterPath: "periodEndDate", +export const savingsPlanOrderId: OperationURLParameter = { + parameterPath: "savingsPlanOrderId", mapper: { - serializedName: "periodEndDate", + serializedName: "savingsPlanOrderId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const invoiceName: OperationURLParameter = { - parameterPath: "invoiceName", +export const skiptoken: OperationQueryParameter = { + parameterPath: ["options", "skiptoken"], mapper: { - serializedName: "invoiceName", + serializedName: "skiptoken", + type: { + name: "Number", + }, + }, +}; + +export const take: OperationQueryParameter = { + parameterPath: ["options", "take"], + mapper: { + serializedName: "take", + type: { + name: "Number", + }, + }, +}; + +export const selectedState: OperationQueryParameter = { + parameterPath: ["options", "selectedState"], + mapper: { + serializedName: "selectedState", + type: { + name: "String", + }, + }, +}; + +export const refreshSummary: OperationQueryParameter = { + parameterPath: ["options", "refreshSummary"], + mapper: { + serializedName: "refreshSummary", + type: { + name: "String", + }, + }, +}; + +export const savingsPlanId: OperationURLParameter = { + parameterPath: "savingsPlanId", + mapper: { + serializedName: "savingsPlanId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: SavingsPlanUpdateRequestMapper, +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: SavingsPlanUpdateValidateRequestMapper, }; -export const downloadToken: OperationQueryParameter = { - parameterPath: "downloadToken", +export const billingAccountName1: OperationURLParameter = { + parameterPath: "billingAccountName", mapper: { - serializedName: "downloadToken", + serializedName: "billingAccountName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const downloadUrls: OperationParameter = { - parameterPath: "downloadUrls", +export const billingProfileName1: OperationURLParameter = { + parameterPath: "billingProfileName", mapper: { - serializedName: "downloadUrls", + serializedName: "billingProfileName", required: true, type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } + name: "String", + }, + }, }; -export const parameters8: OperationParameter = { +export const billingSubscriptionName: OperationURLParameter = { + parameterPath: "billingSubscriptionName", + mapper: { + serializedName: "billingSubscriptionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const customerName1: OperationURLParameter = { + parameterPath: "customerName", + mapper: { + serializedName: "customerName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const invoiceSectionName1: OperationURLParameter = { + parameterPath: "invoiceSectionName", + mapper: { + serializedName: "invoiceSectionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const parameters11: OperationParameter = { parameterPath: "parameters", - mapper: PolicyMapper + mapper: CancelSubscriptionRequestMapper, }; -export const parameters9: OperationParameter = { +export const parameters12: OperationParameter = { parameterPath: "parameters", - mapper: CustomerPolicyMapper + mapper: BillingSubscriptionMergeRequestMapper, }; -export const parameters10: OperationParameter = { +export const parameters13: OperationParameter = { + parameterPath: "parameters", + mapper: MoveBillingSubscriptionRequestMapper, +}; + +export const parameters14: OperationParameter = { + parameterPath: "parameters", + mapper: BillingSubscriptionSplitRequestMapper, +}; + +export const parameters15: OperationParameter = { parameterPath: "parameters", - mapper: BillingPropertyMapper + mapper: BillingSubscriptionPatchMapper, }; -export const billingRoleDefinitionName: OperationURLParameter = { - parameterPath: "billingRoleDefinitionName", +export const includeTenantSubscriptions: OperationQueryParameter = { + parameterPath: ["options", "includeTenantSubscriptions"], mapper: { - serializedName: "billingRoleDefinitionName", + defaultValue: false, + serializedName: "includeTenantSubscriptions", + type: { + name: "Boolean", + }, + }, +}; + +export const includeFailed: OperationQueryParameter = { + parameterPath: ["options", "includeFailed"], + mapper: { + defaultValue: false, + serializedName: "includeFailed", + type: { + name: "Boolean", + }, + }, +}; + +export const aliasName: OperationURLParameter = { + parameterPath: "aliasName", + mapper: { + serializedName: "aliasName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const billingRoleAssignmentName: OperationURLParameter = { - parameterPath: "billingRoleAssignmentName", +export const parameters16: OperationParameter = { + parameterPath: "parameters", + mapper: BillingSubscriptionAliasMapper, +}; + +export const periodStartDate: OperationQueryParameter = { + parameterPath: ["options", "periodStartDate"], mapper: { - serializedName: "billingRoleAssignmentName", + serializedName: "periodStartDate", + type: { + name: "Date", + }, + }, +}; + +export const periodEndDate: OperationQueryParameter = { + parameterPath: ["options", "periodEndDate"], + mapper: { + serializedName: "periodEndDate", + type: { + name: "Date", + }, + }, +}; + +export const parameters17: OperationParameter = { + parameterPath: "parameters", + mapper: { + serializedName: "parameters", required: true, type: { - name: "String" - } - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DocumentDownloadRequest", + }, + }, + }, + }, }; -export const agreementName: OperationURLParameter = { - parameterPath: "agreementName", +export const invoiceName: OperationURLParameter = { + parameterPath: "invoiceName", mapper: { - serializedName: "agreementName", + constraints: { + Pattern: new RegExp( + "^(H[0-9]-[A-Z0-9]+)$|^(?:([GHT]|HT){1}[A-Z0-9]{9})$|^(?:[D]{1}[A-Z0-9]{9})$|^(?:E{1}[B-Z0-9]{1}[A-Z0-9]{8})$|^(?:EA[A-Z0-9]{8})$", + ), + }, + serializedName: "invoiceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const orderby: OperationQueryParameter = { - parameterPath: ["options", "orderby"], +export const documentName: OperationQueryParameter = { + parameterPath: ["options", "documentName"], mapper: { - serializedName: "$orderby", + serializedName: "documentName", type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const refreshSummary: OperationQueryParameter = { - parameterPath: ["options", "refreshSummary"], +export const parameters18: OperationParameter = { + parameterPath: "parameters", + mapper: InvoiceSectionMapper, +}; + +export const paymentMethodName: OperationURLParameter = { + parameterPath: "paymentMethodName", mapper: { - serializedName: "refreshSummary", + serializedName: "paymentMethodName", + required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const selectedState: OperationQueryParameter = { - parameterPath: ["options", "selectedState"], +export const policyName: OperationURLParameter = { + parameterPath: "policyName", mapper: { - serializedName: "selectedState", + serializedName: "policyName", + required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const apiVersion1: OperationQueryParameter = { - parameterPath: "apiVersion", +export const parameters19: OperationParameter = { + parameterPath: "parameters", + mapper: CustomerPolicyMapper, +}; + +export const parameters20: OperationParameter = { + parameterPath: "parameters", + mapper: BillingProfilePolicyMapper, +}; + +export const parameters21: OperationParameter = { + parameterPath: "parameters", + mapper: BillingAccountPolicyMapper, +}; + +export const parameters22: OperationParameter = { + parameterPath: "parameters", + mapper: MoveProductRequestMapper, +}; + +export const productName: OperationURLParameter = { + parameterPath: "productName", mapper: { - defaultValue: "2018-03-01-preview", - isConstant: true, - serializedName: "api-version", + constraints: { + Pattern: new RegExp( + "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$", + ), + }, + serializedName: "productName", + required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const name: OperationURLParameter = { - parameterPath: "name", +export const parameters23: OperationParameter = { + parameterPath: "parameters", + mapper: ProductPatchMapper, +}; + +export const reservationOrderId: OperationURLParameter = { + parameterPath: "reservationOrderId", mapper: { - serializedName: "name", + serializedName: "reservationOrderId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const skiptoken: OperationQueryParameter = { - parameterPath: ["options", "skiptoken"], +export const reservationId: OperationURLParameter = { + parameterPath: "reservationId", mapper: { - serializedName: "$skiptoken", + serializedName: "reservationId", + required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const top: OperationQueryParameter = { - parameterPath: ["options", "top"], +export const body2: OperationParameter = { + parameterPath: "body", + mapper: PatchMapper, +}; + +export const periodStartDate1: OperationQueryParameter = { + parameterPath: "periodStartDate", mapper: { - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 1 + serializedName: "periodStartDate", + required: true, + type: { + name: "Date", }, - serializedName: "$top", + }, +}; + +export const periodEndDate1: OperationQueryParameter = { + parameterPath: "periodEndDate", + mapper: { + serializedName: "periodEndDate", + required: true, type: { - name: "Number" - } - } + name: "Date", + }, + }, }; -export const billingPeriodName: OperationURLParameter = { - parameterPath: "billingPeriodName", +export const typeParam: OperationQueryParameter = { + parameterPath: "typeParam", mapper: { - serializedName: "billingPeriodName", + serializedName: "type", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const transferName: OperationURLParameter = { + parameterPath: "transferName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-z0-9]*$"), + }, + serializedName: "transferName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const parameters24: OperationParameter = { + parameterPath: "parameters", + mapper: InitiateTransferRequestMapper, +}; + +export const parameters25: OperationParameter = { + parameterPath: "parameters", + mapper: PartnerInitiateTransferRequestMapper, +}; + +export const parameters26: OperationParameter = { + parameterPath: "parameters", + mapper: AcceptTransferRequestMapper, }; diff --git a/sdk/billing/arm-billing/src/operations/address.ts b/sdk/billing/arm-billing/src/operations/address.ts index 62621f09d8ac..d55423f03506 100644 --- a/sdk/billing/arm-billing/src/operations/address.ts +++ b/sdk/billing/arm-billing/src/operations/address.ts @@ -14,7 +14,7 @@ import { BillingManagementClient } from "../billingManagementClient"; import { AddressDetails, AddressValidateOptionalParams, - AddressValidateResponse + AddressValidateResponse, } from "../models"; /** Class containing Address operations. */ @@ -32,16 +32,16 @@ export class AddressImpl implements Address { /** * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo * address. - * @param address Address details. + * @param parameters Address details. * @param options The options parameters. */ validate( - address: AddressDetails, - options?: AddressValidateOptionalParams + parameters: AddressDetails, + options?: AddressValidateOptionalParams, ): Promise { return this.client.sendOperationRequest( - { address, options }, - validateOperationSpec + { parameters, options }, + validateOperationSpec, ); } } @@ -53,16 +53,16 @@ const validateOperationSpec: coreClient.OperationSpec = { httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ValidateAddressResponse + bodyMapper: Mappers.AddressValidationResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.address, + requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/agreements.ts b/sdk/billing/arm-billing/src/operations/agreements.ts index 7b4443a749fa..b27a288e37db 100644 --- a/sdk/billing/arm-billing/src/operations/agreements.ts +++ b/sdk/billing/arm-billing/src/operations/agreements.ts @@ -20,7 +20,7 @@ import { AgreementsListByBillingAccountResponse, AgreementsGetOptionalParams, AgreementsGetResponse, - AgreementsListByBillingAccountNextResponse + AgreementsListByBillingAccountNextResponse, } from "../models"; /// @@ -43,11 +43,11 @@ export class AgreementsImpl implements Agreements { */ public listByBillingAccount( billingAccountName: string, - options?: AgreementsListByBillingAccountOptionalParams + options?: AgreementsListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByBillingAccountPagingAll( billingAccountName, - options + options, ); return { next() { @@ -63,16 +63,16 @@ export class AgreementsImpl implements Agreements { return this.listByBillingAccountPagingPage( billingAccountName, options, - settings + settings, ); - } + }, }; } private async *listByBillingAccountPagingPage( billingAccountName: string, options?: AgreementsListByBillingAccountOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: AgreementsListByBillingAccountResponse; let continuationToken = settings?.continuationToken; @@ -87,7 +87,7 @@ export class AgreementsImpl implements Agreements { result = await this._listByBillingAccountNext( billingAccountName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -98,45 +98,45 @@ export class AgreementsImpl implements Agreements { private async *listByBillingAccountPagingAll( billingAccountName: string, - options?: AgreementsListByBillingAccountOptionalParams + options?: AgreementsListByBillingAccountOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByBillingAccountPagingPage( billingAccountName, - options + options, )) { yield* page; } } /** - * Lists the agreements for a billing account. + * Gets an agreement by ID. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param agreementName The ID that uniquely identifies an agreement. * @param options The options parameters. */ - private _listByBillingAccount( + get( billingAccountName: string, - options?: AgreementsListByBillingAccountOptionalParams - ): Promise { + agreementName: string, + options?: AgreementsGetOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, options }, - listByBillingAccountOperationSpec + { billingAccountName, agreementName, options }, + getOperationSpec, ); } /** - * Gets an agreement by ID. + * Lists the agreements for a billing account. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. * @param options The options parameters. */ - get( + private _listByBillingAccount( billingAccountName: string, - agreementName: string, - options?: AgreementsGetOptionalParams - ): Promise { + options?: AgreementsListByBillingAccountOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, agreementName, options }, - getOperationSpec + { billingAccountName, options }, + listByBillingAccountOperationSpec, ); } @@ -149,72 +149,69 @@ export class AgreementsImpl implements Agreements { private _listByBillingAccountNext( billingAccountName: string, nextLink: string, - options?: AgreementsListByBillingAccountNextOptionalParams + options?: AgreementsListByBillingAccountNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, nextLink, options }, - listByBillingAccountNextOperationSpec + listByBillingAccountNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements", +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/{agreementName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AgreementListResult + bodyMapper: Mappers.Agreement, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [Parameters.$host, Parameters.billingAccountName], + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.agreementName, + ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/{agreementName}", +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Agreement + bodyMapper: Mappers.AgreementListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.agreementName - ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AgreementListResult + bodyMapper: Mappers.AgreementListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/associatedTenants.ts b/sdk/billing/arm-billing/src/operations/associatedTenants.ts new file mode 100644 index 000000000000..77f6f5c72e9c --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/associatedTenants.ts @@ -0,0 +1,485 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { AssociatedTenants } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + AssociatedTenant, + AssociatedTenantsListByBillingAccountNextOptionalParams, + AssociatedTenantsListByBillingAccountOptionalParams, + AssociatedTenantsListByBillingAccountResponse, + AssociatedTenantsDeleteOptionalParams, + AssociatedTenantsDeleteResponse, + AssociatedTenantsGetOptionalParams, + AssociatedTenantsGetResponse, + AssociatedTenantsCreateOrUpdateOptionalParams, + AssociatedTenantsCreateOrUpdateResponse, + AssociatedTenantsListByBillingAccountNextResponse, +} from "../models"; + +/// +/** Class containing AssociatedTenants operations. */ +export class AssociatedTenantsImpl implements AssociatedTenants { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class AssociatedTenants class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * Lists the associated tenants that can collaborate with the billing account on commerce activities + * like viewing and downloading invoices, managing payments, making purchases, and managing or + * provisioning licenses. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountName: string, + options?: AssociatedTenantsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: AssociatedTenantsListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: AssociatedTenantsListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: AssociatedTenantsListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * Deletes an associated tenant for a billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param options The options parameters. + */ + async beginDelete( + billingAccountName: string, + associatedTenantName: string, + options?: AssociatedTenantsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AssociatedTenantsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, associatedTenantName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + AssociatedTenantsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an associated tenant for a billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param options The options parameters. + */ + async beginDeleteAndWait( + billingAccountName: string, + associatedTenantName: string, + options?: AssociatedTenantsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + billingAccountName, + associatedTenantName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Gets an associated tenant by ID. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param options The options parameters. + */ + get( + billingAccountName: string, + associatedTenantName: string, + options?: AssociatedTenantsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, associatedTenantName, options }, + getOperationSpec, + ); + } + + /** + * Create or update an associated tenant for the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param parameters An associated tenant. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + billingAccountName: string, + associatedTenantName: string, + parameters: AssociatedTenant, + options?: AssociatedTenantsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AssociatedTenantsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, associatedTenantName, parameters, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + AssociatedTenantsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Create or update an associated tenant for the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param parameters An associated tenant. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + billingAccountName: string, + associatedTenantName: string, + parameters: AssociatedTenant, + options?: AssociatedTenantsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + billingAccountName, + associatedTenantName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the associated tenants that can collaborate with the billing account on commerce activities + * like viewing and downloading invoices, managing payments, making purchases, and managing or + * provisioning licenses. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: AssociatedTenantsListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: AssociatedTenantsListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/associatedTenants/{associatedTenantName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.AssociatedTenantsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.AssociatedTenantsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.AssociatedTenantsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.AssociatedTenantsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.associatedTenantName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/associatedTenants/{associatedTenantName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AssociatedTenant, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.associatedTenantName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/associatedTenants/{associatedTenantName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AssociatedTenant, + }, + 201: { + bodyMapper: Mappers.AssociatedTenant, + }, + 202: { + bodyMapper: Mappers.AssociatedTenant, + }, + 204: { + bodyMapper: Mappers.AssociatedTenant, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.associatedTenantName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/associatedTenants", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AssociatedTenantListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.includeRevoked, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AssociatedTenantListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/availableBalances.ts b/sdk/billing/arm-billing/src/operations/availableBalances.ts index ddfdac20f8dd..f18971962778 100644 --- a/sdk/billing/arm-billing/src/operations/availableBalances.ts +++ b/sdk/billing/arm-billing/src/operations/availableBalances.ts @@ -12,8 +12,10 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; import { - AvailableBalancesGetOptionalParams, - AvailableBalancesGetResponse + AvailableBalancesGetByBillingAccountOptionalParams, + AvailableBalancesGetByBillingAccountResponse, + AvailableBalancesGetByBillingProfileOptionalParams, + AvailableBalancesGetByBillingProfileResponse, } from "../models"; /** Class containing AvailableBalances operations. */ @@ -29,45 +31,79 @@ export class AvailableBalancesImpl implements AvailableBalances { } /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now - * to settle due or past due invoices. The operation is supported only for billing accounts with + * The Available Credit or Payment on Account Balance for a billing account. The credit balance can be + * used to settle due or past due invoices and is supported for billing accounts with agreement type + * Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with + * agreement type Microsoft Customer Agreement or Microsoft Online Services Program. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + options?: AvailableBalancesGetByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + getByBillingAccountOperationSpec, + ); + } + + /** + * The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be + * used to settle due or past due invoices and is supported for billing accounts with agreement type + * Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with * agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - get( + getByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: AvailableBalancesGetOptionalParams - ): Promise { + options?: AvailableBalancesGetByBillingProfileOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, options }, - getOperationSpec + getByBillingProfileOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const getOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default", +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/availableBalance/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AvailableBalance, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const getByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AvailableBalance + bodyMapper: Mappers.AvailableBalance, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/billingAccounts.ts b/sdk/billing/arm-billing/src/operations/billingAccounts.ts index 8f4a47b5a879..8def2b303186 100644 --- a/sdk/billing/arm-billing/src/operations/billingAccounts.ts +++ b/sdk/billing/arm-billing/src/operations/billingAccounts.ts @@ -13,24 +13,37 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; import { - BillingAccount, - BillingAccountsListNextOptionalParams, - BillingAccountsListOptionalParams, - BillingAccountsListResponse, + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { InvoiceSectionWithCreateSubPermission, BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextOptionalParams, BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams, BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionResponse, + BillingAccount, + BillingAccountsListNextOptionalParams, + BillingAccountsListOptionalParams, + BillingAccountsListResponse, + PaymentTerm, + BillingAccountsAddPaymentTermsOptionalParams, + BillingAccountsAddPaymentTermsResponse, + BillingAccountsCancelPaymentTermsOptionalParams, + BillingAccountsCancelPaymentTermsResponse, + BillingAccountsConfirmTransitionOptionalParams, + BillingAccountsConfirmTransitionResponse, + BillingAccountsValidatePaymentTermsOptionalParams, + BillingAccountsValidatePaymentTermsResponse, BillingAccountsGetOptionalParams, BillingAccountsGetResponse, - BillingAccountUpdateRequest, + BillingAccountPatch, BillingAccountsUpdateOptionalParams, BillingAccountsUpdateResponse, + BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextResponse, BillingAccountsListNextResponse, - BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextResponse } from "../models"; /// @@ -47,13 +60,20 @@ export class BillingAccountsImpl implements BillingAccounts { } /** - * Lists the billing accounts that a user has access to. + * Lists the invoice sections for which the user has permission to create Azure subscriptions. The + * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ - public list( - options?: BillingAccountsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + public listInvoiceSectionsByCreateSubscriptionPermission( + billingAccountName: string, + options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = + this.listInvoiceSectionsByCreateSubscriptionPermissionPagingAll( + billingAccountName, + options, + ); return { next() { return iter.next(); @@ -65,26 +85,39 @@ export class BillingAccountsImpl implements BillingAccounts { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage(options, settings); - } + return this.listInvoiceSectionsByCreateSubscriptionPermissionPagingPage( + billingAccountName, + options, + settings, + ); + }, }; } - private async *listPagingPage( - options?: BillingAccountsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingAccountsListResponse; + private async *listInvoiceSectionsByCreateSubscriptionPermissionPagingPage( + billingAccountName: string, + options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._list(options); + result = await this._listInvoiceSectionsByCreateSubscriptionPermission( + billingAccountName, + options, + ); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = + await this._listInvoiceSectionsByCreateSubscriptionPermissionNext( + billingAccountName, + continuationToken, + options, + ); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -92,28 +125,26 @@ export class BillingAccountsImpl implements BillingAccounts { } } - private async *listPagingAll( - options?: BillingAccountsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + private async *listInvoiceSectionsByCreateSubscriptionPermissionPagingAll( + billingAccountName: string, + options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listInvoiceSectionsByCreateSubscriptionPermissionPagingPage( + billingAccountName, + options, + )) { yield* page; } } /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. + * Lists the billing accounts that a user has access to. * @param options The options parameters. */ - public listInvoiceSectionsByCreateSubscriptionPermission( - billingAccountName: string, - options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listInvoiceSectionsByCreateSubscriptionPermissionPagingAll( - billingAccountName, - options - ); + public list( + options?: BillingAccountsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); return { next() { return iter.next(); @@ -125,38 +156,26 @@ export class BillingAccountsImpl implements BillingAccounts { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listInvoiceSectionsByCreateSubscriptionPermissionPagingPage( - billingAccountName, - options, - settings - ); - } + return this.listPagingPage(options, settings); + }, }; } - private async *listInvoiceSectionsByCreateSubscriptionPermissionPagingPage( - billingAccountName: string, - options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionResponse; + private async *listPagingPage( + options?: BillingAccountsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingAccountsListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listInvoiceSectionsByCreateSubscriptionPermission( - billingAccountName, - options - ); + result = await this._list(options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listInvoiceSectionsByCreateSubscriptionPermissionNext( - billingAccountName, - continuationToken, - options - ); + result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -164,77 +183,144 @@ export class BillingAccountsImpl implements BillingAccounts { } } - private async *listInvoiceSectionsByCreateSubscriptionPermissionPagingAll( - billingAccountName: string, - options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listInvoiceSectionsByCreateSubscriptionPermissionPagingPage( - billingAccountName, - options - )) { + private async *listPagingAll( + options?: BillingAccountsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { yield* page; } } /** - * Lists the billing accounts that a user has access to. + * Adds payment terms to all the billing profiles under the billing account. Currently, payment terms + * can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and + * AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are + * authorized to add the payment terms and is not a self-serve action. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of payment term. * @param options The options parameters. */ - private _list( - options?: BillingAccountsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + async beginAddPaymentTerms( + billingAccountName: string, + parameters: PaymentTerm[], + options?: BillingAccountsAddPaymentTermsOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingAccountsAddPaymentTermsResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, parameters, options }, + spec: addPaymentTermsOperationSpec, + }); + const poller = await createHttpPoller< + BillingAccountsAddPaymentTermsResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; } /** - * Gets a billing account by its ID. + * Adds payment terms to all the billing profiles under the billing account. Currently, payment terms + * can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and + * AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are + * authorized to add the payment terms and is not a self-serve action. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of payment term. * @param options The options parameters. */ - get( + async beginAddPaymentTermsAndWait( billingAccountName: string, - options?: BillingAccountsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, options }, - getOperationSpec + parameters: PaymentTerm[], + options?: BillingAccountsAddPaymentTermsOptionalParams, + ): Promise { + const poller = await this.beginAddPaymentTerms( + billingAccountName, + parameters, + options, ); + return poller.pollUntilDone(); } /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Cancels all the payment terms on billing account that falls after the cancellation date in the + * request. Currently, cancel payment terms is only served by admin actions and is not a self-serve + * action. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. + * @param parameters Date after which any payment terms that needs to be cancelled. * @param options The options parameters. */ - async beginUpdate( + async beginCancelPaymentTerms( billingAccountName: string, - parameters: BillingAccountUpdateRequest, - options?: BillingAccountsUpdateOptionalParams + parameters: Date, + options?: BillingAccountsCancelPaymentTermsOptionalParams, ): Promise< - PollerLike< - PollOperationState, - BillingAccountsUpdateResponse + SimplePollerLike< + OperationState, + BillingAccountsCancelPaymentTermsResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -243,8 +329,8 @@ export class BillingAccountsImpl implements BillingAccounts { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -252,45 +338,65 @@ export class BillingAccountsImpl implements BillingAccounts { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { billingAccountName, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, parameters, options }, + spec: cancelPaymentTermsOperationSpec, + }); + const poller = await createHttpPoller< + BillingAccountsCancelPaymentTermsResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Cancels all the payment terms on billing account that falls after the cancellation date in the + * request. Currently, cancel payment terms is only served by admin actions and is not a self-serve + * action. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. + * @param parameters Date after which any payment terms that needs to be cancelled. * @param options The options parameters. */ - async beginUpdateAndWait( + async beginCancelPaymentTermsAndWait( billingAccountName: string, - parameters: BillingAccountUpdateRequest, - options?: BillingAccountsUpdateOptionalParams - ): Promise { - const poller = await this.beginUpdate( + parameters: Date, + options?: BillingAccountsCancelPaymentTermsOptionalParams, + ): Promise { + const poller = await this.beginCancelPaymentTerms( billingAccountName, parameters, - options + options, ); return poller.pollUntilDone(); } + /** + * Gets the transition details for a billing account that has transitioned from agreement type + * Microsoft Online Services Program to agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + confirmTransition( + billingAccountName: string, + options?: BillingAccountsConfirmTransitionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + confirmTransitionOperationSpec, + ); + } + /** * Lists the invoice sections for which the user has permission to create Azure subscriptions. The * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. @@ -299,31 +405,155 @@ export class BillingAccountsImpl implements BillingAccounts { */ private _listInvoiceSectionsByCreateSubscriptionPermission( billingAccountName: string, - options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams - ): Promise< - BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionResponse - > { + options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, options }, - listInvoiceSectionsByCreateSubscriptionPermissionOperationSpec + listInvoiceSectionsByCreateSubscriptionPermissionOperationSpec, ); } /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. + * Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and + * account type 'Enterprise'. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of payment term. * @param options The options parameters. */ - private _listNext( - nextLink: string, - options?: BillingAccountsListNextOptionalParams - ): Promise { + validatePaymentTerms( + billingAccountName: string, + parameters: PaymentTerm[], + options?: BillingAccountsValidatePaymentTermsOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec + { billingAccountName, parameters, options }, + validatePaymentTermsOperationSpec, ); } + /** + * Gets a billing account by its ID. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + get( + billingAccountName: string, + options?: BillingAccountsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + getOperationSpec, + ); + } + + /** + * Updates the properties of a billing account. Currently, displayName and address can be updated for + * billing accounts with agreement type Microsoft Customer Agreement. Currently address and + * notification email address can be updated for billing accounts with agreement type Microsoft Online + * Services Agreement. Currently, purchase order number can be edited for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters A billing account. + * @param options The options parameters. + */ + async beginUpdate( + billingAccountName: string, + parameters: BillingAccountPatch, + options?: BillingAccountsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingAccountsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, parameters, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + BillingAccountsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Updates the properties of a billing account. Currently, displayName and address can be updated for + * billing accounts with agreement type Microsoft Customer Agreement. Currently address and + * notification email address can be updated for billing accounts with agreement type Microsoft Online + * Services Agreement. Currently, purchase order number can be edited for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters A billing account. + * @param options The options parameters. + */ + async beginUpdateAndWait( + billingAccountName: string, + parameters: BillingAccountPatch, + options?: BillingAccountsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + billingAccountName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the billing accounts that a user has access to. + * @param options The options parameters. + */ + private _list( + options?: BillingAccountsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** * ListInvoiceSectionsByCreateSubscriptionPermissionNext * @param billingAccountName The ID that uniquely identifies a billing account. @@ -334,128 +564,242 @@ export class BillingAccountsImpl implements BillingAccounts { private _listInvoiceSectionsByCreateSubscriptionPermissionNext( billingAccountName: string, nextLink: string, - options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextOptionalParams - ): Promise< - BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextResponse - > { + options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, nextLink, options }, - listInvoiceSectionsByCreateSubscriptionPermissionNextOperationSpec + listInvoiceSectionsByCreateSubscriptionPermissionNextOperationSpec, + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: BillingAccountsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Billing/billingAccounts", - httpMethod: "GET", +const addPaymentTermsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/addPaymentTerms", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.BillingAccountListResult + bodyMapper: Mappers.BillingAccount, + }, + 201: { + bodyMapper: Mappers.BillingAccount, + }, + 202: { + bodyMapper: Mappers.BillingAccount, + }, + 204: { + bodyMapper: Mappers.BillingAccount, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [Parameters.$host], + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const cancelPaymentTermsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/cancelPaymentTerms", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingAccount, + }, + 201: { + bodyMapper: Mappers.BillingAccount, + }, + 202: { + bodyMapper: Mappers.BillingAccount, + }, + 204: { + bodyMapper: Mappers.BillingAccount, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const confirmTransitionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/confirmTransition", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.TransitionDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const listInvoiceSectionsByCreateSubscriptionPermissionOperationSpec: coreClient.OperationSpec = + { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.InvoiceSectionWithCreateSubPermissionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, + }; +const validatePaymentTermsOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/validatePaymentTerms", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PaymentTermsEligibilityResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; const getOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingAccount + bodyMapper: Mappers.BillingAccount, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.billingAccountName], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.BillingAccount + bodyMapper: Mappers.BillingAccount, }, 201: { - bodyMapper: Mappers.BillingAccount + bodyMapper: Mappers.BillingAccount, }, 202: { - bodyMapper: Mappers.BillingAccount + bodyMapper: Mappers.BillingAccount, }, 204: { - bodyMapper: Mappers.BillingAccount + bodyMapper: Mappers.BillingAccount, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters, + requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.billingAccountName], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const listInvoiceSectionsByCreateSubscriptionPermissionOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission", - httpMethod: "POST", +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.InvoiceSectionListWithCreateSubPermissionResult + bodyMapper: Mappers.BillingAccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.billingAccountName], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.top, + Parameters.skip, + Parameters.search, + Parameters.includeAll, + Parameters.includeAllWithoutBillingProfiles, + Parameters.includeDeleted, + Parameters.includePendingAgreement, + Parameters.includeResellee, + Parameters.legalOwnerTID, + Parameters.legalOwnerOID, + ], + urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; +const listInvoiceSectionsByCreateSubscriptionPermissionNextOperationSpec: coreClient.OperationSpec = + { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.InvoiceSectionWithCreateSubPermissionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, + }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingAccountListResult + bodyMapper: Mappers.BillingAccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; -const listInvoiceSectionsByCreateSubscriptionPermissionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.InvoiceSectionListWithCreateSubPermissionResult + bodyMapper: Mappers.ErrorResponse, }, - default: { - bodyMapper: Mappers.ErrorResponse - } }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.nextLink - ], + urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/billingPeriods.ts b/sdk/billing/arm-billing/src/operations/billingPeriods.ts deleted file mode 100644 index 41ee629f89fb..000000000000 --- a/sdk/billing/arm-billing/src/operations/billingPeriods.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { BillingPeriods } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { BillingManagementClient } from "../billingManagementClient"; -import { - BillingPeriod, - BillingPeriodsListNextOptionalParams, - BillingPeriodsListOptionalParams, - BillingPeriodsListResponse, - BillingPeriodsGetOptionalParams, - BillingPeriodsGetResponse, - BillingPeriodsListNextResponse -} from "../models"; - -/// -/** Class containing BillingPeriods operations. */ -export class BillingPeriodsImpl implements BillingPeriods { - private readonly client: BillingManagementClient; - - /** - * Initialize a new instance of the class BillingPeriods class. - * @param client Reference to the service client - */ - constructor(client: BillingManagementClient) { - this.client = client; - } - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only - * supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased - * directly through the Azure web portal are not supported through this preview API. - * @param options The options parameters. - */ - public list( - options?: BillingPeriodsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - } - }; - } - - private async *listPagingPage( - options?: BillingPeriodsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingPeriodsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: BillingPeriodsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only - * supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased - * directly through the Azure web portal are not supported through this preview API. - * @param options The options parameters. - */ - private _list( - options?: BillingPeriodsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other - * subscription types which were not purchased directly through the Azure web portal are not supported - * through this preview API. - * @param billingPeriodName The name of a BillingPeriod resource. - * @param options The options parameters. - */ - get( - billingPeriodName: string, - options?: BillingPeriodsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingPeriodName, options }, - getOperationSpec - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: BillingPeriodsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingPeriodsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.filter, - Parameters.apiVersion1, - Parameters.skiptoken, - Parameters.top - ], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingPeriod - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.billingPeriodName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingPeriodsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.filter, - Parameters.apiVersion1, - Parameters.skiptoken, - Parameters.top - ], - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/billing/arm-billing/src/operations/billingPermissions.ts b/sdk/billing/arm-billing/src/operations/billingPermissions.ts index c7aa3ff80765..79c96139ad1f 100644 --- a/sdk/billing/arm-billing/src/operations/billingPermissions.ts +++ b/sdk/billing/arm-billing/src/operations/billingPermissions.ts @@ -14,23 +14,48 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; import { - BillingPermissionsProperties, - BillingPermissionsListByCustomerNextOptionalParams, - BillingPermissionsListByCustomerOptionalParams, - BillingPermissionsListByCustomerResponse, + BillingPermission, BillingPermissionsListByBillingAccountNextOptionalParams, BillingPermissionsListByBillingAccountOptionalParams, BillingPermissionsListByBillingAccountResponse, - BillingPermissionsListByInvoiceSectionsNextOptionalParams, - BillingPermissionsListByInvoiceSectionsOptionalParams, - BillingPermissionsListByInvoiceSectionsResponse, BillingPermissionsListByBillingProfileNextOptionalParams, BillingPermissionsListByBillingProfileOptionalParams, BillingPermissionsListByBillingProfileResponse, - BillingPermissionsListByCustomerNextResponse, + BillingPermissionsListByCustomerNextOptionalParams, + BillingPermissionsListByCustomerOptionalParams, + BillingPermissionsListByCustomerResponse, + BillingPermissionsListByInvoiceSectionNextOptionalParams, + BillingPermissionsListByInvoiceSectionOptionalParams, + BillingPermissionsListByInvoiceSectionResponse, + BillingPermissionsListByCustomerAtBillingAccountNextOptionalParams, + BillingPermissionsListByCustomerAtBillingAccountOptionalParams, + BillingPermissionsListByCustomerAtBillingAccountResponse, + BillingPermissionsListByDepartmentNextOptionalParams, + BillingPermissionsListByDepartmentOptionalParams, + BillingPermissionsListByDepartmentResponse, + BillingPermissionsListByEnrollmentAccountNextOptionalParams, + BillingPermissionsListByEnrollmentAccountOptionalParams, + BillingPermissionsListByEnrollmentAccountResponse, + CheckAccessRequest, + BillingPermissionsCheckAccessByBillingProfileOptionalParams, + BillingPermissionsCheckAccessByBillingProfileResponse, + BillingPermissionsCheckAccessByCustomerOptionalParams, + BillingPermissionsCheckAccessByCustomerResponse, + BillingPermissionsCheckAccessByInvoiceSectionOptionalParams, + BillingPermissionsCheckAccessByInvoiceSectionResponse, + BillingPermissionsCheckAccessByBillingAccountOptionalParams, + BillingPermissionsCheckAccessByBillingAccountResponse, + BillingPermissionsCheckAccessByDepartmentOptionalParams, + BillingPermissionsCheckAccessByDepartmentResponse, + BillingPermissionsCheckAccessByEnrollmentAccountOptionalParams, + BillingPermissionsCheckAccessByEnrollmentAccountResponse, BillingPermissionsListByBillingAccountNextResponse, - BillingPermissionsListByInvoiceSectionsNextResponse, - BillingPermissionsListByBillingProfileNextResponse + BillingPermissionsListByBillingProfileNextResponse, + BillingPermissionsListByCustomerNextResponse, + BillingPermissionsListByInvoiceSectionNextResponse, + BillingPermissionsListByCustomerAtBillingAccountNextResponse, + BillingPermissionsListByDepartmentNextResponse, + BillingPermissionsListByEnrollmentAccountNextResponse, } from "../models"; /// @@ -47,20 +72,17 @@ export class BillingPermissionsImpl implements BillingPermissions { } /** - * Lists the billing permissions the caller has for a customer. + * Lists the billing permissions the caller has on a billing account. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - public listByCustomer( + public listByBillingAccount( billingAccountName: string, - customerName: string, - options?: BillingPermissionsListByCustomerOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByCustomerPagingAll( + options?: BillingPermissionsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( billingAccountName, - customerName, - options + options, ); return { next() { @@ -73,41 +95,34 @@ export class BillingPermissionsImpl implements BillingPermissions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByCustomerPagingPage( + return this.listByBillingAccountPagingPage( billingAccountName, - customerName, options, - settings + settings, ); - } + }, }; } - private async *listByCustomerPagingPage( + private async *listByBillingAccountPagingPage( billingAccountName: string, - customerName: string, - options?: BillingPermissionsListByCustomerOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingPermissionsListByCustomerResponse; + options?: BillingPermissionsListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingPermissionsListByBillingAccountResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByCustomer( - billingAccountName, - customerName, - options - ); + result = await this._listByBillingAccount(billingAccountName, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listByCustomerNext( + result = await this._listByBillingAccountNext( billingAccountName, - customerName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -116,32 +131,33 @@ export class BillingPermissionsImpl implements BillingPermissions { } } - private async *listByCustomerPagingAll( + private async *listByBillingAccountPagingAll( billingAccountName: string, - customerName: string, - options?: BillingPermissionsListByCustomerOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByCustomerPagingPage( + options?: BillingPermissionsListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( billingAccountName, - customerName, - options + options, )) { yield* page; } } /** - * Lists the billing permissions the caller has on a billing account. + * Lists the billing permissions the caller has on a billing profile. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - public listByBillingAccount( + public listByBillingProfile( billingAccountName: string, - options?: BillingPermissionsListByBillingAccountOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByBillingAccountPagingAll( + billingProfileName: string, + options?: BillingPermissionsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( billingAccountName, - options + billingProfileName, + options, ); return { next() { @@ -154,34 +170,41 @@ export class BillingPermissionsImpl implements BillingPermissions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingAccountPagingPage( + return this.listByBillingProfilePagingPage( billingAccountName, + billingProfileName, options, - settings + settings, ); - } + }, }; } - private async *listByBillingAccountPagingPage( + private async *listByBillingProfilePagingPage( billingAccountName: string, - options?: BillingPermissionsListByBillingAccountOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingPermissionsListByBillingAccountResponse; + billingProfileName: string, + options?: BillingPermissionsListByBillingProfileOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingPermissionsListByBillingProfileResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingAccount(billingAccountName, options); + result = await this._listByBillingProfile( + billingAccountName, + billingProfileName, + options, + ); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listByBillingAccountNext( + result = await this._listByBillingProfileNext( billingAccountName, + billingProfileName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -190,36 +213,38 @@ export class BillingPermissionsImpl implements BillingPermissions { } } - private async *listByBillingAccountPagingAll( + private async *listByBillingProfilePagingAll( billingAccountName: string, - options?: BillingPermissionsListByBillingAccountOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByBillingAccountPagingPage( + billingProfileName: string, + options?: BillingPermissionsListByBillingProfileOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( billingAccountName, - options + billingProfileName, + options, )) { yield* page; } } /** - * Lists the billing permissions the caller has on an invoice section. + * Lists the billing permissions the caller has for a customer. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - public listByInvoiceSections( + public listByCustomer( billingAccountName: string, billingProfileName: string, - invoiceSectionName: string, - options?: BillingPermissionsListByInvoiceSectionsOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByInvoiceSectionsPagingAll( + customerName: string, + options?: BillingPermissionsListByCustomerOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCustomerPagingAll( billingAccountName, billingProfileName, - invoiceSectionName, - options + customerName, + options, ); return { next() { @@ -232,32 +257,32 @@ export class BillingPermissionsImpl implements BillingPermissions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByInvoiceSectionsPagingPage( + return this.listByCustomerPagingPage( billingAccountName, billingProfileName, - invoiceSectionName, + customerName, options, - settings + settings, ); - } + }, }; } - private async *listByInvoiceSectionsPagingPage( + private async *listByCustomerPagingPage( billingAccountName: string, billingProfileName: string, - invoiceSectionName: string, - options?: BillingPermissionsListByInvoiceSectionsOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingPermissionsListByInvoiceSectionsResponse; + customerName: string, + options?: BillingPermissionsListByCustomerOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingPermissionsListByCustomerResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByInvoiceSections( + result = await this._listByCustomer( billingAccountName, billingProfileName, - invoiceSectionName, - options + customerName, + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -265,12 +290,12 @@ export class BillingPermissionsImpl implements BillingPermissions { yield page; } while (continuationToken) { - result = await this._listByInvoiceSectionsNext( + result = await this._listByCustomerNext( billingAccountName, billingProfileName, - invoiceSectionName, + customerName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -279,37 +304,40 @@ export class BillingPermissionsImpl implements BillingPermissions { } } - private async *listByInvoiceSectionsPagingAll( + private async *listByCustomerPagingAll( billingAccountName: string, billingProfileName: string, - invoiceSectionName: string, - options?: BillingPermissionsListByInvoiceSectionsOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByInvoiceSectionsPagingPage( + customerName: string, + options?: BillingPermissionsListByCustomerOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCustomerPagingPage( billingAccountName, billingProfileName, - invoiceSectionName, - options + customerName, + options, )) { yield* page; } } /** - * Lists the billing permissions the caller has on a billing profile. + * Lists the billing permissions the caller has for an invoice section. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - public listByBillingProfile( + public listByInvoiceSection( billingAccountName: string, billingProfileName: string, - options?: BillingPermissionsListByBillingProfileOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByBillingProfilePagingAll( + invoiceSectionName: string, + options?: BillingPermissionsListByInvoiceSectionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByInvoiceSectionPagingAll( billingAccountName, billingProfileName, - options + invoiceSectionName, + options, ); return { next() { @@ -322,29 +350,32 @@ export class BillingPermissionsImpl implements BillingPermissions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingProfilePagingPage( + return this.listByInvoiceSectionPagingPage( billingAccountName, billingProfileName, + invoiceSectionName, options, - settings + settings, ); - } + }, }; } - private async *listByBillingProfilePagingPage( + private async *listByInvoiceSectionPagingPage( billingAccountName: string, billingProfileName: string, - options?: BillingPermissionsListByBillingProfileOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingPermissionsListByBillingProfileResponse; + invoiceSectionName: string, + options?: BillingPermissionsListByInvoiceSectionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingPermissionsListByInvoiceSectionResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingProfile( + result = await this._listByInvoiceSection( billingAccountName, billingProfileName, - options + invoiceSectionName, + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -352,11 +383,12 @@ export class BillingPermissionsImpl implements BillingPermissions { yield page; } while (continuationToken) { - result = await this._listByBillingProfileNext( + result = await this._listByInvoiceSectionNext( billingAccountName, billingProfileName, + invoiceSectionName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -365,104 +397,520 @@ export class BillingPermissionsImpl implements BillingPermissions { } } - private async *listByBillingProfilePagingAll( + private async *listByInvoiceSectionPagingAll( billingAccountName: string, billingProfileName: string, - options?: BillingPermissionsListByBillingProfileOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByBillingProfilePagingPage( + invoiceSectionName: string, + options?: BillingPermissionsListByInvoiceSectionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByInvoiceSectionPagingPage( billingAccountName, billingProfileName, - options + invoiceSectionName, + options, )) { yield* page; } } /** - * Lists the billing permissions the caller has for a customer. + * Lists the billing permissions the caller has for a customer at billing account level. * @param billingAccountName The ID that uniquely identifies a billing account. * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - private _listByCustomer( + public listByCustomerAtBillingAccount( billingAccountName: string, customerName: string, - options?: BillingPermissionsListByCustomerOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, customerName, options }, - listByCustomerOperationSpec + options?: BillingPermissionsListByCustomerAtBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCustomerAtBillingAccountPagingAll( + billingAccountName, + customerName, + options, ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByCustomerAtBillingAccountPagingPage( + billingAccountName, + customerName, + options, + settings, + ); + }, + }; } - /** - * Lists the billing permissions the caller has on a billing account. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param options The options parameters. - */ - private _listByBillingAccount( + private async *listByCustomerAtBillingAccountPagingPage( billingAccountName: string, - options?: BillingPermissionsListByBillingAccountOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, options }, - listByBillingAccountOperationSpec - ); + customerName: string, + options?: BillingPermissionsListByCustomerAtBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingPermissionsListByCustomerAtBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCustomerAtBillingAccount( + billingAccountName, + customerName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCustomerAtBillingAccountNext( + billingAccountName, + customerName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCustomerAtBillingAccountPagingAll( + billingAccountName: string, + customerName: string, + options?: BillingPermissionsListByCustomerAtBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCustomerAtBillingAccountPagingPage( + billingAccountName, + customerName, + options, + )) { + yield* page; + } } /** - * Lists the billing permissions the caller has on an invoice section. + * Lists the billing permissions the caller has for a department. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param departmentName The name of the department. * @param options The options parameters. */ - private _listByInvoiceSections( + public listByDepartment( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: BillingPermissionsListByInvoiceSectionsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, invoiceSectionName, options }, - listByInvoiceSectionsOperationSpec + departmentName: string, + options?: BillingPermissionsListByDepartmentOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByDepartmentPagingAll( + billingAccountName, + departmentName, + options, ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByDepartmentPagingPage( + billingAccountName, + departmentName, + options, + settings, + ); + }, + }; + } + + private async *listByDepartmentPagingPage( + billingAccountName: string, + departmentName: string, + options?: BillingPermissionsListByDepartmentOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingPermissionsListByDepartmentResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByDepartment( + billingAccountName, + departmentName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByDepartmentNext( + billingAccountName, + departmentName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByDepartmentPagingAll( + billingAccountName: string, + departmentName: string, + options?: BillingPermissionsListByDepartmentOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByDepartmentPagingPage( + billingAccountName, + departmentName, + options, + )) { + yield* page; + } } /** - * Lists the billing permissions the caller has on a billing profile. + * Lists the billing permissions the caller has for an enrollment account. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param enrollmentAccountName The name of the enrollment account. * @param options The options parameters. */ - private _listByBillingProfile( + public listByEnrollmentAccount( billingAccountName: string, - billingProfileName: string, - options?: BillingPermissionsListByBillingProfileOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, options }, - listByBillingProfileOperationSpec + enrollmentAccountName: string, + options?: BillingPermissionsListByEnrollmentAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByEnrollmentAccountPagingAll( + billingAccountName, + enrollmentAccountName, + options, ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByEnrollmentAccountPagingPage( + billingAccountName, + enrollmentAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByEnrollmentAccountPagingPage( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingPermissionsListByEnrollmentAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingPermissionsListByEnrollmentAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByEnrollmentAccountNext( + billingAccountName, + enrollmentAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByEnrollmentAccountPagingAll( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingPermissionsListByEnrollmentAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByEnrollmentAccountPagingPage( + billingAccountName, + enrollmentAccountName, + options, + )) { + yield* page; + } } /** - * ListByCustomerNext + * Lists the billing permissions the caller has on a billing account. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: BillingPermissionsListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * Lists the billing permissions the caller has on a billing profile. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingPermissionsListByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, options }, + listByBillingProfileOperationSpec, + ); + } + + /** + * Provides a list of check access response objects for a billing profile. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByBillingProfile( + billingAccountName: string, + billingProfileName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, parameters, options }, + checkAccessByBillingProfileOperationSpec, + ); + } + + /** + * Lists the billing permissions the caller has for a customer. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param customerName The ID that uniquely identifies a customer. - * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. * @param options The options parameters. */ - private _listByCustomerNext( + private _listByCustomer( billingAccountName: string, + billingProfileName: string, customerName: string, - nextLink: string, - options?: BillingPermissionsListByCustomerNextOptionalParams - ): Promise { + options?: BillingPermissionsListByCustomerOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, customerName, nextLink, options }, - listByCustomerNextOperationSpec + { billingAccountName, billingProfileName, customerName, options }, + listByCustomerOperationSpec, + ); + } + + /** + * Provides a list of check access response objects for a customer. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByCustomerOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + parameters, + options, + }, + checkAccessByCustomerOperationSpec, + ); + } + + /** + * Lists the billing permissions the caller has for an invoice section. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + private _listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingPermissionsListByInvoiceSectionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, invoiceSectionName, options }, + listByInvoiceSectionOperationSpec, + ); + } + + /** + * Provides a list of check access response objects for an invoice section. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByInvoiceSectionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + parameters, + options, + }, + checkAccessByInvoiceSectionOperationSpec, + ); + } + + /** + * Provides a list of check access response objects for a billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByBillingAccount( + billingAccountName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, parameters, options }, + checkAccessByBillingAccountOperationSpec, + ); + } + + /** + * Lists the billing permissions the caller has for a customer at billing account level. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + private _listByCustomerAtBillingAccount( + billingAccountName: string, + customerName: string, + options?: BillingPermissionsListByCustomerAtBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, customerName, options }, + listByCustomerAtBillingAccountOperationSpec, + ); + } + + /** + * Lists the billing permissions the caller has for a department. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + private _listByDepartment( + billingAccountName: string, + departmentName: string, + options?: BillingPermissionsListByDepartmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, options }, + listByDepartmentOperationSpec, + ); + } + + /** + * Provides a list of check access response objects for a department. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByDepartment( + billingAccountName: string, + departmentName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByDepartmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, parameters, options }, + checkAccessByDepartmentOperationSpec, + ); + } + + /** + * Lists the billing permissions the caller has for an enrollment account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + private _listByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingPermissionsListByEnrollmentAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, enrollmentAccountName, options }, + listByEnrollmentAccountOperationSpec, + ); + } + + /** + * Provides a list of check access response objects for an enrollment account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByEnrollmentAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, enrollmentAccountName, parameters, options }, + checkAccessByEnrollmentAccountOperationSpec, ); } @@ -475,225 +923,598 @@ export class BillingPermissionsImpl implements BillingPermissions { private _listByBillingAccountNext( billingAccountName: string, nextLink: string, - options?: BillingPermissionsListByBillingAccountNextOptionalParams + options?: BillingPermissionsListByBillingAccountNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, nextLink, options }, - listByBillingAccountNextOperationSpec + listByBillingAccountNextOperationSpec, ); } /** - * ListByInvoiceSectionsNext + * ListByBillingProfileNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountName: string, + billingProfileName: string, + nextLink: string, + options?: BillingPermissionsListByBillingProfileNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, nextLink, options }, + listByBillingProfileNextOperationSpec, + ); + } + + /** + * ListByCustomerNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. + * @param options The options parameters. + */ + private _listByCustomerNext( + billingAccountName: string, + billingProfileName: string, + customerName: string, + nextLink: string, + options?: BillingPermissionsListByCustomerNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + nextLink, + options, + }, + listByCustomerNextOperationSpec, + ); + } + + /** + * ListByInvoiceSectionNext * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSections method. + * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. * @param options The options parameters. */ - private _listByInvoiceSectionsNext( + private _listByInvoiceSectionNext( billingAccountName: string, billingProfileName: string, invoiceSectionName: string, nextLink: string, - options?: BillingPermissionsListByInvoiceSectionsNextOptionalParams - ): Promise { + options?: BillingPermissionsListByInvoiceSectionNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, invoiceSectionName, nextLink, - options + options, }, - listByInvoiceSectionsNextOperationSpec + listByInvoiceSectionNextOperationSpec, ); } /** - * ListByBillingProfileNext + * ListByCustomerAtBillingAccountNext * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param customerName The ID that uniquely identifies a customer. + * @param nextLink The nextLink from the previous successful call to the ListByCustomerAtBillingAccount + * method. * @param options The options parameters. */ - private _listByBillingProfileNext( + private _listByCustomerAtBillingAccountNext( billingAccountName: string, - billingProfileName: string, + customerName: string, nextLink: string, - options?: BillingPermissionsListByBillingProfileNextOptionalParams - ): Promise { + options?: BillingPermissionsListByCustomerAtBillingAccountNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, nextLink, options }, - listByBillingProfileNextOperationSpec + { billingAccountName, customerName, nextLink, options }, + listByCustomerAtBillingAccountNextOperationSpec, + ); + } + + /** + * ListByDepartmentNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param nextLink The nextLink from the previous successful call to the ListByDepartment method. + * @param options The options parameters. + */ + private _listByDepartmentNext( + billingAccountName: string, + departmentName: string, + nextLink: string, + options?: BillingPermissionsListByDepartmentNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, nextLink, options }, + listByDepartmentNextOperationSpec, + ); + } + + /** + * ListByEnrollmentAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param nextLink The nextLink from the previous successful call to the ListByEnrollmentAccount + * method. + * @param options The options parameters. + */ + private _listByEnrollmentAccountNext( + billingAccountName: string, + enrollmentAccountName: string, + nextLink: string, + options?: BillingPermissionsListByEnrollmentAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, enrollmentAccountName, nextLink, options }, + listByEnrollmentAccountNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingPermissionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingPermissionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const checkAccessByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/checkAccess", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "CheckAccessResponse" }, + }, + }, + }, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; const listByCustomerOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingPermissions", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingPermissions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingPermissionsListResult + bodyMapper: Mappers.BillingPermissionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.customerName + Parameters.billingProfileName, + Parameters.customerName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions", +const checkAccessByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/checkAccess", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "CheckAccessResponse" }, + }, + }, + }, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingPermissionsListResult + bodyMapper: Mappers.BillingPermissionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const checkAccessByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/checkAccess", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "CheckAccessResponse" }, + }, + }, + }, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const checkAccessByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/checkAccess", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "CheckAccessResponse" }, + }, + }, + }, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters5, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByCustomerAtBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingPermissions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingPermissionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.customerName, + ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByInvoiceSectionsOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions", +const listByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingPermissions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingPermissionsListResult + bodyMapper: Mappers.BillingPermissionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.invoiceSectionName + Parameters.departmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions", +const checkAccessByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/checkAccess", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "CheckAccessResponse" }, + }, + }, + }, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.departmentName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByEnrollmentAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingPermissions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingPermissionsListResult + bodyMapper: Mappers.BillingPermissionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.enrollmentAccountName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByCustomerNextOperationSpec: coreClient.OperationSpec = { +const checkAccessByEnrollmentAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/checkAccess", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: { + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "CheckAccessResponse" }, + }, + }, + }, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.enrollmentAccountName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingPermissionsListResult + bodyMapper: Mappers.BillingPermissionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.customerName ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingPermissionsListResult + bodyMapper: Mappers.BillingPermissionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.nextLink + Parameters.nextLink, + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByInvoiceSectionsNextOperationSpec: coreClient.OperationSpec = { +const listByCustomerNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingPermissionsListResult + bodyMapper: Mappers.BillingPermissionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, Parameters.billingProfileName, - Parameters.invoiceSectionName + Parameters.customerName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { +const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingPermissionsListResult + bodyMapper: Mappers.BillingPermissionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCustomerAtBillingAccountNextOperationSpec: coreClient.OperationSpec = + { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingPermissionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, + }; +const listByDepartmentNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingPermissionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.departmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByEnrollmentAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingPermissionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName + Parameters.enrollmentAccountName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/billingProfiles.ts b/sdk/billing/arm-billing/src/operations/billingProfiles.ts index 5d5beba5344c..be5fca63100f 100644 --- a/sdk/billing/arm-billing/src/operations/billingProfiles.ts +++ b/sdk/billing/arm-billing/src/operations/billingProfiles.ts @@ -13,18 +13,26 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { BillingProfile, BillingProfilesListByBillingAccountNextOptionalParams, BillingProfilesListByBillingAccountOptionalParams, BillingProfilesListByBillingAccountResponse, + BillingProfilesValidateDeleteEligibilityOptionalParams, + BillingProfilesValidateDeleteEligibilityResponse, + BillingProfilesDeleteOptionalParams, + BillingProfilesDeleteResponse, BillingProfilesGetOptionalParams, BillingProfilesGetResponse, BillingProfilesCreateOrUpdateOptionalParams, BillingProfilesCreateOrUpdateResponse, - BillingProfilesListByBillingAccountNextResponse + BillingProfilesListByBillingAccountNextResponse, } from "../models"; /// @@ -42,17 +50,17 @@ export class BillingProfilesImpl implements BillingProfiles { /** * Lists the billing profiles that a user has access to. The operation is supported for billing - * accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ public listByBillingAccount( billingAccountName: string, - options?: BillingProfilesListByBillingAccountOptionalParams + options?: BillingProfilesListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByBillingAccountPagingAll( billingAccountName, - options + options, ); return { next() { @@ -68,16 +76,16 @@ export class BillingProfilesImpl implements BillingProfiles { return this.listByBillingAccountPagingPage( billingAccountName, options, - settings + settings, ); - } + }, }; } private async *listByBillingAccountPagingPage( billingAccountName: string, options?: BillingProfilesListByBillingAccountOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: BillingProfilesListByBillingAccountResponse; let continuationToken = settings?.continuationToken; @@ -92,7 +100,7 @@ export class BillingProfilesImpl implements BillingProfiles { result = await this._listByBillingAccountNext( billingAccountName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -103,35 +111,129 @@ export class BillingProfilesImpl implements BillingProfiles { private async *listByBillingAccountPagingAll( billingAccountName: string, - options?: BillingProfilesListByBillingAccountOptionalParams + options?: BillingProfilesListByBillingAccountOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByBillingAccountPagingPage( billingAccountName, - options + options, )) { yield* page; } } /** - * Lists the billing profiles that a user has access to. The operation is supported for billing - * accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * Validates if the billing profile can be deleted. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - private _listByBillingAccount( + validateDeleteEligibility( billingAccountName: string, - options?: BillingProfilesListByBillingAccountOptionalParams - ): Promise { + billingProfileName: string, + options?: BillingProfilesValidateDeleteEligibilityOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, options }, - listByBillingAccountOperationSpec + { billingAccountName, billingProfileName, options }, + validateDeleteEligibilityOperationSpec, ); } + /** + * Deletes a billing profile. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement and Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + async beginDelete( + billingAccountName: string, + billingProfileName: string, + options?: BillingProfilesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingProfilesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, billingProfileName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + BillingProfilesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a billing profile. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement and Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + async beginDeleteAndWait( + billingAccountName: string, + billingProfileName: string, + options?: BillingProfilesDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + billingAccountName, + billingProfileName, + options, + ); + return poller.pollUntilDone(); + } + /** * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. + * type Microsoft Customer Agreement and Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. @@ -139,50 +241,50 @@ export class BillingProfilesImpl implements BillingProfiles { get( billingAccountName: string, billingProfileName: string, - options?: BillingProfilesGetOptionalParams + options?: BillingProfilesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, options }, - getOperationSpec + getOperationSpec, ); } /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. + * type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual + * (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. + * @param parameters A billing profile. * @param options The options parameters. */ async beginCreateOrUpdate( billingAccountName: string, billingProfileName: string, parameters: BillingProfile, - options?: BillingProfilesCreateOrUpdateOptionalParams + options?: BillingProfilesCreateOrUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, BillingProfilesCreateOrUpdateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -191,8 +293,8 @@ export class BillingProfilesImpl implements BillingProfiles { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -200,19 +302,23 @@ export class BillingProfilesImpl implements BillingProfiles { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { billingAccountName, billingProfileName, parameters, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, billingProfileName, parameters, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + BillingProfilesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -220,27 +326,44 @@ export class BillingProfilesImpl implements BillingProfiles { /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. + * type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual + * (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. + * @param parameters A billing profile. * @param options The options parameters. */ async beginCreateOrUpdateAndWait( billingAccountName: string, billingProfileName: string, parameters: BillingProfile, - options?: BillingProfilesCreateOrUpdateOptionalParams + options?: BillingProfilesCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( billingAccountName, billingProfileName, parameters, - options + options, ); return poller.pollUntilDone(); } + /** + * Lists the billing profiles that a user has access to. The operation is supported for billing + * accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: BillingProfilesListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + /** * ListByBillingAccountNext * @param billingAccountName The ID that uniquely identifies a billing account. @@ -250,104 +373,158 @@ export class BillingProfilesImpl implements BillingProfiles { private _listByBillingAccountNext( billingAccountName: string, nextLink: string, - options?: BillingProfilesListByBillingAccountNextOptionalParams + options?: BillingProfilesListByBillingAccountNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, nextLink, options }, - listByBillingAccountNextOperationSpec + listByBillingAccountNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles", - httpMethod: "GET", +const validateDeleteEligibilityOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/validateDeleteEligibility", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.BillingProfileListResult + bodyMapper: Mappers.DeleteBillingProfileEligibilityResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [Parameters.$host, Parameters.billingAccountName], + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.BillingProfilesDeleteHeaders, + }, + 201: { + headersMapper: Mappers.BillingProfilesDeleteHeaders, + }, + 202: { + headersMapper: Mappers.BillingProfilesDeleteHeaders, + }, + 204: { + headersMapper: Mappers.BillingProfilesDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingProfile + bodyMapper: Mappers.BillingProfile, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.BillingProfile + bodyMapper: Mappers.BillingProfile, }, 201: { - bodyMapper: Mappers.BillingProfile + bodyMapper: Mappers.BillingProfile, }, 202: { - bodyMapper: Mappers.BillingProfile + bodyMapper: Mappers.BillingProfile, }, 204: { - bodyMapper: Mappers.BillingProfile + bodyMapper: Mappers.BillingProfile, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters2, + requestBody: Parameters.parameters6, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingProfileListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.includeDeleted, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, }; const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingProfileListResult + bodyMapper: Mappers.BillingProfileListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/billingPropertyOperations.ts b/sdk/billing/arm-billing/src/operations/billingPropertyOperations.ts index 6702a05e76f1..d33772848ba5 100644 --- a/sdk/billing/arm-billing/src/operations/billingPropertyOperations.ts +++ b/sdk/billing/arm-billing/src/operations/billingPropertyOperations.ts @@ -16,12 +16,13 @@ import { BillingPropertyGetResponse, BillingProperty, BillingPropertyUpdateOptionalParams, - BillingPropertyUpdateResponse + BillingPropertyUpdateResponse, } from "../models"; /** Class containing BillingPropertyOperations operations. */ export class BillingPropertyOperationsImpl - implements BillingPropertyOperations { + implements BillingPropertyOperations +{ private readonly client: BillingManagementClient; /** @@ -33,29 +34,29 @@ export class BillingPropertyOperationsImpl } /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts - * with agreement type Enterprise Agreement. + * Gets the billing properties for a subscription * @param options The options parameters. */ get( - options?: BillingPropertyGetOptionalParams + options?: BillingPropertyGetOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, getOperationSpec); } /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation - * is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * @param parameters Request parameters that are provided to the update billing property operation. + * Updates the billing property of a subscription. Currently, cost center can be updated for billing + * accounts with agreement type Microsoft Customer Agreement and subscription service usage address can + * be updated for billing accounts with agreement type Microsoft Online Service Program. + * @param parameters A billing property. * @param options The options parameters. */ update( parameters: BillingProperty, - options?: BillingPropertyUpdateOptionalParams + options?: BillingPropertyUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { parameters, options }, - updateOperationSpec + updateOperationSpec, ); } } @@ -63,38 +64,40 @@ export class BillingPropertyOperationsImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingProperty + bodyMapper: Mappers.BillingProperty, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.includeBillingCountry, + Parameters.includeTransitionStatus, + ], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.BillingProperty + bodyMapper: Mappers.BillingProperty, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters10, + requestBody: Parameters.parameters7, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/billingRequests.ts b/sdk/billing/arm-billing/src/operations/billingRequests.ts new file mode 100644 index 000000000000..4a8a83669f70 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/billingRequests.ts @@ -0,0 +1,1029 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { BillingRequests } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + BillingRequest, + BillingRequestsListByBillingProfileNextOptionalParams, + BillingRequestsListByBillingProfileOptionalParams, + BillingRequestsListByBillingProfileResponse, + BillingRequestsListByCustomerNextOptionalParams, + BillingRequestsListByCustomerOptionalParams, + BillingRequestsListByCustomerResponse, + BillingRequestsListByInvoiceSectionNextOptionalParams, + BillingRequestsListByInvoiceSectionOptionalParams, + BillingRequestsListByInvoiceSectionResponse, + BillingRequestsListByBillingAccountNextOptionalParams, + BillingRequestsListByBillingAccountOptionalParams, + BillingRequestsListByBillingAccountResponse, + BillingRequestsListByUserNextOptionalParams, + BillingRequestsListByUserOptionalParams, + BillingRequestsListByUserResponse, + BillingRequestsGetOptionalParams, + BillingRequestsGetResponse, + BillingRequestsCreateOrUpdateOptionalParams, + BillingRequestsCreateOrUpdateResponse, + BillingRequestsListByBillingProfileNextResponse, + BillingRequestsListByCustomerNextResponse, + BillingRequestsListByInvoiceSectionNextResponse, + BillingRequestsListByBillingAccountNextResponse, + BillingRequestsListByUserNextResponse, +} from "../models"; + +/// +/** Class containing BillingRequests operations. */ +export class BillingRequestsImpl implements BillingRequests { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class BillingRequests class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * The list of billing requests submitted for the billing profile. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRequestsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountName, + billingProfileName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountName: string, + billingProfileName: string, + options?: BillingRequestsListByBillingProfileOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRequestsListByBillingProfileResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingProfile( + billingAccountName, + billingProfileName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountName, + billingProfileName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountName: string, + billingProfileName: string, + options?: BillingRequestsListByBillingProfileOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + options, + )) { + yield* page; + } + } + + /** + * The list of billing requests submitted for the customer. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + public listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRequestsListByCustomerOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCustomerPagingAll( + billingAccountName, + billingProfileName, + customerName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByCustomerPagingPage( + billingAccountName, + billingProfileName, + customerName, + options, + settings, + ); + }, + }; + } + + private async *listByCustomerPagingPage( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRequestsListByCustomerOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRequestsListByCustomerResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCustomer( + billingAccountName, + billingProfileName, + customerName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCustomerNext( + billingAccountName, + billingProfileName, + customerName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCustomerPagingAll( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRequestsListByCustomerOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCustomerPagingPage( + billingAccountName, + billingProfileName, + customerName, + options, + )) { + yield* page; + } + } + + /** + * The list of billing requests submitted for the invoice section. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + public listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRequestsListByInvoiceSectionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByInvoiceSectionPagingAll( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByInvoiceSectionPagingPage( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + settings, + ); + }, + }; + } + + private async *listByInvoiceSectionPagingPage( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRequestsListByInvoiceSectionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRequestsListByInvoiceSectionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByInvoiceSectionNext( + billingAccountName, + billingProfileName, + invoiceSectionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByInvoiceSectionPagingAll( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRequestsListByInvoiceSectionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByInvoiceSectionPagingPage( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + )) { + yield* page; + } + } + + /** + * The list of billing requests submitted for the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountName: string, + options?: BillingRequestsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: BillingRequestsListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRequestsListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: BillingRequestsListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * The list of billing requests submitted by a user. + * @param options The options parameters. + */ + public listByUser( + options?: BillingRequestsListByUserOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByUserPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByUserPagingPage(options, settings); + }, + }; + } + + private async *listByUserPagingPage( + options?: BillingRequestsListByUserOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRequestsListByUserResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByUser(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByUserNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByUserPagingAll( + options?: BillingRequestsListByUserOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByUserPagingPage(options)) { + yield* page; + } + } + + /** + * The list of billing requests submitted for the billing profile. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRequestsListByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, options }, + listByBillingProfileOperationSpec, + ); + } + + /** + * The list of billing requests submitted for the customer. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + private _listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRequestsListByCustomerOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, customerName, options }, + listByCustomerOperationSpec, + ); + } + + /** + * The list of billing requests submitted for the invoice section. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + private _listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRequestsListByInvoiceSectionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, invoiceSectionName, options }, + listByInvoiceSectionOperationSpec, + ); + } + + /** + * The list of billing requests submitted for the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: BillingRequestsListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * Gets a billing request by its ID. + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param options The options parameters. + */ + get( + billingRequestName: string, + options?: BillingRequestsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingRequestName, options }, + getOperationSpec, + ); + } + + /** + * Create or update a billing request. + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param parameters A request submitted by a user to manage billing. Users with an owner role on the + * scope can approve or decline these requests. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + billingRequestName: string, + parameters: BillingRequest, + options?: BillingRequestsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRequestsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingRequestName, parameters, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + BillingRequestsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a billing request. + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param parameters A request submitted by a user to manage billing. Users with an owner role on the + * scope can approve or decline these requests. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + billingRequestName: string, + parameters: BillingRequest, + options?: BillingRequestsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + billingRequestName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * The list of billing requests submitted by a user. + * @param options The options parameters. + */ + private _listByUser( + options?: BillingRequestsListByUserOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listByUserOperationSpec, + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountName: string, + billingProfileName: string, + nextLink: string, + options?: BillingRequestsListByBillingProfileNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, nextLink, options }, + listByBillingProfileNextOperationSpec, + ); + } + + /** + * ListByCustomerNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. + * @param options The options parameters. + */ + private _listByCustomerNext( + billingAccountName: string, + billingProfileName: string, + customerName: string, + nextLink: string, + options?: BillingRequestsListByCustomerNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + nextLink, + options, + }, + listByCustomerNextOperationSpec, + ); + } + + /** + * ListByInvoiceSectionNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. + * @param options The options parameters. + */ + private _listByInvoiceSectionNext( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + nextLink: string, + options?: BillingRequestsListByInvoiceSectionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + nextLink, + options, + }, + listByInvoiceSectionNextOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: BillingRequestsListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } + + /** + * ListByUserNext + * @param nextLink The nextLink from the previous successful call to the ListByUser method. + * @param options The options parameters. + */ + private _listByUserNext( + nextLink: string, + options?: BillingRequestsListByUserNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listByUserNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRequests", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingRequests", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRequests", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRequests", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingRequests/{billingRequestName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequest, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingRequestName], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingRequests/{billingRequestName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BillingRequest, + }, + 201: { + bodyMapper: Mappers.BillingRequest, + }, + 202: { + bodyMapper: Mappers.BillingRequest, + }, + 204: { + bodyMapper: Mappers.BillingRequest, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingRequestName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByUserOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingRequests", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCustomerNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByUserNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRequestListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/billingRoleAssignments.ts b/sdk/billing/arm-billing/src/operations/billingRoleAssignments.ts index b5cf79062a6d..ac0eb6b1b9dc 100644 --- a/sdk/billing/arm-billing/src/operations/billingRoleAssignments.ts +++ b/sdk/billing/arm-billing/src/operations/billingRoleAssignments.ts @@ -13,32 +13,79 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { BillingRoleAssignment, - BillingRoleAssignmentsListByBillingAccountNextOptionalParams, - BillingRoleAssignmentsListByBillingAccountOptionalParams, - BillingRoleAssignmentsListByBillingAccountResponse, - BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams, - BillingRoleAssignmentsListByInvoiceSectionOptionalParams, - BillingRoleAssignmentsListByInvoiceSectionResponse, BillingRoleAssignmentsListByBillingProfileNextOptionalParams, BillingRoleAssignmentsListByBillingProfileOptionalParams, BillingRoleAssignmentsListByBillingProfileResponse, - BillingRoleAssignmentsGetByBillingAccountOptionalParams, - BillingRoleAssignmentsGetByBillingAccountResponse, - BillingRoleAssignmentsDeleteByBillingAccountOptionalParams, - BillingRoleAssignmentsDeleteByBillingAccountResponse, - BillingRoleAssignmentsGetByInvoiceSectionOptionalParams, - BillingRoleAssignmentsGetByInvoiceSectionResponse, - BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams, - BillingRoleAssignmentsDeleteByInvoiceSectionResponse, + BillingRoleAssignmentsListByCustomerNextOptionalParams, + BillingRoleAssignmentsListByCustomerOptionalParams, + BillingRoleAssignmentsListByCustomerResponse, + BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams, + BillingRoleAssignmentsListByInvoiceSectionOptionalParams, + BillingRoleAssignmentsListByInvoiceSectionResponse, + BillingRoleAssignmentsListByBillingAccountNextOptionalParams, + BillingRoleAssignmentsListByBillingAccountOptionalParams, + BillingRoleAssignmentsListByBillingAccountResponse, + BillingRoleAssignmentsListByDepartmentNextOptionalParams, + BillingRoleAssignmentsListByDepartmentOptionalParams, + BillingRoleAssignmentsListByDepartmentResponse, + BillingRoleAssignmentsListByEnrollmentAccountNextOptionalParams, + BillingRoleAssignmentsListByEnrollmentAccountOptionalParams, + BillingRoleAssignmentsListByEnrollmentAccountResponse, + BillingRoleAssignmentsDeleteByBillingProfileOptionalParams, BillingRoleAssignmentsGetByBillingProfileOptionalParams, BillingRoleAssignmentsGetByBillingProfileResponse, - BillingRoleAssignmentsDeleteByBillingProfileOptionalParams, - BillingRoleAssignmentsDeleteByBillingProfileResponse, - BillingRoleAssignmentsListByBillingAccountNextResponse, + BillingRoleAssignmentProperties, + BillingRoleAssignmentsCreateByBillingProfileOptionalParams, + BillingRoleAssignmentsCreateByBillingProfileResponse, + BillingRoleAssignmentsDeleteByCustomerOptionalParams, + BillingRoleAssignmentsGetByCustomerOptionalParams, + BillingRoleAssignmentsGetByCustomerResponse, + BillingRoleAssignmentsCreateByCustomerOptionalParams, + BillingRoleAssignmentsCreateByCustomerResponse, + BillingRoleAssignmentsResolveByCustomerOptionalParams, + BillingRoleAssignmentsResolveByCustomerResponse, + BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams, + BillingRoleAssignmentsGetByInvoiceSectionOptionalParams, + BillingRoleAssignmentsGetByInvoiceSectionResponse, + BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams, + BillingRoleAssignmentsCreateByInvoiceSectionResponse, + BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams, + BillingRoleAssignmentsResolveByInvoiceSectionResponse, + BillingRoleAssignmentsResolveByBillingProfileOptionalParams, + BillingRoleAssignmentsResolveByBillingProfileResponse, + BillingRoleAssignmentsDeleteByBillingAccountOptionalParams, + BillingRoleAssignmentsGetByBillingAccountOptionalParams, + BillingRoleAssignmentsGetByBillingAccountResponse, + BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams, + BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse, + BillingRoleAssignmentsCreateByBillingAccountOptionalParams, + BillingRoleAssignmentsCreateByBillingAccountResponse, + BillingRoleAssignmentsDeleteByDepartmentOptionalParams, + BillingRoleAssignmentsGetByDepartmentOptionalParams, + BillingRoleAssignmentsGetByDepartmentResponse, + BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams, + BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse, + BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams, + BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams, + BillingRoleAssignmentsGetByEnrollmentAccountResponse, + BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams, + BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse, + BillingRoleAssignmentsResolveByBillingAccountOptionalParams, + BillingRoleAssignmentsResolveByBillingAccountResponse, + BillingRoleAssignmentsListByBillingProfileNextResponse, + BillingRoleAssignmentsListByCustomerNextResponse, BillingRoleAssignmentsListByInvoiceSectionNextResponse, - BillingRoleAssignmentsListByBillingProfileNextResponse + BillingRoleAssignmentsListByBillingAccountNextResponse, + BillingRoleAssignmentsListByDepartmentNextResponse, + BillingRoleAssignmentsListByEnrollmentAccountNextResponse, } from "../models"; /// @@ -55,18 +102,21 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { } /** - * Lists the role assignments for the caller on a billing account. The operation is supported for + * Lists the role assignments for the caller on a billing profile. The operation is supported for * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - public listByBillingAccount( + public listByBillingProfile( billingAccountName: string, - options?: BillingRoleAssignmentsListByBillingAccountOptionalParams + billingProfileName: string, + options?: BillingRoleAssignmentsListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByBillingAccountPagingAll( + const iter = this.listByBillingProfilePagingAll( billingAccountName, - options + billingProfileName, + options, ); return { next() { @@ -79,34 +129,41 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingAccountPagingPage( + return this.listByBillingProfilePagingPage( billingAccountName, + billingProfileName, options, - settings + settings, ); - } + }, }; } - private async *listByBillingAccountPagingPage( + private async *listByBillingProfilePagingPage( billingAccountName: string, - options?: BillingRoleAssignmentsListByBillingAccountOptionalParams, - settings?: PageSettings + billingProfileName: string, + options?: BillingRoleAssignmentsListByBillingProfileOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: BillingRoleAssignmentsListByBillingAccountResponse; + let result: BillingRoleAssignmentsListByBillingProfileResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingAccount(billingAccountName, options); + result = await this._listByBillingProfile( + billingAccountName, + billingProfileName, + options, + ); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listByBillingAccountNext( + result = await this._listByBillingProfileNext( billingAccountName, + billingProfileName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -115,13 +172,109 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { } } - private async *listByBillingAccountPagingAll( + private async *listByBillingProfilePagingAll( billingAccountName: string, - options?: BillingRoleAssignmentsListByBillingAccountOptionalParams + billingProfileName: string, + options?: BillingRoleAssignmentsListByBillingProfileOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByBillingAccountPagingPage( + for await (const page of this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + options, + )) { + yield* page; + } + } + + /** + * Lists the role assignments for the caller on customer. The operation is supported for billing + * accounts with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + public listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleAssignmentsListByCustomerOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCustomerPagingAll( + billingAccountName, + billingProfileName, + customerName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByCustomerPagingPage( + billingAccountName, + billingProfileName, + customerName, + options, + settings, + ); + }, + }; + } + + private async *listByCustomerPagingPage( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleAssignmentsListByCustomerOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRoleAssignmentsListByCustomerResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCustomer( + billingAccountName, + billingProfileName, + customerName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCustomerNext( + billingAccountName, + billingProfileName, + customerName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCustomerPagingAll( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleAssignmentsListByCustomerOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCustomerPagingPage( billingAccountName, - options + billingProfileName, + customerName, + options, )) { yield* page; } @@ -139,13 +292,13 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { billingAccountName: string, billingProfileName: string, invoiceSectionName: string, - options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams + options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByInvoiceSectionPagingAll( billingAccountName, billingProfileName, invoiceSectionName, - options + options, ); return { next() { @@ -163,9 +316,9 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { billingProfileName, invoiceSectionName, options, - settings + settings, ); - } + }, }; } @@ -174,7 +327,7 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { billingProfileName: string, invoiceSectionName: string, options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: BillingRoleAssignmentsListByInvoiceSectionResponse; let continuationToken = settings?.continuationToken; @@ -183,7 +336,7 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { billingAccountName, billingProfileName, invoiceSectionName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -196,7 +349,7 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { billingProfileName, invoiceSectionName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -209,34 +362,32 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { billingAccountName: string, billingProfileName: string, invoiceSectionName: string, - options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams + options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByInvoiceSectionPagingPage( billingAccountName, billingProfileName, invoiceSectionName, - options + options, )) { yield* page; } } /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. + * Lists the role assignments for the caller on a billing account. The operation is supported for + * billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or + * Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - public listByBillingProfile( + public listByBillingAccount( billingAccountName: string, - billingProfileName: string, - options?: BillingRoleAssignmentsListByBillingProfileOptionalParams + options?: BillingRoleAssignmentsListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByBillingProfilePagingAll( + const iter = this.listByBillingAccountPagingAll( billingAccountName, - billingProfileName, - options + options, ); return { next() { @@ -249,41 +400,34 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingProfilePagingPage( + return this.listByBillingAccountPagingPage( billingAccountName, - billingProfileName, options, - settings + settings, ); - } + }, }; } - private async *listByBillingProfilePagingPage( + private async *listByBillingAccountPagingPage( billingAccountName: string, - billingProfileName: string, - options?: BillingRoleAssignmentsListByBillingProfileOptionalParams, - settings?: PageSettings + options?: BillingRoleAssignmentsListByBillingAccountOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: BillingRoleAssignmentsListByBillingProfileResponse; + let result: BillingRoleAssignmentsListByBillingAccountResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingProfile( - billingAccountName, - billingProfileName, - options - ); + result = await this._listByBillingAccount(billingAccountName, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listByBillingProfileNext( + result = await this._listByBillingAccountNext( billingAccountName, - billingProfileName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -292,109 +436,210 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { } } - private async *listByBillingProfilePagingAll( + private async *listByBillingAccountPagingAll( billingAccountName: string, - billingProfileName: string, - options?: BillingRoleAssignmentsListByBillingProfileOptionalParams + options?: BillingRoleAssignmentsListByBillingAccountOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByBillingProfilePagingPage( + for await (const page of this.listByBillingAccountPagingPage( billingAccountName, - billingProfileName, - options + options, )) { yield* page; } } /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing - * accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Lists the role assignments for the caller on a department. The operation is supported for billing + * accounts of type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param departmentName The name of the department. * @param options The options parameters. */ - getByBillingAccount( + public listByDepartment( billingAccountName: string, - billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsGetByBillingAccountOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingRoleAssignmentName, options }, - getByBillingAccountOperationSpec + departmentName: string, + options?: BillingRoleAssignmentsListByDepartmentOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByDepartmentPagingAll( + billingAccountName, + departmentName, + options, ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByDepartmentPagingPage( + billingAccountName, + departmentName, + options, + settings, + ); + }, + }; } - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param options The options parameters. - */ - deleteByBillingAccount( + private async *listByDepartmentPagingPage( billingAccountName: string, - billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsDeleteByBillingAccountOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingRoleAssignmentName, options }, - deleteByBillingAccountOperationSpec - ); + departmentName: string, + options?: BillingRoleAssignmentsListByDepartmentOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRoleAssignmentsListByDepartmentResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByDepartment( + billingAccountName, + departmentName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByDepartmentNext( + billingAccountName, + departmentName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByDepartmentPagingAll( + billingAccountName: string, + departmentName: string, + options?: BillingRoleAssignmentsListByDepartmentOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByDepartmentPagingPage( + billingAccountName, + departmentName, + options, + )) { + yield* page; + } } /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing - * accounts with agreement type Microsoft Customer Agreement. + * Lists the role assignments for the caller on a enrollment account. The operation is supported for + * billing accounts of type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param enrollmentAccountName The name of the enrollment account. * @param options The options parameters. */ - getByInvoiceSection( + public listByEnrollmentAccount( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsGetByInvoiceSectionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleAssignmentName, - options - }, - getByInvoiceSectionOperationSpec + enrollmentAccountName: string, + options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByEnrollmentAccountPagingAll( + billingAccountName, + enrollmentAccountName, + options, ); - } - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByEnrollmentAccountPagingPage( + billingAccountName, + enrollmentAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByEnrollmentAccountPagingPage( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRoleAssignmentsListByEnrollmentAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByEnrollmentAccountNext( + billingAccountName, + enrollmentAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByEnrollmentAccountPagingAll( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByEnrollmentAccountPagingPage( + billingAccountName, + enrollmentAccountName, + options, + )) { + yield* page; + } + } + + /** + * Deletes a role assignment on a billing profile. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param options The options parameters. */ - deleteByInvoiceSection( + deleteByBillingProfile( billingAccountName: string, billingProfileName: string, - invoiceSectionName: string, billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams - ): Promise { + options?: BillingRoleAssignmentsDeleteByBillingProfileOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, - invoiceSectionName, billingRoleAssignmentName, - options + options, }, - deleteByInvoiceSectionOperationSpec + deleteByBillingProfileOperationSpec, ); } @@ -410,416 +655,2469 @@ export class BillingRoleAssignmentsImpl implements BillingRoleAssignments { billingAccountName: string, billingProfileName: string, billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsGetByBillingProfileOptionalParams + options?: BillingRoleAssignmentsGetByBillingProfileOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, billingRoleAssignmentName, - options + options, }, - getByBillingProfileOperationSpec + getByBillingProfileOperationSpec, ); } /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for + * Lists the role assignments for the caller on a billing profile. The operation is supported for * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleAssignmentsListByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, options }, + listByBillingProfileOperationSpec, + ); + } + + /** + * Adds a role assignment on a billing profile. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateByBillingProfile( + billingAccountName: string, + billingProfileName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByBillingProfileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateByBillingProfileResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, billingProfileName, parameters, options }, + spec: createByBillingProfileOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsCreateByBillingProfileResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Adds a role assignment on a billing profile. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateByBillingProfileAndWait( + billingAccountName: string, + billingProfileName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByBillingProfileOptionalParams, + ): Promise { + const poller = await this.beginCreateByBillingProfile( + billingAccountName, + billingProfileName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a role assignment on a customer. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param options The options parameters. */ - deleteByBillingProfile( + deleteByCustomer( billingAccountName: string, billingProfileName: string, + customerName: string, billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsDeleteByBillingProfileOptionalParams - ): Promise { + options?: BillingRoleAssignmentsDeleteByCustomerOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, + customerName, billingRoleAssignmentName, - options + options, }, - deleteByBillingProfileOperationSpec + deleteByCustomerOperationSpec, ); } /** - * Lists the role assignments for the caller on a billing account. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Gets a role assignment for the caller on a customer. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param options The options parameters. */ - private _listByBillingAccount( + getByCustomer( billingAccountName: string, - options?: BillingRoleAssignmentsListByBillingAccountOptionalParams - ): Promise { + billingProfileName: string, + customerName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsGetByCustomerOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, options }, - listByBillingAccountOperationSpec + { + billingAccountName, + billingProfileName, + customerName, + billingRoleAssignmentName, + options, + }, + getByCustomerOperationSpec, ); } /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. + * Lists the role assignments for the caller on customer. The operation is supported for billing + * accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - private _listByInvoiceSection( + private _listByCustomer( billingAccountName: string, billingProfileName: string, - invoiceSectionName: string, - options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams - ): Promise { + customerName: string, + options?: BillingRoleAssignmentsListByCustomerOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, invoiceSectionName, options }, - listByInvoiceSectionOperationSpec + { billingAccountName, billingProfileName, customerName, options }, + listByCustomerOperationSpec, ); } /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. + * Adds a role assignment on a customer. The operation is supported for billing accounts with agreement + * type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters The properties of the billing role assignment. * @param options The options parameters. */ - private _listByBillingProfile( + async beginCreateByCustomer( billingAccountName: string, billingProfileName: string, - options?: BillingRoleAssignmentsListByBillingProfileOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, options }, - listByBillingProfileOperationSpec + customerName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByCustomerOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateByCustomerResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingProfileName, + customerName, + parameters, + options, + }, + spec: createByCustomerOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsCreateByCustomerResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Adds a role assignment on a customer. The operation is supported for billing accounts with agreement + * type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateByCustomerAndWait( + billingAccountName: string, + billingProfileName: string, + customerName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByCustomerOptionalParams, + ): Promise { + const poller = await this.beginCreateByCustomer( + billingAccountName, + billingProfileName, + customerName, + parameters, + options, ); + return poller.pollUntilDone(); } /** - * ListByBillingAccountNext + * Lists the role assignments for the caller on a customer while fetching user info for each role + * assignment. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - private _listByBillingAccountNext( + async beginResolveByCustomer( billingAccountName: string, - nextLink: string, - options?: BillingRoleAssignmentsListByBillingAccountNextOptionalParams - ): Promise { + billingProfileName: string, + customerName: string, + options?: BillingRoleAssignmentsResolveByCustomerOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsResolveByCustomerResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, billingProfileName, customerName, options }, + spec: resolveByCustomerOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsResolveByCustomerResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Lists the role assignments for the caller on a customer while fetching user info for each role + * assignment. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + async beginResolveByCustomerAndWait( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleAssignmentsResolveByCustomerOptionalParams, + ): Promise { + const poller = await this.beginResolveByCustomer( + billingAccountName, + billingProfileName, + customerName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a role assignment on an invoice section. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + deleteByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, nextLink, options }, - listByBillingAccountNextOperationSpec + { + billingAccountName, + billingProfileName, + invoiceSectionName, + billingRoleAssignmentName, + options, + }, + deleteByInvoiceSectionOperationSpec, ); } /** - * ListByInvoiceSectionNext + * Gets a role assignment for the caller on an invoice section. The operation is supported for billing + * accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param options The options parameters. */ - private _listByInvoiceSectionNext( + getByInvoiceSection( billingAccountName: string, billingProfileName: string, invoiceSectionName: string, - nextLink: string, - options?: BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams - ): Promise { + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsGetByInvoiceSectionOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, invoiceSectionName, - nextLink, - options + billingRoleAssignmentName, + options, }, - listByInvoiceSectionNextOperationSpec + getByInvoiceSectionOperationSpec, ); } /** - * ListByBillingProfileNext + * Lists the role assignments for the caller on an invoice section. The operation is supported for + * billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - private _listByBillingProfileNext( + private _listByInvoiceSection( billingAccountName: string, billingProfileName: string, - nextLink: string, - options?: BillingRoleAssignmentsListByBillingProfileNextOptionalParams - ): Promise { + invoiceSectionName: string, + options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, nextLink, options }, - listByBillingProfileNextOperationSpec + { billingAccountName, billingProfileName, invoiceSectionName, options }, + listByInvoiceSectionOperationSpec, ); } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const getByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", - httpMethod: "GET", + /** + * Adds a role assignment on an invoice section. The operation is supported for billing accounts with + * agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateByInvoiceSectionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingProfileName, + invoiceSectionName, + parameters, + options, + }, + spec: createByInvoiceSectionOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsCreateByInvoiceSectionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Adds a role assignment on an invoice section. The operation is supported for billing accounts with + * agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateByInvoiceSectionAndWait( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams, + ): Promise { + const poller = await this.beginCreateByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the role assignments for the caller on an invoice section while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + async beginResolveByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsResolveByInvoiceSectionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + }, + spec: resolveByInvoiceSectionOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsResolveByInvoiceSectionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Lists the role assignments for the caller on an invoice section while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + async beginResolveByInvoiceSectionAndWait( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams, + ): Promise { + const poller = await this.beginResolveByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the role assignments for the caller on an billing profile while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + async beginResolveByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleAssignmentsResolveByBillingProfileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsResolveByBillingProfileResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, billingProfileName, options }, + spec: resolveByBillingProfileOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsResolveByBillingProfileResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Lists the role assignments for the caller on an billing profile while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + async beginResolveByBillingProfileAndWait( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleAssignmentsResolveByBillingProfileOptionalParams, + ): Promise { + const poller = await this.beginResolveByBillingProfile( + billingAccountName, + billingProfileName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a role assignment on a billing account. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + deleteByBillingAccount( + billingAccountName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsDeleteByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingRoleAssignmentName, options }, + deleteByBillingAccountOperationSpec, + ); + } + + /** + * Gets a role assignment for the caller on a billing account. The operation is supported for billing + * accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsGetByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingRoleAssignmentName, options }, + getByBillingAccountOperationSpec, + ); + } + + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateOrUpdateByBillingAccount( + billingAccountName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingRoleAssignmentName, + parameters, + options, + }, + spec: createOrUpdateByBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdateByBillingAccount( + billingAccountName, + billingRoleAssignmentName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the role assignments for the caller on a billing account. The operation is supported for + * billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or + * Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: BillingRoleAssignmentsListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * Adds a role assignment on a billing account. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateByBillingAccount( + billingAccountName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateByBillingAccountResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, parameters, options }, + spec: createByBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsCreateByBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Adds a role assignment on a billing account. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateByBillingAccountAndWait( + billingAccountName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginCreateByBillingAccount( + billingAccountName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a role assignment on a department. The operation is supported only for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + deleteByDepartment( + billingAccountName: string, + departmentName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsDeleteByDepartmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + departmentName, + billingRoleAssignmentName, + options, + }, + deleteByDepartmentOperationSpec, + ); + } + + /** + * Gets a role assignment for the caller on a department. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + getByDepartment( + billingAccountName: string, + departmentName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsGetByDepartmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + departmentName, + billingRoleAssignmentName, + options, + }, + getByDepartmentOperationSpec, + ); + } + + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateOrUpdateByDepartment( + billingAccountName: string, + departmentName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + departmentName, + billingRoleAssignmentName, + parameters, + options, + }, + spec: createOrUpdateByDepartmentOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateOrUpdateByDepartmentAndWait( + billingAccountName: string, + departmentName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdateByDepartment( + billingAccountName, + departmentName, + billingRoleAssignmentName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the role assignments for the caller on a department. The operation is supported for billing + * accounts of type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + private _listByDepartment( + billingAccountName: string, + departmentName: string, + options?: BillingRoleAssignmentsListByDepartmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, options }, + listByDepartmentOperationSpec, + ); + } + + /** + * Deletes a role assignment on a enrollment Account. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + deleteByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + options, + }, + deleteByEnrollmentAccountOperationSpec, + ); + } + + /** + * Gets a role assignment for the caller on a enrollment Account. The operation is supported only for + * billing accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + getByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + options, + }, + getByEnrollmentAccountOperationSpec, + ); + } + + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateOrUpdateByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + parameters, + options, + }, + spec: createOrUpdateByEnrollmentAccountOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + async beginCreateOrUpdateByEnrollmentAccountAndWait( + billingAccountName: string, + enrollmentAccountName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdateByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + billingRoleAssignmentName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the role assignments for the caller on a enrollment account. The operation is supported for + * billing accounts of type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + private _listByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, enrollmentAccountName, options }, + listByEnrollmentAccountOperationSpec, + ); + } + + /** + * Lists the role assignments for the caller on a billing account while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + async beginResolveByBillingAccount( + billingAccountName: string, + options?: BillingRoleAssignmentsResolveByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsResolveByBillingAccountResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, options }, + spec: resolveByBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + BillingRoleAssignmentsResolveByBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Lists the role assignments for the caller on a billing account while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + async beginResolveByBillingAccountAndWait( + billingAccountName: string, + options?: BillingRoleAssignmentsResolveByBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginResolveByBillingAccount( + billingAccountName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListByBillingProfileNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountName: string, + billingProfileName: string, + nextLink: string, + options?: BillingRoleAssignmentsListByBillingProfileNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, nextLink, options }, + listByBillingProfileNextOperationSpec, + ); + } + + /** + * ListByCustomerNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. + * @param options The options parameters. + */ + private _listByCustomerNext( + billingAccountName: string, + billingProfileName: string, + customerName: string, + nextLink: string, + options?: BillingRoleAssignmentsListByCustomerNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + nextLink, + options, + }, + listByCustomerNextOperationSpec, + ); + } + + /** + * ListByInvoiceSectionNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. + * @param options The options parameters. + */ + private _listByInvoiceSectionNext( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + nextLink: string, + options?: BillingRoleAssignmentsListByInvoiceSectionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + nextLink, + options, + }, + listByInvoiceSectionNextOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: BillingRoleAssignmentsListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } + + /** + * ListByDepartmentNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param nextLink The nextLink from the previous successful call to the ListByDepartment method. + * @param options The options parameters. + */ + private _listByDepartmentNext( + billingAccountName: string, + departmentName: string, + nextLink: string, + options?: BillingRoleAssignmentsListByDepartmentNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, nextLink, options }, + listByDepartmentNextOperationSpec, + ); + } + + /** + * ListByEnrollmentAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param nextLink The nextLink from the previous successful call to the ListByEnrollmentAccount + * method. + * @param options The options parameters. + */ + private _listByEnrollmentAccountNext( + billingAccountName: string, + enrollmentAccountName: string, + nextLink: string, + options?: BillingRoleAssignmentsListByEnrollmentAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, enrollmentAccountName, nextLink, options }, + listByEnrollmentAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skip, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/createBillingRoleAssignment", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingRoleAssignments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skip, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/createBillingRoleAssignment", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const resolveByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/resolveBillingRoleAssignments", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.resolveScopeDisplayNames, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const deleteByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.BillingRoleAssignment - }, + 200: {}, + 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingRoleAssignmentName + Parameters.billingProfileName, + Parameters.invoiceSectionName, + Parameters.billingRoleAssignmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const deleteByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", - httpMethod: "DELETE", +const getByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignment + bodyMapper: Mappers.BillingRoleAssignment, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingRoleAssignmentName + Parameters.billingProfileName, + Parameters.invoiceSectionName, + Parameters.billingRoleAssignmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getByInvoiceSectionOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}", +const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignment + bodyMapper: Mappers.BillingRoleAssignmentListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skip, + ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.billingProfileName, Parameters.invoiceSectionName, - Parameters.billingRoleAssignmentName ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const deleteByInvoiceSectionOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}", - httpMethod: "DELETE", +const createByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/createBillingRoleAssignment", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignment + bodyMapper: Mappers.BillingRoleAssignment, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignment, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.parameters9, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.billingProfileName, Parameters.invoiceSectionName, - Parameters.billingRoleAssignmentName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const resolveByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/resolveBillingRoleAssignments", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.resolveScopeDisplayNames, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}", - httpMethod: "GET", +const resolveByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/resolveBillingRoleAssignments", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignment + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.resolveScopeDisplayNames, + ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.billingProfileName, - Parameters.billingRoleAssignmentName ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const deleteByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}", +const deleteByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignment + bodyMapper: Mappers.BillingRoleAssignment, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.billingRoleAssignmentName + Parameters.billingRoleAssignmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const createOrUpdateByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters10, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignmentListResult + bodyMapper: Mappers.BillingRoleAssignmentListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skip, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const createByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.parameters9, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.departmentName, + Parameters.billingRoleAssignmentName, + ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments", +const getByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleAssignments/{billingRoleAssignmentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignmentListResult + bodyMapper: Mappers.BillingRoleAssignment, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.invoiceSectionName + Parameters.departmentName, + Parameters.billingRoleAssignmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments", +const createOrUpdateByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters10, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.departmentName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleAssignments", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignmentListResult + bodyMapper: Mappers.BillingRoleAssignmentListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.departmentName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", +const deleteByEnrollmentAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.enrollmentAccountName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getByEnrollmentAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignmentListResult + bodyMapper: Mappers.BillingRoleAssignment, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.enrollmentAccountName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateByEnrollmentAccountOperationSpec: coreClient.OperationSpec = + { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignment, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters10, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.enrollmentAccountName, + Parameters.billingRoleAssignmentName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; +const listByEnrollmentAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleAssignments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.nextLink + Parameters.enrollmentAccountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const resolveByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/resolveBillingRoleAssignments", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 201: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 202: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + 204: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.resolveScopeDisplayNames, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCustomerNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.customerName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignmentListResult + bodyMapper: Mappers.BillingRoleAssignmentListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, Parameters.billingProfileName, - Parameters.invoiceSectionName + Parameters.invoiceSectionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingRoleAssignmentListResult + bodyMapper: Mappers.BillingRoleAssignmentListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByDepartmentNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.departmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByEnrollmentAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName + Parameters.enrollmentAccountName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/billingRoleDefinitionOperations.ts b/sdk/billing/arm-billing/src/operations/billingRoleDefinitionOperations.ts new file mode 100644 index 000000000000..8c4b5e2d61a9 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/billingRoleDefinitionOperations.ts @@ -0,0 +1,1338 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { BillingRoleDefinitionOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + BillingRoleDefinition, + BillingRoleDefinitionListByBillingProfileNextOptionalParams, + BillingRoleDefinitionListByBillingProfileOptionalParams, + BillingRoleDefinitionListByBillingProfileResponse, + BillingRoleDefinitionListByCustomerNextOptionalParams, + BillingRoleDefinitionListByCustomerOptionalParams, + BillingRoleDefinitionListByCustomerResponse, + BillingRoleDefinitionListByInvoiceSectionNextOptionalParams, + BillingRoleDefinitionListByInvoiceSectionOptionalParams, + BillingRoleDefinitionListByInvoiceSectionResponse, + BillingRoleDefinitionListByBillingAccountNextOptionalParams, + BillingRoleDefinitionListByBillingAccountOptionalParams, + BillingRoleDefinitionListByBillingAccountResponse, + BillingRoleDefinitionListByDepartmentNextOptionalParams, + BillingRoleDefinitionListByDepartmentOptionalParams, + BillingRoleDefinitionListByDepartmentResponse, + BillingRoleDefinitionListByEnrollmentAccountNextOptionalParams, + BillingRoleDefinitionListByEnrollmentAccountOptionalParams, + BillingRoleDefinitionListByEnrollmentAccountResponse, + BillingRoleDefinitionGetByBillingProfileOptionalParams, + BillingRoleDefinitionGetByBillingProfileResponse, + BillingRoleDefinitionGetByCustomerOptionalParams, + BillingRoleDefinitionGetByCustomerResponse, + BillingRoleDefinitionGetByInvoiceSectionOptionalParams, + BillingRoleDefinitionGetByInvoiceSectionResponse, + BillingRoleDefinitionGetByBillingAccountOptionalParams, + BillingRoleDefinitionGetByBillingAccountResponse, + BillingRoleDefinitionGetByDepartmentOptionalParams, + BillingRoleDefinitionGetByDepartmentResponse, + BillingRoleDefinitionGetByEnrollmentAccountOptionalParams, + BillingRoleDefinitionGetByEnrollmentAccountResponse, + BillingRoleDefinitionListByBillingProfileNextResponse, + BillingRoleDefinitionListByCustomerNextResponse, + BillingRoleDefinitionListByInvoiceSectionNextResponse, + BillingRoleDefinitionListByBillingAccountNextResponse, + BillingRoleDefinitionListByDepartmentNextResponse, + BillingRoleDefinitionListByEnrollmentAccountNextResponse, +} from "../models"; + +/// +/** Class containing BillingRoleDefinitionOperations operations. */ +export class BillingRoleDefinitionOperationsImpl + implements BillingRoleDefinitionOperations +{ + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class BillingRoleDefinitionOperations class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * Lists the role definitions for a billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleDefinitionListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountName, + billingProfileName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleDefinitionListByBillingProfileOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRoleDefinitionListByBillingProfileResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingProfile( + billingAccountName, + billingProfileName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountName, + billingProfileName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleDefinitionListByBillingProfileOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + options, + )) { + yield* page; + } + } + + /** + * Lists the role definitions for a customer. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + public listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleDefinitionListByCustomerOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCustomerPagingAll( + billingAccountName, + billingProfileName, + customerName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByCustomerPagingPage( + billingAccountName, + billingProfileName, + customerName, + options, + settings, + ); + }, + }; + } + + private async *listByCustomerPagingPage( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleDefinitionListByCustomerOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRoleDefinitionListByCustomerResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCustomer( + billingAccountName, + billingProfileName, + customerName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCustomerNext( + billingAccountName, + billingProfileName, + customerName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCustomerPagingAll( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleDefinitionListByCustomerOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCustomerPagingPage( + billingAccountName, + billingProfileName, + customerName, + options, + )) { + yield* page; + } + } + + /** + * Lists the role definitions for an invoice section. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + public listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRoleDefinitionListByInvoiceSectionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByInvoiceSectionPagingAll( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByInvoiceSectionPagingPage( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + settings, + ); + }, + }; + } + + private async *listByInvoiceSectionPagingPage( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRoleDefinitionListByInvoiceSectionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRoleDefinitionListByInvoiceSectionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByInvoiceSectionNext( + billingAccountName, + billingProfileName, + invoiceSectionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByInvoiceSectionPagingAll( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRoleDefinitionListByInvoiceSectionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByInvoiceSectionPagingPage( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + )) { + yield* page; + } + } + + /** + * Lists the role definitions for a billing account. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountName: string, + options?: BillingRoleDefinitionListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: BillingRoleDefinitionListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRoleDefinitionListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: BillingRoleDefinitionListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * List the definition for a department. The operation is supported for billing accounts with agreement + * type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + public listByDepartment( + billingAccountName: string, + departmentName: string, + options?: BillingRoleDefinitionListByDepartmentOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByDepartmentPagingAll( + billingAccountName, + departmentName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByDepartmentPagingPage( + billingAccountName, + departmentName, + options, + settings, + ); + }, + }; + } + + private async *listByDepartmentPagingPage( + billingAccountName: string, + departmentName: string, + options?: BillingRoleDefinitionListByDepartmentOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRoleDefinitionListByDepartmentResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByDepartment( + billingAccountName, + departmentName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByDepartmentNext( + billingAccountName, + departmentName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByDepartmentPagingAll( + billingAccountName: string, + departmentName: string, + options?: BillingRoleDefinitionListByDepartmentOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByDepartmentPagingPage( + billingAccountName, + departmentName, + options, + )) { + yield* page; + } + } + + /** + * List the definition for an enrollment account. The operation is supported for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + public listByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingRoleDefinitionListByEnrollmentAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByEnrollmentAccountPagingAll( + billingAccountName, + enrollmentAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByEnrollmentAccountPagingPage( + billingAccountName, + enrollmentAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByEnrollmentAccountPagingPage( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingRoleDefinitionListByEnrollmentAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingRoleDefinitionListByEnrollmentAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByEnrollmentAccountNext( + billingAccountName, + enrollmentAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByEnrollmentAccountPagingAll( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingRoleDefinitionListByEnrollmentAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByEnrollmentAccountPagingPage( + billingAccountName, + enrollmentAccountName, + options, + )) { + yield* page; + } + } + + /** + * Gets the definition for a role on a billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByBillingProfile( + billingAccountName: string, + billingProfileName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, roleDefinitionName, options }, + getByBillingProfileOperationSpec, + ); + } + + /** + * Lists the role definitions for a billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleDefinitionListByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, options }, + listByBillingProfileOperationSpec, + ); + } + + /** + * Gets the definition for a role on a customer. The operation is supported only for billing accounts + * with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByCustomerOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + roleDefinitionName, + options, + }, + getByCustomerOperationSpec, + ); + } + + /** + * Lists the role definitions for a customer. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + private _listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleDefinitionListByCustomerOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, customerName, options }, + listByCustomerOperationSpec, + ); + } + + /** + * Gets the definition for a role on an invoice section. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByInvoiceSectionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + roleDefinitionName, + options, + }, + getByInvoiceSectionOperationSpec, + ); + } + + /** + * Lists the role definitions for an invoice section. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + private _listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRoleDefinitionListByInvoiceSectionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, invoiceSectionName, options }, + listByInvoiceSectionOperationSpec, + ); + } + + /** + * Gets the definition for a role on a billing account. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, roleDefinitionName, options }, + getByBillingAccountOperationSpec, + ); + } + + /** + * Lists the role definitions for a billing account. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: BillingRoleDefinitionListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * Gets the definition for a role on a department. The operation is supported for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByDepartment( + billingAccountName: string, + departmentName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByDepartmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, roleDefinitionName, options }, + getByDepartmentOperationSpec, + ); + } + + /** + * List the definition for a department. The operation is supported for billing accounts with agreement + * type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + private _listByDepartment( + billingAccountName: string, + departmentName: string, + options?: BillingRoleDefinitionListByDepartmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, options }, + listByDepartmentOperationSpec, + ); + } + + /** + * Gets the definition for a role on an enrollment account. The operation is supported for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByEnrollmentAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + enrollmentAccountName, + roleDefinitionName, + options, + }, + getByEnrollmentAccountOperationSpec, + ); + } + + /** + * List the definition for an enrollment account. The operation is supported for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + private _listByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingRoleDefinitionListByEnrollmentAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, enrollmentAccountName, options }, + listByEnrollmentAccountOperationSpec, + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountName: string, + billingProfileName: string, + nextLink: string, + options?: BillingRoleDefinitionListByBillingProfileNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, nextLink, options }, + listByBillingProfileNextOperationSpec, + ); + } + + /** + * ListByCustomerNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. + * @param options The options parameters. + */ + private _listByCustomerNext( + billingAccountName: string, + billingProfileName: string, + customerName: string, + nextLink: string, + options?: BillingRoleDefinitionListByCustomerNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + nextLink, + options, + }, + listByCustomerNextOperationSpec, + ); + } + + /** + * ListByInvoiceSectionNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. + * @param options The options parameters. + */ + private _listByInvoiceSectionNext( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + nextLink: string, + options?: BillingRoleDefinitionListByInvoiceSectionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + nextLink, + options, + }, + listByInvoiceSectionNextOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: BillingRoleDefinitionListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } + + /** + * ListByDepartmentNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param nextLink The nextLink from the previous successful call to the ListByDepartment method. + * @param options The options parameters. + */ + private _listByDepartmentNext( + billingAccountName: string, + departmentName: string, + nextLink: string, + options?: BillingRoleDefinitionListByDepartmentNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, nextLink, options }, + listByDepartmentNextOperationSpec, + ); + } + + /** + * ListByEnrollmentAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param nextLink The nextLink from the previous successful call to the ListByEnrollmentAccount + * method. + * @param options The options parameters. + */ + private _listByEnrollmentAccountNext( + billingAccountName: string, + enrollmentAccountName: string, + nextLink: string, + options?: BillingRoleDefinitionListByEnrollmentAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, enrollmentAccountName, nextLink, options }, + listByEnrollmentAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{roleDefinitionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinition, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.roleDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingRoleDefinitions/{roleDefinitionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinition, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + Parameters.roleDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingRoleDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{roleDefinitionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinition, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + Parameters.roleDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{roleDefinitionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinition, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.roleDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const getByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleDefinitions/{roleDefinitionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinition, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.departmentName, + Parameters.roleDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/billingRoleDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.departmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getByEnrollmentAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleDefinitions/{roleDefinitionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinition, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.enrollmentAccountName, + Parameters.roleDefinitionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByEnrollmentAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingRoleDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.enrollmentAccountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCustomerNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByDepartmentNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.departmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByEnrollmentAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.enrollmentAccountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/billingRoleDefinitions.ts b/sdk/billing/arm-billing/src/operations/billingRoleDefinitions.ts deleted file mode 100644 index 2bcc5be2b54c..000000000000 --- a/sdk/billing/arm-billing/src/operations/billingRoleDefinitions.ts +++ /dev/null @@ -1,682 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { BillingRoleDefinitions } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { BillingManagementClient } from "../billingManagementClient"; -import { - BillingRoleDefinition, - BillingRoleDefinitionsListByBillingAccountNextOptionalParams, - BillingRoleDefinitionsListByBillingAccountOptionalParams, - BillingRoleDefinitionsListByBillingAccountResponse, - BillingRoleDefinitionsListByInvoiceSectionNextOptionalParams, - BillingRoleDefinitionsListByInvoiceSectionOptionalParams, - BillingRoleDefinitionsListByInvoiceSectionResponse, - BillingRoleDefinitionsListByBillingProfileNextOptionalParams, - BillingRoleDefinitionsListByBillingProfileOptionalParams, - BillingRoleDefinitionsListByBillingProfileResponse, - BillingRoleDefinitionsGetByBillingAccountOptionalParams, - BillingRoleDefinitionsGetByBillingAccountResponse, - BillingRoleDefinitionsGetByInvoiceSectionOptionalParams, - BillingRoleDefinitionsGetByInvoiceSectionResponse, - BillingRoleDefinitionsGetByBillingProfileOptionalParams, - BillingRoleDefinitionsGetByBillingProfileResponse, - BillingRoleDefinitionsListByBillingAccountNextResponse, - BillingRoleDefinitionsListByInvoiceSectionNextResponse, - BillingRoleDefinitionsListByBillingProfileNextResponse -} from "../models"; - -/// -/** Class containing BillingRoleDefinitions operations. */ -export class BillingRoleDefinitionsImpl implements BillingRoleDefinitions { - private readonly client: BillingManagementClient; - - /** - * Initialize a new instance of the class BillingRoleDefinitions class. - * @param client Reference to the service client - */ - constructor(client: BillingManagementClient) { - this.client = client; - } - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param options The options parameters. - */ - public listByBillingAccount( - billingAccountName: string, - options?: BillingRoleDefinitionsListByBillingAccountOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByBillingAccountPagingAll( - billingAccountName, - options - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByBillingAccountPagingPage( - billingAccountName, - options, - settings - ); - } - }; - } - - private async *listByBillingAccountPagingPage( - billingAccountName: string, - options?: BillingRoleDefinitionsListByBillingAccountOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingRoleDefinitionsListByBillingAccountResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByBillingAccount(billingAccountName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByBillingAccountNext( - billingAccountName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByBillingAccountPagingAll( - billingAccountName: string, - options?: BillingRoleDefinitionsListByBillingAccountOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByBillingAccountPagingPage( - billingAccountName, - options - )) { - yield* page; - } - } - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param options The options parameters. - */ - public listByInvoiceSection( - billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: BillingRoleDefinitionsListByInvoiceSectionOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByInvoiceSectionPagingAll( - billingAccountName, - billingProfileName, - invoiceSectionName, - options - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByInvoiceSectionPagingPage( - billingAccountName, - billingProfileName, - invoiceSectionName, - options, - settings - ); - } - }; - } - - private async *listByInvoiceSectionPagingPage( - billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: BillingRoleDefinitionsListByInvoiceSectionOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingRoleDefinitionsListByInvoiceSectionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByInvoiceSection( - billingAccountName, - billingProfileName, - invoiceSectionName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByInvoiceSectionNext( - billingAccountName, - billingProfileName, - invoiceSectionName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByInvoiceSectionPagingAll( - billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: BillingRoleDefinitionsListByInvoiceSectionOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByInvoiceSectionPagingPage( - billingAccountName, - billingProfileName, - invoiceSectionName, - options - )) { - yield* page; - } - } - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param options The options parameters. - */ - public listByBillingProfile( - billingAccountName: string, - billingProfileName: string, - options?: BillingRoleDefinitionsListByBillingProfileOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByBillingProfilePagingAll( - billingAccountName, - billingProfileName, - options - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByBillingProfilePagingPage( - billingAccountName, - billingProfileName, - options, - settings - ); - } - }; - } - - private async *listByBillingProfilePagingPage( - billingAccountName: string, - billingProfileName: string, - options?: BillingRoleDefinitionsListByBillingProfileOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: BillingRoleDefinitionsListByBillingProfileResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByBillingProfile( - billingAccountName, - billingProfileName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByBillingProfileNext( - billingAccountName, - billingProfileName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByBillingProfilePagingAll( - billingAccountName: string, - billingProfileName: string, - options?: BillingRoleDefinitionsListByBillingProfileOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByBillingProfilePagingPage( - billingAccountName, - billingProfileName, - options - )) { - yield* page; - } - } - - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param options The options parameters. - */ - getByBillingAccount( - billingAccountName: string, - billingRoleDefinitionName: string, - options?: BillingRoleDefinitionsGetByBillingAccountOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingRoleDefinitionName, options }, - getByBillingAccountOperationSpec - ); - } - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param options The options parameters. - */ - getByInvoiceSection( - billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - billingRoleDefinitionName: string, - options?: BillingRoleDefinitionsGetByInvoiceSectionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleDefinitionName, - options - }, - getByInvoiceSectionOperationSpec - ); - } - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param options The options parameters. - */ - getByBillingProfile( - billingAccountName: string, - billingProfileName: string, - billingRoleDefinitionName: string, - options?: BillingRoleDefinitionsGetByBillingProfileOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountName, - billingProfileName, - billingRoleDefinitionName, - options - }, - getByBillingProfileOperationSpec - ); - } - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param options The options parameters. - */ - private _listByBillingAccount( - billingAccountName: string, - options?: BillingRoleDefinitionsListByBillingAccountOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, options }, - listByBillingAccountOperationSpec - ); - } - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param options The options parameters. - */ - private _listByInvoiceSection( - billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: BillingRoleDefinitionsListByInvoiceSectionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, invoiceSectionName, options }, - listByInvoiceSectionOperationSpec - ); - } - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param options The options parameters. - */ - private _listByBillingProfile( - billingAccountName: string, - billingProfileName: string, - options?: BillingRoleDefinitionsListByBillingProfileOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, options }, - listByBillingProfileOperationSpec - ); - } - - /** - * ListByBillingAccountNext - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. - * @param options The options parameters. - */ - private _listByBillingAccountNext( - billingAccountName: string, - nextLink: string, - options?: BillingRoleDefinitionsListByBillingAccountNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, nextLink, options }, - listByBillingAccountNextOperationSpec - ); - } - - /** - * ListByInvoiceSectionNext - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. - * @param options The options parameters. - */ - private _listByInvoiceSectionNext( - billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - nextLink: string, - options?: BillingRoleDefinitionsListByInvoiceSectionNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountName, - billingProfileName, - invoiceSectionName, - nextLink, - options - }, - listByInvoiceSectionNextOperationSpec - ); - } - - /** - * ListByBillingProfileNext - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. - * @param options The options parameters. - */ - private _listByBillingProfileNext( - billingAccountName: string, - billingProfileName: string, - nextLink: string, - options?: BillingRoleDefinitionsListByBillingProfileNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, nextLink, options }, - listByBillingProfileNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingRoleDefinition - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.billingRoleDefinitionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const getByInvoiceSectionOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingRoleDefinition - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.invoiceSectionName, - Parameters.billingRoleDefinitionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const getByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingRoleDefinition - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.billingRoleDefinitionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingRoleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.billingAccountName], - headerParameters: [Parameters.accept], - serializer -}; -const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingRoleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.invoiceSectionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingRoleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.billingProfileName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingRoleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingRoleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.nextLink, - Parameters.billingProfileName, - Parameters.invoiceSectionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BillingRoleDefinitionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.nextLink, - Parameters.billingProfileName - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/billing/arm-billing/src/operations/billingSubscriptions.ts b/sdk/billing/arm-billing/src/operations/billingSubscriptions.ts index 024be26ef296..a29c5673ca4d 100644 --- a/sdk/billing/arm-billing/src/operations/billingSubscriptions.ts +++ b/sdk/billing/arm-billing/src/operations/billingSubscriptions.ts @@ -13,35 +13,61 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { BillingSubscription, - BillingSubscriptionsListByCustomerNextOptionalParams, - BillingSubscriptionsListByCustomerOptionalParams, - BillingSubscriptionsListByCustomerResponse, - BillingSubscriptionsListByBillingAccountNextOptionalParams, - BillingSubscriptionsListByBillingAccountOptionalParams, - BillingSubscriptionsListByBillingAccountResponse, BillingSubscriptionsListByBillingProfileNextOptionalParams, BillingSubscriptionsListByBillingProfileOptionalParams, BillingSubscriptionsListByBillingProfileResponse, + BillingSubscriptionsListByCustomerNextOptionalParams, + BillingSubscriptionsListByCustomerOptionalParams, + BillingSubscriptionsListByCustomerResponse, BillingSubscriptionsListByInvoiceSectionNextOptionalParams, BillingSubscriptionsListByInvoiceSectionOptionalParams, BillingSubscriptionsListByInvoiceSectionResponse, + BillingSubscriptionsListByBillingAccountNextOptionalParams, + BillingSubscriptionsListByBillingAccountOptionalParams, + BillingSubscriptionsListByBillingAccountResponse, + BillingSubscriptionsListByCustomerAtBillingAccountNextOptionalParams, + BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams, + BillingSubscriptionsListByCustomerAtBillingAccountResponse, + BillingSubscriptionsListByEnrollmentAccountNextOptionalParams, + BillingSubscriptionsListByEnrollmentAccountOptionalParams, + BillingSubscriptionsListByEnrollmentAccountResponse, + BillingSubscriptionsGetByBillingProfileOptionalParams, + BillingSubscriptionsGetByBillingProfileResponse, + CancelSubscriptionRequest, + BillingSubscriptionsCancelOptionalParams, + BillingSubscriptionsCancelResponse, + BillingSubscriptionMergeRequest, + BillingSubscriptionsMergeOptionalParams, + BillingSubscriptionsMergeResponse, + MoveBillingSubscriptionRequest, + BillingSubscriptionsMoveOptionalParams, + BillingSubscriptionsMoveResponse, + BillingSubscriptionSplitRequest, + BillingSubscriptionsSplitOptionalParams, + BillingSubscriptionsSplitResponse, + BillingSubscriptionsValidateMoveEligibilityOptionalParams, + BillingSubscriptionsValidateMoveEligibilityResponse, + BillingSubscriptionsDeleteOptionalParams, + BillingSubscriptionsDeleteResponse, BillingSubscriptionsGetOptionalParams, BillingSubscriptionsGetResponse, + BillingSubscriptionPatch, BillingSubscriptionsUpdateOptionalParams, BillingSubscriptionsUpdateResponse, - TransferBillingSubscriptionRequestProperties, - BillingSubscriptionsMoveOptionalParams, - BillingSubscriptionsMoveResponse, - BillingSubscriptionsValidateMoveOptionalParams, - BillingSubscriptionsValidateMoveResponse, + BillingSubscriptionsListByBillingProfileNextResponse, BillingSubscriptionsListByCustomerNextResponse, + BillingSubscriptionsListByInvoiceSectionNextResponse, BillingSubscriptionsListByBillingAccountNextResponse, - BillingSubscriptionsListByBillingProfileNextResponse, - BillingSubscriptionsListByInvoiceSectionNextResponse + BillingSubscriptionsListByCustomerAtBillingAccountNextResponse, + BillingSubscriptionsListByEnrollmentAccountNextResponse, } from "../models"; /// @@ -57,22 +83,110 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { this.client = client; } + /** + * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing + * accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingSubscriptionsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountName, + billingProfileName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountName: string, + billingProfileName: string, + options?: BillingSubscriptionsListByBillingProfileOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingSubscriptionsListByBillingProfileResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingProfile( + billingAccountName, + billingProfileName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountName, + billingProfileName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountName: string, + billingProfileName: string, + options?: BillingSubscriptionsListByBillingProfileOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + options, + )) { + yield* page; + } + } + /** * Lists the subscriptions for a customer. The operation is supported only for billing accounts with * agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ public listByCustomer( billingAccountName: string, + billingProfileName: string, customerName: string, - options?: BillingSubscriptionsListByCustomerOptionalParams + options?: BillingSubscriptionsListByCustomerOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByCustomerPagingAll( billingAccountName, + billingProfileName, customerName, - options + options, ); return { next() { @@ -87,27 +201,30 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { } return this.listByCustomerPagingPage( billingAccountName, + billingProfileName, customerName, options, - settings + settings, ); - } + }, }; } private async *listByCustomerPagingPage( billingAccountName: string, + billingProfileName: string, customerName: string, options?: BillingSubscriptionsListByCustomerOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: BillingSubscriptionsListByCustomerResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { result = await this._listByCustomer( billingAccountName, + billingProfileName, customerName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -117,9 +234,10 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { while (continuationToken) { result = await this._listByCustomerNext( billingAccountName, + billingProfileName, customerName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -130,31 +248,39 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { private async *listByCustomerPagingAll( billingAccountName: string, + billingProfileName: string, customerName: string, - options?: BillingSubscriptionsListByCustomerOptionalParams + options?: BillingSubscriptionsListByCustomerOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByCustomerPagingPage( billingAccountName, + billingProfileName, customerName, - options + options, )) { yield* page; } } /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * Lists the subscriptions that are billed to an invoice section. The operation is supported only for + * billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - public listByBillingAccount( + public listByInvoiceSection( billingAccountName: string, - options?: BillingSubscriptionsListByBillingAccountOptionalParams + billingProfileName: string, + invoiceSectionName: string, + options?: BillingSubscriptionsListByInvoiceSectionOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByBillingAccountPagingAll( + const iter = this.listByInvoiceSectionPagingAll( billingAccountName, - options + billingProfileName, + invoiceSectionName, + options, ); return { next() { @@ -167,34 +293,45 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingAccountPagingPage( + return this.listByInvoiceSectionPagingPage( billingAccountName, + billingProfileName, + invoiceSectionName, options, - settings + settings, ); - } + }, }; } - private async *listByBillingAccountPagingPage( + private async *listByInvoiceSectionPagingPage( billingAccountName: string, - options?: BillingSubscriptionsListByBillingAccountOptionalParams, - settings?: PageSettings + billingProfileName: string, + invoiceSectionName: string, + options?: BillingSubscriptionsListByInvoiceSectionOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: BillingSubscriptionsListByBillingAccountResponse; + let result: BillingSubscriptionsListByInvoiceSectionResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingAccount(billingAccountName, options); + result = await this._listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + ); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listByBillingAccountNext( + result = await this._listByInvoiceSectionNext( billingAccountName, + billingProfileName, + invoiceSectionName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -203,34 +340,34 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { } } - private async *listByBillingAccountPagingAll( + private async *listByInvoiceSectionPagingAll( billingAccountName: string, - options?: BillingSubscriptionsListByBillingAccountOptionalParams + billingProfileName: string, + invoiceSectionName: string, + options?: BillingSubscriptionsListByInvoiceSectionOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByBillingAccountPagingPage( + for await (const page of this.listByInvoiceSectionPagingPage( billingAccountName, - options + billingProfileName, + invoiceSectionName, + options, )) { yield* page; } } /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing - * accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * Lists the subscriptions for a billing account. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - public listByBillingProfile( + public listByBillingAccount( billingAccountName: string, - billingProfileName: string, - options?: BillingSubscriptionsListByBillingProfileOptionalParams + options?: BillingSubscriptionsListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByBillingProfilePagingAll( + const iter = this.listByBillingAccountPagingAll( billingAccountName, - billingProfileName, - options + options, ); return { next() { @@ -243,41 +380,34 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingProfilePagingPage( + return this.listByBillingAccountPagingPage( billingAccountName, - billingProfileName, options, - settings + settings, ); - } + }, }; } - private async *listByBillingProfilePagingPage( + private async *listByBillingAccountPagingPage( billingAccountName: string, - billingProfileName: string, - options?: BillingSubscriptionsListByBillingProfileOptionalParams, - settings?: PageSettings + options?: BillingSubscriptionsListByBillingAccountOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: BillingSubscriptionsListByBillingProfileResponse; + let result: BillingSubscriptionsListByBillingAccountResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingProfile( - billingAccountName, - billingProfileName, - options - ); + result = await this._listByBillingAccount(billingAccountName, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listByBillingProfileNext( + result = await this._listByBillingAccountNext( billingAccountName, - billingProfileName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -286,39 +416,34 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { } } - private async *listByBillingProfilePagingAll( + private async *listByBillingAccountPagingAll( billingAccountName: string, - billingProfileName: string, - options?: BillingSubscriptionsListByBillingProfileOptionalParams + options?: BillingSubscriptionsListByBillingAccountOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByBillingProfilePagingPage( + for await (const page of this.listByBillingAccountPagingPage( billingAccountName, - billingProfileName, - options + options, )) { yield* page; } } /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. + * Lists the subscriptions for a customer at billing account level. The operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - public listByInvoiceSection( + public listByCustomerAtBillingAccount( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: BillingSubscriptionsListByInvoiceSectionOptionalParams + customerName: string, + options?: BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByInvoiceSectionPagingAll( + const iter = this.listByCustomerAtBillingAccountPagingAll( billingAccountName, - billingProfileName, - invoiceSectionName, - options + customerName, + options, ); return { next() { @@ -331,32 +456,29 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByInvoiceSectionPagingPage( + return this.listByCustomerAtBillingAccountPagingPage( billingAccountName, - billingProfileName, - invoiceSectionName, + customerName, options, - settings + settings, ); - } + }, }; } - private async *listByInvoiceSectionPagingPage( + private async *listByCustomerAtBillingAccountPagingPage( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: BillingSubscriptionsListByInvoiceSectionOptionalParams, - settings?: PageSettings + customerName: string, + options?: BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: BillingSubscriptionsListByInvoiceSectionResponse; + let result: BillingSubscriptionsListByCustomerAtBillingAccountResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByInvoiceSection( + result = await this._listByCustomerAtBillingAccount( billingAccountName, - billingProfileName, - invoiceSectionName, - options + customerName, + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -364,12 +486,11 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { yield page; } while (continuationToken) { - result = await this._listByInvoiceSectionNext( + result = await this._listByCustomerAtBillingAccountNext( billingAccountName, - billingProfileName, - invoiceSectionName, + customerName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -378,57 +499,131 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { } } - private async *listByInvoiceSectionPagingAll( + private async *listByCustomerAtBillingAccountPagingAll( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: BillingSubscriptionsListByInvoiceSectionOptionalParams + customerName: string, + options?: BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByInvoiceSectionPagingPage( + for await (const page of this.listByCustomerAtBillingAccountPagingPage( billingAccountName, - billingProfileName, - invoiceSectionName, - options + customerName, + options, )) { yield* page; } } /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with - * agreement type Microsoft Partner Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param options The options parameters. - */ - private _listByCustomer( - billingAccountName: string, - customerName: string, - options?: BillingSubscriptionsListByCustomerOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, customerName, options }, - listByCustomerOperationSpec - ); - } - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * Lists the subscriptions for an enrollment account. The operation is supported for billing accounts + * with agreement type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. * @param options The options parameters. */ - private _listByBillingAccount( + public listByEnrollmentAccount( billingAccountName: string, - options?: BillingSubscriptionsListByBillingAccountOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, options }, - listByBillingAccountOperationSpec + enrollmentAccountName: string, + options?: BillingSubscriptionsListByEnrollmentAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByEnrollmentAccountPagingAll( + billingAccountName, + enrollmentAccountName, + options, ); - } - - /** + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByEnrollmentAccountPagingPage( + billingAccountName, + enrollmentAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByEnrollmentAccountPagingPage( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingSubscriptionsListByEnrollmentAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingSubscriptionsListByEnrollmentAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByEnrollmentAccount( + billingAccountName, + enrollmentAccountName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByEnrollmentAccountNext( + billingAccountName, + enrollmentAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByEnrollmentAccountPagingAll( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingSubscriptionsListByEnrollmentAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByEnrollmentAccountPagingPage( + billingAccountName, + enrollmentAccountName, + options, + )) { + yield* page; + } + } + + /** + * Gets a subscription by its billing profile and ID. The operation is supported for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param options The options parameters. + */ + getByBillingProfile( + billingAccountName: string, + billingProfileName: string, + billingSubscriptionName: string, + options?: BillingSubscriptionsGetByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + billingSubscriptionName, + options, + }, + getByBillingProfileOperationSpec, + ); + } + + /** * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing * accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. @@ -438,11 +633,31 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { private _listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: BillingSubscriptionsListByBillingProfileOptionalParams + options?: BillingSubscriptionsListByBillingProfileOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, options }, - listByBillingProfileOperationSpec + listByBillingProfileOperationSpec, + ); + } + + /** + * Lists the subscriptions for a customer. The operation is supported only for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + private _listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingSubscriptionsListByCustomerOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, customerName, options }, + listByCustomerOperationSpec, ); } @@ -458,83 +673,252 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { billingAccountName: string, billingProfileName: string, invoiceSectionName: string, - options?: BillingSubscriptionsListByInvoiceSectionOptionalParams + options?: BillingSubscriptionsListByInvoiceSectionOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, invoiceSectionName, options }, - listByInvoiceSectionOperationSpec + listByInvoiceSectionOperationSpec, ); } /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement and Microsoft Partner Agreement. + * Cancels a usage-based subscription. This operation is supported only for billing accounts of type + * Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters for cancel customer subscription. * @param options The options parameters. */ - get( + async beginCancel( billingAccountName: string, - options?: BillingSubscriptionsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, options }, - getOperationSpec + billingSubscriptionName: string, + parameters: CancelSubscriptionRequest, + options?: BillingSubscriptionsCancelOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsCancelResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingSubscriptionName, + parameters, + options, + }, + spec: cancelOperationSpec, + }); + const poller = await createHttpPoller< + BillingSubscriptionsCancelResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Cancels a usage-based subscription. This operation is supported only for billing accounts of type + * Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters for cancel customer subscription. + * @param options The options parameters. + */ + async beginCancelAndWait( + billingAccountName: string, + billingSubscriptionName: string, + parameters: CancelSubscriptionRequest, + options?: BillingSubscriptionsCancelOptionalParams, + ): Promise { + const poller = await this.beginCancel( + billingAccountName, + billingSubscriptionName, + parameters, + options, ); + return poller.pollUntilDone(); } /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Merges the billing subscription provided in the request with a target billing subscription. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters that are provided to merge the two billing subscriptions. * @param options The options parameters. */ - update( + async beginMerge( billingAccountName: string, - parameters: BillingSubscription, - options?: BillingSubscriptionsUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, parameters, options }, - updateOperationSpec + billingSubscriptionName: string, + parameters: BillingSubscriptionMergeRequest, + options?: BillingSubscriptionsMergeOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsMergeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingSubscriptionName, + parameters, + options, + }, + spec: mergeOperationSpec, + }); + const poller = await createHttpPoller< + BillingSubscriptionsMergeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Merges the billing subscription provided in the request with a target billing subscription. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters that are provided to merge the two billing subscriptions. + * @param options The options parameters. + */ + async beginMergeAndWait( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionMergeRequest, + options?: BillingSubscriptionsMergeOptionalParams, + ): Promise { + const poller = await this.beginMerge( + billingAccountName, + billingSubscriptionName, + parameters, + options, ); + return poller.pollUntilDone(); } /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the - * same billing profile as the existing invoice section. This operation is supported for billing + * Moves charges for a subscription to a new invoice section. The new invoice section must belong to + * the same billing profile as the existing invoice section. This operation is supported for billing * accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters to transfer billing subscription. * @param options The options parameters. */ async beginMove( billingAccountName: string, - parameters: TransferBillingSubscriptionRequestProperties, - options?: BillingSubscriptionsMoveOptionalParams + billingSubscriptionName: string, + parameters: MoveBillingSubscriptionRequest, + options?: BillingSubscriptionsMoveOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, BillingSubscriptionsMoveResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -543,8 +927,8 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -552,79 +936,510 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { billingAccountName, parameters, options }, - moveOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingSubscriptionName, + parameters, + options, + }, + spec: moveOperationSpec, + }); + const poller = await createHttpPoller< + BillingSubscriptionsMoveResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the - * same billing profile as the existing invoice section. This operation is supported for billing + * Moves charges for a subscription to a new invoice section. The new invoice section must belong to + * the same billing profile as the existing invoice section. This operation is supported for billing * accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters to transfer billing subscription. * @param options The options parameters. */ async beginMoveAndWait( billingAccountName: string, - parameters: TransferBillingSubscriptionRequestProperties, - options?: BillingSubscriptionsMoveOptionalParams + billingSubscriptionName: string, + parameters: MoveBillingSubscriptionRequest, + options?: BillingSubscriptionsMoveOptionalParams, ): Promise { const poller = await this.beginMove( billingAccountName, + billingSubscriptionName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Splits a subscription into a new subscription with quantity less than current subscription quantity + * and not equal to 0. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters that are provided to split the billing subscription. + * @param options The options parameters. + */ + async beginSplit( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionSplitRequest, + options?: BillingSubscriptionsSplitOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsSplitResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingSubscriptionName, + parameters, + options, + }, + spec: splitOperationSpec, + }); + const poller = await createHttpPoller< + BillingSubscriptionsSplitResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Splits a subscription into a new subscription with quantity less than current subscription quantity + * and not equal to 0. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters that are provided to split the billing subscription. + * @param options The options parameters. + */ + async beginSplitAndWait( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionSplitRequest, + options?: BillingSubscriptionsSplitOptionalParams, + ): Promise { + const poller = await this.beginSplit( + billingAccountName, + billingSubscriptionName, parameters, - options + options, ); return poller.pollUntilDone(); } /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is + * Validates if charges for a subscription can be moved to a new invoice section. This operation is * supported for billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters to transfer billing subscription. + * @param options The options parameters. + */ + validateMoveEligibility( + billingAccountName: string, + billingSubscriptionName: string, + parameters: MoveBillingSubscriptionRequest, + options?: BillingSubscriptionsValidateMoveEligibilityOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingSubscriptionName, parameters, options }, + validateMoveEligibilityOperationSpec, + ); + } + + /** + * Cancels a billing subscription. This operation is supported only for billing accounts of type + * Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. * @param options The options parameters. */ - validateMove( + async beginDelete( billingAccountName: string, - parameters: TransferBillingSubscriptionRequestProperties, - options?: BillingSubscriptionsValidateMoveOptionalParams - ): Promise { + billingSubscriptionName: string, + options?: BillingSubscriptionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, billingSubscriptionName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + BillingSubscriptionsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Cancels a billing subscription. This operation is supported only for billing accounts of type + * Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param options The options parameters. + */ + async beginDeleteAndWait( + billingAccountName: string, + billingSubscriptionName: string, + options?: BillingSubscriptionsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + billingAccountName, + billingSubscriptionName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param options The options parameters. + */ + get( + billingAccountName: string, + billingSubscriptionName: string, + options?: BillingSubscriptionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingSubscriptionName, options }, + getOperationSpec, + ); + } + + /** + * Updates the properties of a billing subscription. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters The billing properties of a subscription. + * @param options The options parameters. + */ + async beginUpdate( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionPatch, + options?: BillingSubscriptionsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingSubscriptionName, + parameters, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + BillingSubscriptionsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Updates the properties of a billing subscription. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters The billing properties of a subscription. + * @param options The options parameters. + */ + async beginUpdateAndWait( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionPatch, + options?: BillingSubscriptionsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + billingAccountName, + billingSubscriptionName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the subscriptions for a billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: BillingSubscriptionsListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * Lists the subscriptions for a customer at billing account level. The operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + private _listByCustomerAtBillingAccount( + billingAccountName: string, + customerName: string, + options?: BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, customerName, options }, + listByCustomerAtBillingAccountOperationSpec, + ); + } + + /** + * Lists the subscriptions for an enrollment account. The operation is supported for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + private _listByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingSubscriptionsListByEnrollmentAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, enrollmentAccountName, options }, + listByEnrollmentAccountOperationSpec, + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountName: string, + billingProfileName: string, + nextLink: string, + options?: BillingSubscriptionsListByBillingProfileNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, parameters, options }, - validateMoveOperationSpec + { billingAccountName, billingProfileName, nextLink, options }, + listByBillingProfileNextOperationSpec, ); } /** * ListByCustomerNext * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param customerName The ID that uniquely identifies a customer. * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. * @param options The options parameters. */ private _listByCustomerNext( billingAccountName: string, + billingProfileName: string, customerName: string, nextLink: string, - options?: BillingSubscriptionsListByCustomerNextOptionalParams + options?: BillingSubscriptionsListByCustomerNextOptionalParams, ): Promise { return this.client.sendOperationRequest( - { billingAccountName, customerName, nextLink, options }, - listByCustomerNextOperationSpec + { + billingAccountName, + billingProfileName, + customerName, + nextLink, + options, + }, + listByCustomerNextOperationSpec, + ); + } + + /** + * ListByInvoiceSectionNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. + * @param options The options parameters. + */ + private _listByInvoiceSectionNext( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + nextLink: string, + options?: BillingSubscriptionsListByInvoiceSectionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + nextLink, + options, + }, + listByInvoiceSectionNextOperationSpec, ); } @@ -637,324 +1452,601 @@ export class BillingSubscriptionsImpl implements BillingSubscriptions { private _listByBillingAccountNext( billingAccountName: string, nextLink: string, - options?: BillingSubscriptionsListByBillingAccountNextOptionalParams + options?: BillingSubscriptionsListByBillingAccountNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, nextLink, options }, - listByBillingAccountNextOperationSpec + listByBillingAccountNextOperationSpec, ); } /** - * ListByBillingProfileNext + * ListByCustomerAtBillingAccountNext * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param customerName The ID that uniquely identifies a customer. + * @param nextLink The nextLink from the previous successful call to the ListByCustomerAtBillingAccount + * method. * @param options The options parameters. */ - private _listByBillingProfileNext( + private _listByCustomerAtBillingAccountNext( billingAccountName: string, - billingProfileName: string, + customerName: string, nextLink: string, - options?: BillingSubscriptionsListByBillingProfileNextOptionalParams - ): Promise { + options?: BillingSubscriptionsListByCustomerAtBillingAccountNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, nextLink, options }, - listByBillingProfileNextOperationSpec + { billingAccountName, customerName, nextLink, options }, + listByCustomerAtBillingAccountNextOperationSpec, ); } /** - * ListByInvoiceSectionNext + * ListByEnrollmentAccountNext * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. + * @param enrollmentAccountName The name of the enrollment account. + * @param nextLink The nextLink from the previous successful call to the ListByEnrollmentAccount + * method. * @param options The options parameters. */ - private _listByInvoiceSectionNext( + private _listByEnrollmentAccountNext( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, + enrollmentAccountName: string, nextLink: string, - options?: BillingSubscriptionsListByInvoiceSectionNextOptionalParams - ): Promise { + options?: BillingSubscriptionsListByEnrollmentAccountNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { - billingAccountName, - billingProfileName, - invoiceSectionName, - nextLink, - options - }, - listByInvoiceSectionNextOperationSpec + { billingAccountName, enrollmentAccountName, nextLink, options }, + listByEnrollmentAccountNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByCustomerOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions", +const getByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions/{billingSubscriptionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingSubscriptionsListResult + bodyMapper: Mappers.BillingSubscription, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion, Parameters.expand], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, - Parameters.customerName + Parameters.billingAccountName1, + Parameters.billingProfileName1, + Parameters.billingSubscriptionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions", +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingSubscriptionsListResult + bodyMapper: Mappers.BillingSubscriptionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.billingAccountName], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.includeDeleted, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.billingProfileName1, + ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions", +const listByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/billingSubscriptions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingSubscriptionsListResult + bodyMapper: Mappers.BillingSubscriptionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.includeDeleted, + ], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingAccountName1, + Parameters.billingProfileName1, + Parameters.customerName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingSubscriptionsListResult + bodyMapper: Mappers.BillingSubscriptionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.includeDeleted, + ], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.invoiceSectionName + Parameters.billingAccountName1, + Parameters.billingProfileName1, + Parameters.invoiceSectionName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}", - httpMethod: "GET", +const cancelOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}/cancel", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.BillingSubscription + headersMapper: Mappers.BillingSubscriptionsCancelHeaders, + }, + 201: { + headersMapper: Mappers.BillingSubscriptionsCancelHeaders, + }, + 202: { + headersMapper: Mappers.BillingSubscriptionsCancelHeaders, + }, + 204: { + headersMapper: Mappers.BillingSubscriptionsCancelHeaders, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.parameters11, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, - Parameters.subscriptionId + Parameters.billingAccountName1, + Parameters.billingSubscriptionName, ], - headerParameters: [Parameters.accept], - serializer + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}", - httpMethod: "PATCH", +const mergeOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}/merge", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.BillingSubscription + bodyMapper: Mappers.BillingSubscription, + }, + 201: { + bodyMapper: Mappers.BillingSubscription, + }, + 202: { + bodyMapper: Mappers.BillingSubscription, + }, + 204: { + bodyMapper: Mappers.BillingSubscription, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters4, + requestBody: Parameters.parameters12, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, - Parameters.subscriptionId + Parameters.billingAccountName1, + Parameters.billingSubscriptionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const moveOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/move", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}/move", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.BillingSubscription + bodyMapper: Mappers.BillingSubscription, }, 201: { - bodyMapper: Mappers.BillingSubscription + bodyMapper: Mappers.BillingSubscription, }, 202: { - bodyMapper: Mappers.BillingSubscription + bodyMapper: Mappers.BillingSubscription, }, 204: { - bodyMapper: Mappers.BillingSubscription + bodyMapper: Mappers.BillingSubscription, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters13, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, - Parameters.subscriptionId + Parameters.billingAccountName1, + Parameters.billingSubscriptionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const validateMoveOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/validateMoveEligibility", +const splitOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}/split", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ValidateSubscriptionTransferEligibilityResult + bodyMapper: Mappers.BillingSubscription, + }, + 201: { + bodyMapper: Mappers.BillingSubscription, + }, + 202: { + bodyMapper: Mappers.BillingSubscription, + }, + 204: { + bodyMapper: Mappers.BillingSubscription, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters14, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.billingSubscriptionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const validateMoveEligibilityOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}/validateMoveEligibility", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MoveBillingSubscriptionEligibilityResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters13, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.billingSubscriptionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.BillingSubscriptionsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.BillingSubscriptionsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.BillingSubscriptionsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.BillingSubscriptionsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.billingSubscriptionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscription, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.billingSubscriptionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscription, + }, + 201: { + bodyMapper: Mappers.BillingSubscription, + }, + 202: { + bodyMapper: Mappers.BillingSubscription, + }, + 204: { + bodyMapper: Mappers.BillingSubscription, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters5, + requestBody: Parameters.parameters15, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, - Parameters.subscriptionId + Parameters.billingAccountName1, + Parameters.billingSubscriptionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscriptionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.includeDeleted, + Parameters.includeTenantSubscriptions, + Parameters.includeFailed, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName1], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCustomerAtBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscriptionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.includeDeleted, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.customerName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByEnrollmentAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}/billingSubscriptions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscriptionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [ + Parameters.$host, + Parameters.enrollmentAccountName, + Parameters.billingAccountName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscriptionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountName1, + Parameters.billingProfileName1, + ], + headerParameters: [Parameters.accept], + serializer, }; const listByCustomerNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingSubscriptionsListResult + bodyMapper: Mappers.BillingSubscriptionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, Parameters.nextLink, - Parameters.customerName + Parameters.billingAccountName1, + Parameters.billingProfileName1, + Parameters.customerName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { +const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingSubscriptionsListResult + bodyMapper: Mappers.BillingSubscriptionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, - Parameters.nextLink + Parameters.nextLink, + Parameters.billingAccountName1, + Parameters.billingProfileName1, + Parameters.invoiceSectionName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingSubscriptionsListResult + bodyMapper: Mappers.BillingSubscriptionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName + Parameters.billingAccountName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { +const listByCustomerAtBillingAccountNextOperationSpec: coreClient.OperationSpec = + { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscriptionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountName1, + Parameters.customerName1, + ], + headerParameters: [Parameters.accept], + serializer, + }; +const listByEnrollmentAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BillingSubscriptionsListResult + bodyMapper: Mappers.BillingSubscriptionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, - Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName, - Parameters.invoiceSectionName + Parameters.enrollmentAccountName, + Parameters.billingAccountName1, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/billingSubscriptionsAliases.ts b/sdk/billing/arm-billing/src/operations/billingSubscriptionsAliases.ts new file mode 100644 index 000000000000..9c16c6f0cfa0 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/billingSubscriptionsAliases.ts @@ -0,0 +1,367 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { BillingSubscriptionsAliases } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + BillingSubscriptionAlias, + BillingSubscriptionsAliasesListByBillingAccountNextOptionalParams, + BillingSubscriptionsAliasesListByBillingAccountOptionalParams, + BillingSubscriptionsAliasesListByBillingAccountResponse, + BillingSubscriptionsAliasesGetOptionalParams, + BillingSubscriptionsAliasesGetResponse, + BillingSubscriptionsAliasesCreateOrUpdateOptionalParams, + BillingSubscriptionsAliasesCreateOrUpdateResponse, + BillingSubscriptionsAliasesListByBillingAccountNextResponse, +} from "../models"; + +/// +/** Class containing BillingSubscriptionsAliases operations. */ +export class BillingSubscriptionsAliasesImpl + implements BillingSubscriptionsAliases +{ + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class BillingSubscriptionsAliases class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * Lists the subscription aliases for a billing account. The operation is supported for seat based + * billing subscriptions. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountName: string, + options?: BillingSubscriptionsAliasesListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: BillingSubscriptionsAliasesListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: BillingSubscriptionsAliasesListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: BillingSubscriptionsAliasesListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * Gets a subscription by its alias ID. The operation is supported for seat based billing + * subscriptions. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param aliasName The ID that uniquely identifies a subscription alias. + * @param options The options parameters. + */ + get( + billingAccountName: string, + aliasName: string, + options?: BillingSubscriptionsAliasesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, aliasName, options }, + getOperationSpec, + ); + } + + /** + * Creates or updates a billing subscription by its alias ID. The operation is supported for seat + * based billing subscriptions. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param aliasName The ID that uniquely identifies a subscription alias. + * @param parameters A billing subscription alias. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + billingAccountName: string, + aliasName: string, + parameters: BillingSubscriptionAlias, + options?: BillingSubscriptionsAliasesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsAliasesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, aliasName, parameters, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + BillingSubscriptionsAliasesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a billing subscription by its alias ID. The operation is supported for seat + * based billing subscriptions. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param aliasName The ID that uniquely identifies a subscription alias. + * @param parameters A billing subscription alias. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + billingAccountName: string, + aliasName: string, + parameters: BillingSubscriptionAlias, + options?: BillingSubscriptionsAliasesCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + billingAccountName, + aliasName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the subscription aliases for a billing account. The operation is supported for seat based + * billing subscriptions. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: BillingSubscriptionsAliasesListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: BillingSubscriptionsAliasesListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptionAliases/{aliasName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscriptionAlias, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.aliasName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptionAliases/{aliasName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscriptionAlias, + }, + 201: { + bodyMapper: Mappers.BillingSubscriptionAlias, + }, + 202: { + bodyMapper: Mappers.BillingSubscriptionAlias, + }, + 204: { + bodyMapper: Mappers.BillingSubscriptionAlias, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters16, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.aliasName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptionAliases", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscriptionAliasListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.includeDeleted, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName1], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingSubscriptionAliasListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/customers.ts b/sdk/billing/arm-billing/src/operations/customers.ts index 6ae9f60bbc8e..fe6db5db2d81 100644 --- a/sdk/billing/arm-billing/src/operations/customers.ts +++ b/sdk/billing/arm-billing/src/operations/customers.ts @@ -23,8 +23,10 @@ import { CustomersListByBillingAccountResponse, CustomersGetOptionalParams, CustomersGetResponse, + CustomersGetByBillingAccountOptionalParams, + CustomersGetByBillingAccountResponse, CustomersListByBillingProfileNextResponse, - CustomersListByBillingAccountNextResponse + CustomersListByBillingAccountNextResponse, } from "../models"; /// @@ -50,12 +52,12 @@ export class CustomersImpl implements Customers { public listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: CustomersListByBillingProfileOptionalParams + options?: CustomersListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByBillingProfilePagingAll( billingAccountName, billingProfileName, - options + options, ); return { next() { @@ -72,9 +74,9 @@ export class CustomersImpl implements Customers { billingAccountName, billingProfileName, options, - settings + settings, ); - } + }, }; } @@ -82,7 +84,7 @@ export class CustomersImpl implements Customers { billingAccountName: string, billingProfileName: string, options?: CustomersListByBillingProfileOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CustomersListByBillingProfileResponse; let continuationToken = settings?.continuationToken; @@ -90,7 +92,7 @@ export class CustomersImpl implements Customers { result = await this._listByBillingProfile( billingAccountName, billingProfileName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -102,7 +104,7 @@ export class CustomersImpl implements Customers { billingAccountName, billingProfileName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -114,12 +116,12 @@ export class CustomersImpl implements Customers { private async *listByBillingProfilePagingAll( billingAccountName: string, billingProfileName: string, - options?: CustomersListByBillingProfileOptionalParams + options?: CustomersListByBillingProfileOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByBillingProfilePagingPage( billingAccountName, billingProfileName, - options + options, )) { yield* page; } @@ -133,11 +135,11 @@ export class CustomersImpl implements Customers { */ public listByBillingAccount( billingAccountName: string, - options?: CustomersListByBillingAccountOptionalParams + options?: CustomersListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByBillingAccountPagingAll( billingAccountName, - options + options, ); return { next() { @@ -153,16 +155,16 @@ export class CustomersImpl implements Customers { return this.listByBillingAccountPagingPage( billingAccountName, options, - settings + settings, ); - } + }, }; } private async *listByBillingAccountPagingPage( billingAccountName: string, options?: CustomersListByBillingAccountOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CustomersListByBillingAccountResponse; let continuationToken = settings?.continuationToken; @@ -177,7 +179,7 @@ export class CustomersImpl implements Customers { result = await this._listByBillingAccountNext( billingAccountName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -188,16 +190,36 @@ export class CustomersImpl implements Customers { private async *listByBillingAccountPagingAll( billingAccountName: string, - options?: CustomersListByBillingAccountOptionalParams + options?: CustomersListByBillingAccountOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByBillingAccountPagingPage( billingAccountName, - options + options, )) { yield* page; } } + /** + * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type + * Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + get( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: CustomersGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, customerName, options }, + getOperationSpec, + ); + } + /** * Lists the customers that are billed to a billing profile. The operation is supported only for * billing accounts with agreement type Microsoft Partner Agreement. @@ -208,45 +230,45 @@ export class CustomersImpl implements Customers { private _listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: CustomersListByBillingProfileOptionalParams + options?: CustomersListByBillingProfileOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, options }, - listByBillingProfileOperationSpec + listByBillingProfileOperationSpec, ); } /** - * Lists the customers that are billed to a billing account. The operation is supported only for - * billing accounts with agreement type Microsoft Partner Agreement. + * Gets a customer by its ID at billing account level. The operation is supported only for billing + * accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - private _listByBillingAccount( + getByBillingAccount( billingAccountName: string, - options?: CustomersListByBillingAccountOptionalParams - ): Promise { + customerName: string, + options?: CustomersGetByBillingAccountOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, options }, - listByBillingAccountOperationSpec + { billingAccountName, customerName, options }, + getByBillingAccountOperationSpec, ); } /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. + * Lists the customers that are billed to a billing account. The operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - get( + private _listByBillingAccount( billingAccountName: string, - customerName: string, - options?: CustomersGetOptionalParams - ): Promise { + options?: CustomersListByBillingAccountOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, customerName, options }, - getOperationSpec + { billingAccountName, options }, + listByBillingAccountOperationSpec, ); } @@ -261,11 +283,11 @@ export class CustomersImpl implements Customers { billingAccountName: string, billingProfileName: string, nextLink: string, - options?: CustomersListByBillingProfileNextOptionalParams + options?: CustomersListByBillingProfileNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, nextLink, options }, - listByBillingProfileNextOperationSpec + listByBillingProfileNextOperationSpec, ); } @@ -278,130 +300,148 @@ export class CustomersImpl implements Customers { private _listByBillingAccountNext( billingAccountName: string, nextLink: string, - options?: CustomersListByBillingAccountNextOptionalParams + options?: CustomersListByBillingAccountNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, nextLink, options }, - listByBillingAccountNextOperationSpec + listByBillingAccountNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers", +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomerListResult + bodyMapper: Mappers.Customer, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.search, - Parameters.filter - ], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, + Parameters.customerName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers", +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomerListResult + bodyMapper: Mappers.CustomerListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [ Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, Parameters.search, - Parameters.filter ], - urlParameters: [Parameters.$host, Parameters.billingAccountName], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}", +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Customer + bodyMapper: Mappers.Customer, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.expand], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.customerName + Parameters.customerName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomerListResult + bodyMapper: Mappers.CustomerListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [ Parameters.apiVersion, + Parameters.expand, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, Parameters.search, - Parameters.filter ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomerListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomerListResult + bodyMapper: Mappers.CustomerListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.search, - Parameters.filter - ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/departments.ts b/sdk/billing/arm-billing/src/operations/departments.ts new file mode 100644 index 000000000000..52a69413afe9 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/departments.ts @@ -0,0 +1,227 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Departments } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + Department, + DepartmentsListByBillingAccountNextOptionalParams, + DepartmentsListByBillingAccountOptionalParams, + DepartmentsListByBillingAccountResponse, + DepartmentsGetOptionalParams, + DepartmentsGetResponse, + DepartmentsListByBillingAccountNextResponse, +} from "../models"; + +/// +/** Class containing Departments operations. */ +export class DepartmentsImpl implements Departments { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class Departments class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * Lists the departments that a user has access to. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountName: string, + options?: DepartmentsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: DepartmentsListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DepartmentsListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: DepartmentsListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * Gets a department by ID. The operation is supported only for billing accounts with agreement type + * Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + get( + billingAccountName: string, + departmentName: string, + options?: DepartmentsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, options }, + getOperationSpec, + ); + } + + /** + * Lists the departments that a user has access to. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: DepartmentsListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: DepartmentsListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Department, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.departmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DepartmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.search, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DepartmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/enrollmentAccounts.ts b/sdk/billing/arm-billing/src/operations/enrollmentAccounts.ts index 0c35bccf7dd1..d6f7605b05b3 100644 --- a/sdk/billing/arm-billing/src/operations/enrollmentAccounts.ts +++ b/sdk/billing/arm-billing/src/operations/enrollmentAccounts.ts @@ -14,13 +14,19 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; import { - EnrollmentAccountSummary, - EnrollmentAccountsListNextOptionalParams, - EnrollmentAccountsListOptionalParams, - EnrollmentAccountsListResponse, + EnrollmentAccount, + EnrollmentAccountsListByDepartmentNextOptionalParams, + EnrollmentAccountsListByDepartmentOptionalParams, + EnrollmentAccountsListByDepartmentResponse, + EnrollmentAccountsListByBillingAccountNextOptionalParams, + EnrollmentAccountsListByBillingAccountOptionalParams, + EnrollmentAccountsListByBillingAccountResponse, + EnrollmentAccountsGetByDepartmentOptionalParams, + EnrollmentAccountsGetByDepartmentResponse, EnrollmentAccountsGetOptionalParams, EnrollmentAccountsGetResponse, - EnrollmentAccountsListNextResponse + EnrollmentAccountsListByDepartmentNextResponse, + EnrollmentAccountsListByBillingAccountNextResponse, } from "../models"; /// @@ -37,13 +43,22 @@ export class EnrollmentAccountsImpl implements EnrollmentAccounts { } /** - * Lists the enrollment accounts the caller has access to. + * Lists the enrollment accounts for a department. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. * @param options The options parameters. */ - public list( - options?: EnrollmentAccountsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + public listByDepartment( + billingAccountName: string, + departmentName: string, + options?: EnrollmentAccountsListByDepartmentOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByDepartmentPagingAll( + billingAccountName, + departmentName, + options, + ); return { next() { return iter.next(); @@ -55,26 +70,42 @@ export class EnrollmentAccountsImpl implements EnrollmentAccounts { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage(options, settings); - } + return this.listByDepartmentPagingPage( + billingAccountName, + departmentName, + options, + settings, + ); + }, }; } - private async *listPagingPage( - options?: EnrollmentAccountsListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: EnrollmentAccountsListResponse; + private async *listByDepartmentPagingPage( + billingAccountName: string, + departmentName: string, + options?: EnrollmentAccountsListByDepartmentOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: EnrollmentAccountsListByDepartmentResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._list(options); + result = await this._listByDepartment( + billingAccountName, + departmentName, + options, + ); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listByDepartmentNext( + billingAccountName, + departmentName, + continuationToken, + options, + ); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -82,102 +113,333 @@ export class EnrollmentAccountsImpl implements EnrollmentAccounts { } } - private async *listPagingAll( - options?: EnrollmentAccountsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + private async *listByDepartmentPagingAll( + billingAccountName: string, + departmentName: string, + options?: EnrollmentAccountsListByDepartmentOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByDepartmentPagingPage( + billingAccountName, + departmentName, + options, + )) { yield* page; } } /** - * Lists the enrollment accounts the caller has access to. + * Lists the enrollment accounts for a billing account. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ - private _list( - options?: EnrollmentAccountsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + public listByBillingAccount( + billingAccountName: string, + options?: EnrollmentAccountsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: EnrollmentAccountsListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: EnrollmentAccountsListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: EnrollmentAccountsListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * Gets an enrollment account by department. The operation is supported only for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + getByDepartment( + billingAccountName: string, + departmentName: string, + enrollmentAccountName: string, + options?: EnrollmentAccountsGetByDepartmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, enrollmentAccountName, options }, + getByDepartmentOperationSpec, + ); + } + + /** + * Lists the enrollment accounts for a department. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + private _listByDepartment( + billingAccountName: string, + departmentName: string, + options?: EnrollmentAccountsListByDepartmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, departmentName, options }, + listByDepartmentOperationSpec, + ); } /** - * Gets a enrollment account by name. - * @param name Enrollment Account name. + * Gets an enrollment account by ID. The operation is supported only for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. * @param options The options parameters. */ get( - name: string, - options?: EnrollmentAccountsGetOptionalParams + billingAccountName: string, + enrollmentAccountName: string, + options?: EnrollmentAccountsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( - { name, options }, - getOperationSpec + { billingAccountName, enrollmentAccountName, options }, + getOperationSpec, ); } /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. + * Lists the enrollment accounts for a billing account. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ - private _listNext( + private _listByBillingAccount( + billingAccountName: string, + options?: EnrollmentAccountsListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * ListByDepartmentNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param nextLink The nextLink from the previous successful call to the ListByDepartment method. + * @param options The options parameters. + */ + private _listByDepartmentNext( + billingAccountName: string, + departmentName: string, nextLink: string, - options?: EnrollmentAccountsListNextOptionalParams - ): Promise { + options?: EnrollmentAccountsListByDepartmentNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec + { billingAccountName, departmentName, nextLink, options }, + listByDepartmentNextOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: EnrollmentAccountsListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Billing/enrollmentAccounts", +const getByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/enrollmentAccounts/{enrollmentAccountName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EnrollmentAccountListResult + bodyMapper: Mappers.EnrollmentAccount, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host], + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.departmentName, + Parameters.enrollmentAccountName, + ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const listByDepartmentOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}/enrollmentAccounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnrollmentAccountListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.departmentName, + ], + headerParameters: [Parameters.accept], + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Billing/enrollmentAccounts/{name}", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EnrollmentAccountSummary + bodyMapper: Mappers.EnrollmentAccount, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.enrollmentAccountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnrollmentAccountListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.name], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listNextOperationSpec: coreClient.OperationSpec = { +const listByDepartmentNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EnrollmentAccountListResult + bodyMapper: Mappers.EnrollmentAccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.departmentName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnrollmentAccountListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.nextLink], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/index.ts b/sdk/billing/arm-billing/src/operations/index.ts index 44525347c3ce..658119e77c6f 100644 --- a/sdk/billing/arm-billing/src/operations/index.ts +++ b/sdk/billing/arm-billing/src/operations/index.ts @@ -6,24 +6,33 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./agreements"; +export * from "./associatedTenants"; +export * from "./availableBalances"; export * from "./billingAccounts"; export * from "./address"; -export * from "./availableBalances"; -export * from "./instructions"; -export * from "./billingProfiles"; -export * from "./customers"; -export * from "./invoiceSections"; export * from "./billingPermissions"; +export * from "./billingProfiles"; +export * from "./billingPropertyOperations"; +export * from "./billingRequests"; +export * from "./billingRoleAssignments"; +export * from "./billingRoleDefinitionOperations"; +export * from "./savingsPlanOrders"; +export * from "./savingsPlans"; export * from "./billingSubscriptions"; -export * from "./products"; +export * from "./billingSubscriptionsAliases"; +export * from "./customers"; +export * from "./departments"; +export * from "./enrollmentAccounts"; export * from "./invoices"; -export * from "./transactions"; -export * from "./policies"; -export * from "./billingPropertyOperations"; +export * from "./invoiceSections"; export * from "./operations"; -export * from "./billingRoleDefinitions"; -export * from "./billingRoleAssignments"; -export * from "./agreements"; +export * from "./paymentMethods"; +export * from "./policies"; +export * from "./products"; export * from "./reservations"; -export * from "./enrollmentAccounts"; -export * from "./billingPeriods"; +export * from "./reservationOrders"; +export * from "./transactions"; +export * from "./transfers"; +export * from "./partnerTransfers"; +export * from "./recipientTransfers"; diff --git a/sdk/billing/arm-billing/src/operations/instructions.ts b/sdk/billing/arm-billing/src/operations/instructions.ts deleted file mode 100644 index 14a7250b6033..000000000000 --- a/sdk/billing/arm-billing/src/operations/instructions.ts +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Instructions } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { BillingManagementClient } from "../billingManagementClient"; -import { - Instruction, - InstructionsListByBillingProfileNextOptionalParams, - InstructionsListByBillingProfileOptionalParams, - InstructionsListByBillingProfileResponse, - InstructionsGetOptionalParams, - InstructionsGetResponse, - InstructionsPutOptionalParams, - InstructionsPutResponse, - InstructionsListByBillingProfileNextResponse -} from "../models"; - -/// -/** Class containing Instructions operations. */ -export class InstructionsImpl implements Instructions { - private readonly client: BillingManagementClient; - - /** - * Initialize a new instance of the class Instructions class. - * @param client Reference to the service client - */ - constructor(client: BillingManagementClient) { - this.client = client; - } - - /** - * Lists the instructions by billing profile id. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param options The options parameters. - */ - public listByBillingProfile( - billingAccountName: string, - billingProfileName: string, - options?: InstructionsListByBillingProfileOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByBillingProfilePagingAll( - billingAccountName, - billingProfileName, - options - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByBillingProfilePagingPage( - billingAccountName, - billingProfileName, - options, - settings - ); - } - }; - } - - private async *listByBillingProfilePagingPage( - billingAccountName: string, - billingProfileName: string, - options?: InstructionsListByBillingProfileOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: InstructionsListByBillingProfileResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByBillingProfile( - billingAccountName, - billingProfileName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByBillingProfileNext( - billingAccountName, - billingProfileName, - continuationToken, - options - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByBillingProfilePagingAll( - billingAccountName: string, - billingProfileName: string, - options?: InstructionsListByBillingProfileOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByBillingProfilePagingPage( - billingAccountName, - billingProfileName, - options - )) { - yield* page; - } - } - - /** - * Lists the instructions by billing profile id. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param options The options parameters. - */ - private _listByBillingProfile( - billingAccountName: string, - billingProfileName: string, - options?: InstructionsListByBillingProfileOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, options }, - listByBillingProfileOperationSpec - ); - } - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for - * certain customers. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param options The options parameters. - */ - get( - billingAccountName: string, - billingProfileName: string, - instructionName: string, - options?: InstructionsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, instructionName, options }, - getOperationSpec - ); - } - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for - * certain customers. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @param options The options parameters. - */ - put( - billingAccountName: string, - billingProfileName: string, - instructionName: string, - parameters: Instruction, - options?: InstructionsPutOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountName, - billingProfileName, - instructionName, - parameters, - options - }, - putOperationSpec - ); - } - - /** - * ListByBillingProfileNext - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. - * @param options The options parameters. - */ - private _listByBillingProfileNext( - billingAccountName: string, - billingProfileName: string, - nextLink: string, - options?: InstructionsListByBillingProfileNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, nextLink, options }, - listByBillingProfileNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.InstructionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.billingProfileName - ], - headerParameters: [Parameters.accept], - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Instruction - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.instructionName - ], - headerParameters: [Parameters.accept], - serializer -}; -const putOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Instruction - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.instructionName - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.InstructionListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.billingAccountName, - Parameters.nextLink, - Parameters.billingProfileName - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/billing/arm-billing/src/operations/invoiceSections.ts b/sdk/billing/arm-billing/src/operations/invoiceSections.ts index 9e456ef6b7c4..94d16541e543 100644 --- a/sdk/billing/arm-billing/src/operations/invoiceSections.ts +++ b/sdk/billing/arm-billing/src/operations/invoiceSections.ts @@ -13,18 +13,26 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { InvoiceSection, InvoiceSectionsListByBillingProfileNextOptionalParams, InvoiceSectionsListByBillingProfileOptionalParams, InvoiceSectionsListByBillingProfileResponse, + InvoiceSectionsValidateDeleteEligibilityOptionalParams, + InvoiceSectionsValidateDeleteEligibilityResponse, + InvoiceSectionsDeleteOptionalParams, + InvoiceSectionsDeleteResponse, InvoiceSectionsGetOptionalParams, InvoiceSectionsGetResponse, InvoiceSectionsCreateOrUpdateOptionalParams, InvoiceSectionsCreateOrUpdateResponse, - InvoiceSectionsListByBillingProfileNextResponse + InvoiceSectionsListByBillingProfileNextResponse, } from "../models"; /// @@ -50,12 +58,12 @@ export class InvoiceSectionsImpl implements InvoiceSections { public listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: InvoiceSectionsListByBillingProfileOptionalParams + options?: InvoiceSectionsListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByBillingProfilePagingAll( billingAccountName, billingProfileName, - options + options, ); return { next() { @@ -72,9 +80,9 @@ export class InvoiceSectionsImpl implements InvoiceSections { billingAccountName, billingProfileName, options, - settings + settings, ); - } + }, }; } @@ -82,7 +90,7 @@ export class InvoiceSectionsImpl implements InvoiceSections { billingAccountName: string, billingProfileName: string, options?: InvoiceSectionsListByBillingProfileOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: InvoiceSectionsListByBillingProfileResponse; let continuationToken = settings?.continuationToken; @@ -90,7 +98,7 @@ export class InvoiceSectionsImpl implements InvoiceSections { result = await this._listByBillingProfile( billingAccountName, billingProfileName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -102,7 +110,7 @@ export class InvoiceSectionsImpl implements InvoiceSections { billingAccountName, billingProfileName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -114,35 +122,139 @@ export class InvoiceSectionsImpl implements InvoiceSections { private async *listByBillingProfilePagingAll( billingAccountName: string, billingProfileName: string, - options?: InvoiceSectionsListByBillingProfileOptionalParams + options?: InvoiceSectionsListByBillingProfileOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByBillingProfilePagingPage( billingAccountName, billingProfileName, - options + options, )) { yield* page; } } /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. + * Validates if the invoice section can be deleted. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - private _listByBillingProfile( + validateDeleteEligibility( billingAccountName: string, billingProfileName: string, - options?: InvoiceSectionsListByBillingProfileOptionalParams - ): Promise { + invoiceSectionName: string, + options?: InvoiceSectionsValidateDeleteEligibilityOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, options }, - listByBillingProfileOperationSpec + { billingAccountName, billingProfileName, invoiceSectionName, options }, + validateDeleteEligibilityOperationSpec, ); } + /** + * Deletes an invoice section. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + async beginDelete( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: InvoiceSectionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + InvoiceSectionsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + InvoiceSectionsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an invoice section. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + async beginDeleteAndWait( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: InvoiceSectionsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + ); + return poller.pollUntilDone(); + } + /** * Gets an invoice section by its ID. The operation is supported only for billing accounts with * agreement type Microsoft Customer Agreement. @@ -155,11 +267,11 @@ export class InvoiceSectionsImpl implements InvoiceSections { billingAccountName: string, billingProfileName: string, invoiceSectionName: string, - options?: InvoiceSectionsGetOptionalParams + options?: InvoiceSectionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, invoiceSectionName, options }, - getOperationSpec + getOperationSpec, ); } @@ -169,7 +281,7 @@ export class InvoiceSectionsImpl implements InvoiceSections { * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. + * @param parameters An invoice section. * @param options The options parameters. */ async beginCreateOrUpdate( @@ -177,30 +289,29 @@ export class InvoiceSectionsImpl implements InvoiceSections { billingProfileName: string, invoiceSectionName: string, parameters: InvoiceSection, - options?: InvoiceSectionsCreateOrUpdateOptionalParams + options?: InvoiceSectionsCreateOrUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, InvoiceSectionsCreateOrUpdateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -209,8 +320,8 @@ export class InvoiceSectionsImpl implements InvoiceSections { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -218,25 +329,29 @@ export class InvoiceSectionsImpl implements InvoiceSections { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, billingProfileName, invoiceSectionName, parameters, - options + options, }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + InvoiceSectionsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -248,7 +363,7 @@ export class InvoiceSectionsImpl implements InvoiceSections { * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. + * @param parameters An invoice section. * @param options The options parameters. */ async beginCreateOrUpdateAndWait( @@ -256,18 +371,36 @@ export class InvoiceSectionsImpl implements InvoiceSections { billingProfileName: string, invoiceSectionName: string, parameters: InvoiceSection, - options?: InvoiceSectionsCreateOrUpdateOptionalParams + options?: InvoiceSectionsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( billingAccountName, billingProfileName, invoiceSectionName, parameters, - options + options, ); return poller.pollUntilDone(); } + /** + * Lists the invoice sections that a user has access to. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: InvoiceSectionsListByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, options }, + listByBillingProfileOperationSpec, + ); + } + /** * ListByBillingProfileNext * @param billingAccountName The ID that uniquely identifies a billing account. @@ -279,111 +412,167 @@ export class InvoiceSectionsImpl implements InvoiceSections { billingAccountName: string, billingProfileName: string, nextLink: string, - options?: InvoiceSectionsListByBillingProfileNextOptionalParams + options?: InvoiceSectionsListByBillingProfileNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, nextLink, options }, - listByBillingProfileNextOperationSpec + listByBillingProfileNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections", - httpMethod: "GET", +const validateDeleteEligibilityOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/validateDeleteEligibility", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.InvoiceSectionListResult + bodyMapper: Mappers.DeleteInvoiceSectionEligibilityResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, + Parameters.invoiceSectionName, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.InvoiceSectionsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.InvoiceSectionsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.InvoiceSectionsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.InvoiceSectionsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.InvoiceSection + bodyMapper: Mappers.InvoiceSection, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.billingProfileName, - Parameters.invoiceSectionName + Parameters.invoiceSectionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.InvoiceSection + bodyMapper: Mappers.InvoiceSection, }, 201: { - bodyMapper: Mappers.InvoiceSection + bodyMapper: Mappers.InvoiceSection, }, 202: { - bodyMapper: Mappers.InvoiceSection + bodyMapper: Mappers.InvoiceSection, }, 204: { - bodyMapper: Mappers.InvoiceSection + bodyMapper: Mappers.InvoiceSection, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters3, + requestBody: Parameters.parameters18, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.billingProfileName, - Parameters.invoiceSectionName + Parameters.invoiceSectionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, +}; +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.InvoiceSectionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.includeDeleted, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, }; const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.InvoiceSectionListResult + bodyMapper: Mappers.InvoiceSectionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/invoices.ts b/sdk/billing/arm-billing/src/operations/invoices.ts index fb31072c2091..63eab26f2297 100644 --- a/sdk/billing/arm-billing/src/operations/invoices.ts +++ b/sdk/billing/arm-billing/src/operations/invoices.ts @@ -13,36 +13,45 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Invoice, - InvoicesListByBillingAccountNextOptionalParams, - InvoicesListByBillingAccountOptionalParams, - InvoicesListByBillingAccountResponse, InvoicesListByBillingProfileNextOptionalParams, InvoicesListByBillingProfileOptionalParams, InvoicesListByBillingProfileResponse, + InvoicesListByBillingAccountNextOptionalParams, + InvoicesListByBillingAccountOptionalParams, + InvoicesListByBillingAccountResponse, InvoicesListByBillingSubscriptionNextOptionalParams, InvoicesListByBillingSubscriptionOptionalParams, InvoicesListByBillingSubscriptionResponse, + DocumentDownloadRequest, + InvoicesDownloadDocumentsByBillingAccountOptionalParams, + InvoicesDownloadDocumentsByBillingAccountResponse, + InvoicesAmendOptionalParams, + InvoicesAmendResponse, + InvoicesDownloadByBillingAccountOptionalParams, + InvoicesDownloadByBillingAccountResponse, + InvoicesDownloadSummaryByBillingAccountOptionalParams, + InvoicesDownloadSummaryByBillingAccountResponse, + InvoicesGetByBillingAccountOptionalParams, + InvoicesGetByBillingAccountResponse, + InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams, + InvoicesDownloadDocumentsByBillingSubscriptionResponse, + InvoicesDownloadByBillingSubscriptionOptionalParams, + InvoicesDownloadByBillingSubscriptionResponse, + InvoicesGetByBillingSubscriptionOptionalParams, + InvoicesGetByBillingSubscriptionResponse, InvoicesGetOptionalParams, InvoicesGetResponse, - InvoicesGetByIdOptionalParams, - InvoicesGetByIdResponse, - InvoicesDownloadInvoiceOptionalParams, - InvoicesDownloadInvoiceResponse, - InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams, - InvoicesDownloadMultipleBillingProfileInvoicesResponse, - InvoicesGetBySubscriptionAndInvoiceIdOptionalParams, - InvoicesGetBySubscriptionAndInvoiceIdResponse, - InvoicesDownloadBillingSubscriptionInvoiceOptionalParams, - InvoicesDownloadBillingSubscriptionInvoiceResponse, - InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams, - InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse, - InvoicesListByBillingAccountNextResponse, InvoicesListByBillingProfileNextResponse, - InvoicesListByBillingSubscriptionNextResponse + InvoicesListByBillingAccountNextResponse, + InvoicesListByBillingSubscriptionNextResponse, } from "../models"; /// @@ -59,27 +68,22 @@ export class InvoicesImpl implements Invoices { } /** - * Lists the invoices for a billing account for a given start date and end date. The operation is + * Lists the invoices for a billing profile for a given start date and end date. The operation is * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer * Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in - * MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY - * format. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - public listByBillingAccount( + public listByBillingProfile( billingAccountName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingAccountOptionalParams + billingProfileName: string, + options?: InvoicesListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByBillingAccountPagingAll( + const iter = this.listByBillingProfilePagingAll( billingAccountName, - periodStartDate, - periodEndDate, - options + billingProfileName, + options, ); return { next() { @@ -92,32 +96,29 @@ export class InvoicesImpl implements Invoices { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingAccountPagingPage( + return this.listByBillingProfilePagingPage( billingAccountName, - periodStartDate, - periodEndDate, + billingProfileName, options, - settings + settings, ); - } + }, }; } - private async *listByBillingAccountPagingPage( + private async *listByBillingProfilePagingPage( billingAccountName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingAccountOptionalParams, - settings?: PageSettings + billingProfileName: string, + options?: InvoicesListByBillingProfileOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: InvoicesListByBillingAccountResponse; + let result: InvoicesListByBillingProfileResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingAccount( + result = await this._listByBillingProfile( billingAccountName, - periodStartDate, - periodEndDate, - options + billingProfileName, + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -125,12 +126,11 @@ export class InvoicesImpl implements Invoices { yield page; } while (continuationToken) { - result = await this._listByBillingAccountNext( + result = await this._listByBillingProfileNext( billingAccountName, - periodStartDate, - periodEndDate, + billingProfileName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -139,47 +139,33 @@ export class InvoicesImpl implements Invoices { } } - private async *listByBillingAccountPagingAll( + private async *listByBillingProfilePagingAll( billingAccountName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingAccountOptionalParams + billingProfileName: string, + options?: InvoicesListByBillingProfileOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByBillingAccountPagingPage( + for await (const page of this.listByBillingProfilePagingPage( billingAccountName, - periodStartDate, - periodEndDate, - options + billingProfileName, + options, )) { yield* page; } } /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is - * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. + * Lists the invoices for a billing account for a given start date and end date. The operation is + * supported for all billing account types. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in - * MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY - * format. * @param options The options parameters. */ - public listByBillingProfile( + public listByBillingAccount( billingAccountName: string, - billingProfileName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingProfileOptionalParams + options?: InvoicesListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByBillingProfilePagingAll( + const iter = this.listByBillingAccountPagingAll( billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate, - options + options, ); return { next() { @@ -192,49 +178,34 @@ export class InvoicesImpl implements Invoices { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingProfilePagingPage( + return this.listByBillingAccountPagingPage( billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate, options, - settings + settings, ); - } + }, }; } - private async *listByBillingProfilePagingPage( + private async *listByBillingAccountPagingPage( billingAccountName: string, - billingProfileName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingProfileOptionalParams, - settings?: PageSettings + options?: InvoicesListByBillingAccountOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: InvoicesListByBillingProfileResponse; + let result: InvoicesListByBillingAccountResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingProfile( - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate, - options - ); + result = await this._listByBillingAccount(billingAccountName, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listByBillingProfileNext( + result = await this._listByBillingAccountNext( billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -243,40 +214,27 @@ export class InvoicesImpl implements Invoices { } } - private async *listByBillingProfilePagingAll( + private async *listByBillingAccountPagingAll( billingAccountName: string, - billingProfileName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingProfileOptionalParams + options?: InvoicesListByBillingAccountOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByBillingProfilePagingPage( + for await (const page of this.listByBillingAccountPagingPage( billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate, - options + options, )) { yield* page; } } /** - * Lists the invoices for a subscription. - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. + * Lists the invoices for a subscription. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param options The options parameters. */ public listByBillingSubscription( - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingSubscriptionOptionalParams + options?: InvoicesListByBillingSubscriptionOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByBillingSubscriptionPagingAll( - periodStartDate, - periodEndDate, - options - ); + const iter = this.listByBillingSubscriptionPagingAll(options); return { next() { return iter.next(); @@ -288,30 +246,19 @@ export class InvoicesImpl implements Invoices { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingSubscriptionPagingPage( - periodStartDate, - periodEndDate, - options, - settings - ); - } + return this.listByBillingSubscriptionPagingPage(options, settings); + }, }; } private async *listByBillingSubscriptionPagingPage( - periodStartDate: string, - periodEndDate: string, options?: InvoicesListByBillingSubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: InvoicesListByBillingSubscriptionResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingSubscription( - periodStartDate, - periodEndDate, - options - ); + result = await this._listByBillingSubscription(options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); @@ -319,10 +266,8 @@ export class InvoicesImpl implements Invoices { } while (continuationToken) { result = await this._listByBillingSubscriptionNext( - periodStartDate, - periodEndDate, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -332,143 +277,253 @@ export class InvoicesImpl implements Invoices { } private async *listByBillingSubscriptionPagingAll( - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingSubscriptionOptionalParams + options?: InvoicesListByBillingSubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByBillingSubscriptionPagingPage( - periodStartDate, - periodEndDate, - options + options, )) { yield* page; } } /** - * Lists the invoices for a billing account for a given start date and end date. The operation is + * Lists the invoices for a billing profile for a given start date and end date. The operation is * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer * Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in - * MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY - * format. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - private _listByBillingAccount( + private _listByBillingProfile( billingAccountName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingAccountOptionalParams - ): Promise { + billingProfileName: string, + options?: InvoicesListByBillingProfileOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, periodStartDate, periodEndDate, options }, - listByBillingAccountOperationSpec + { billingAccountName, billingProfileName, options }, + listByBillingProfileOperationSpec, ); } /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is - * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. + * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip + * file. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in - * MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY - * format. + * @param parameters A list of download details for individual documents. * @param options The options parameters. */ - private _listByBillingProfile( + async beginDownloadDocumentsByBillingAccount( billingAccountName: string, - billingProfileName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingProfileOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate, - options - }, - listByBillingProfileOperationSpec + parameters: DocumentDownloadRequest[], + options?: InvoicesDownloadDocumentsByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + InvoicesDownloadDocumentsByBillingAccountResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, parameters, options }, + spec: downloadDocumentsByBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + InvoicesDownloadDocumentsByBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip + * file. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters A list of download details for individual documents. + * @param options The options parameters. + */ + async beginDownloadDocumentsByBillingAccountAndWait( + billingAccountName: string, + parameters: DocumentDownloadRequest[], + options?: InvoicesDownloadDocumentsByBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginDownloadDocumentsByBillingAccount( + billingAccountName, + parameters, + options, ); + return poller.pollUntilDone(); } /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Regenerate an invoice by billing account name and invoice name. The operation is supported for + * billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - get( + async beginAmend( billingAccountName: string, invoiceName: string, - options?: InvoicesGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, invoiceName, options }, - getOperationSpec - ); + options?: InvoicesAmendOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + InvoicesAmendResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, invoiceName, options }, + spec: amendOperationSpec, + }); + const poller = await createHttpPoller< + InvoicesAmendResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; } /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. + * Regenerate an invoice by billing account name and invoice name. The operation is supported for + * billing accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - getById( + async beginAmendAndWait( + billingAccountName: string, invoiceName: string, - options?: InvoicesGetByIdOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { invoiceName, options }, - getByIdOperationSpec + options?: InvoicesAmendOptionalParams, + ): Promise { + const poller = await this.beginAmend( + billingAccountName, + invoiceName, + options, ); + return poller.pollUntilDone(); } /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Gets a URL to download an invoice document. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. * @param options The options parameters. */ - async beginDownloadInvoice( + async beginDownloadByBillingAccount( billingAccountName: string, invoiceName: string, - downloadToken: string, - options?: InvoicesDownloadInvoiceOptionalParams + options?: InvoicesDownloadByBillingAccountOptionalParams, ): Promise< - PollerLike< - PollOperationState, - InvoicesDownloadInvoiceResponse + SimplePollerLike< + OperationState, + InvoicesDownloadByBillingAccountResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -477,8 +532,8 @@ export class InvoicesImpl implements Invoices { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -486,85 +541,81 @@ export class InvoicesImpl implements Invoices { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { billingAccountName, invoiceName, downloadToken, options }, - downloadInvoiceOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, invoiceName, options }, + spec: downloadByBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + InvoicesDownloadByBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Gets a URL to download an invoice document. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. * @param options The options parameters. */ - async beginDownloadInvoiceAndWait( + async beginDownloadByBillingAccountAndWait( billingAccountName: string, invoiceName: string, - downloadToken: string, - options?: InvoicesDownloadInvoiceOptionalParams - ): Promise { - const poller = await this.beginDownloadInvoice( + options?: InvoicesDownloadByBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginDownloadByBillingAccount( billingAccountName, invoiceName, - downloadToken, - options + options, ); return poller.pollUntilDone(); } /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip - * file. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. + * Gets a URL to download the summary document for an invoice. The operation is supported for billing + * accounts with agreement type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - async beginDownloadMultipleBillingProfileInvoices( + async beginDownloadSummaryByBillingAccount( billingAccountName: string, - downloadUrls: string[], - options?: InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams + invoiceName: string, + options?: InvoicesDownloadSummaryByBillingAccountOptionalParams, ): Promise< - PollerLike< - PollOperationState< - InvoicesDownloadMultipleBillingProfileInvoicesResponse - >, - InvoicesDownloadMultipleBillingProfileInvoicesResponse + SimplePollerLike< + OperationState, + InvoicesDownloadSummaryByBillingAccountResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -573,8 +624,8 @@ export class InvoicesImpl implements Invoices { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -582,111 +633,114 @@ export class InvoicesImpl implements Invoices { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { billingAccountName, downloadUrls, options }, - downloadMultipleBillingProfileInvoicesOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, invoiceName, options }, + spec: downloadSummaryByBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + InvoicesDownloadSummaryByBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip - * file. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. + * Gets a URL to download the summary document for an invoice. The operation is supported for billing + * accounts with agreement type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - async beginDownloadMultipleBillingProfileInvoicesAndWait( + async beginDownloadSummaryByBillingAccountAndWait( billingAccountName: string, - downloadUrls: string[], - options?: InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams - ): Promise { - const poller = await this.beginDownloadMultipleBillingProfileInvoices( + invoiceName: string, + options?: InvoicesDownloadSummaryByBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginDownloadSummaryByBillingAccount( billingAccountName, - downloadUrls, - options + invoiceName, + options, ); return poller.pollUntilDone(); } /** - * Lists the invoices for a subscription. - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. + * Gets an invoice by billing account name and ID. The operation is supported for all billing account + * types. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - private _listByBillingSubscription( - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingSubscriptionOptionalParams - ): Promise { + getByBillingAccount( + billingAccountName: string, + invoiceName: string, + options?: InvoicesGetByBillingAccountOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { periodStartDate, periodEndDate, options }, - listByBillingSubscriptionOperationSpec + { billingAccountName, invoiceName, options }, + getByBillingAccountOperationSpec, ); } /** - * Gets an invoice by subscription ID and invoice ID. - * @param invoiceName The ID that uniquely identifies an invoice. + * Lists the invoices for a billing account for a given start date and end date. The operation is + * supported for all billing account types. + * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ - getBySubscriptionAndInvoiceId( - invoiceName: string, - options?: InvoicesGetBySubscriptionAndInvoiceIdOptionalParams - ): Promise { + private _listByBillingAccount( + billingAccountName: string, + options?: InvoicesListByBillingAccountOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { invoiceName, options }, - getBySubscriptionAndInvoiceIdOperationSpec + { billingAccountName, options }, + listByBillingAccountOperationSpec, ); } /** - * Gets a URL to download an invoice. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. + * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip + * file. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. + * @param parameters A list of download details for individual documents. * @param options The options parameters. */ - async beginDownloadBillingSubscriptionInvoice( - invoiceName: string, - downloadToken: string, - options?: InvoicesDownloadBillingSubscriptionInvoiceOptionalParams + async beginDownloadDocumentsByBillingSubscription( + parameters: DocumentDownloadRequest[], + options?: InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams, ): Promise< - PollerLike< - PollOperationState, - InvoicesDownloadBillingSubscriptionInvoiceResponse + SimplePollerLike< + OperationState, + InvoicesDownloadDocumentsByBillingSubscriptionResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -695,8 +749,8 @@ export class InvoicesImpl implements Invoices { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -704,78 +758,77 @@ export class InvoicesImpl implements Invoices { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { invoiceName, downloadToken, options }, - downloadBillingSubscriptionInvoiceOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { parameters, options }, + spec: downloadDocumentsByBillingSubscriptionOperationSpec, + }); + const poller = await createHttpPoller< + InvoicesDownloadDocumentsByBillingSubscriptionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Gets a URL to download an invoice. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. + * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip + * file. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. + * @param parameters A list of download details for individual documents. * @param options The options parameters. */ - async beginDownloadBillingSubscriptionInvoiceAndWait( - invoiceName: string, - downloadToken: string, - options?: InvoicesDownloadBillingSubscriptionInvoiceOptionalParams - ): Promise { - const poller = await this.beginDownloadBillingSubscriptionInvoice( - invoiceName, - downloadToken, - options + async beginDownloadDocumentsByBillingSubscriptionAndWait( + parameters: DocumentDownloadRequest[], + options?: InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams, + ): Promise { + const poller = await this.beginDownloadDocumentsByBillingSubscription( + parameters, + options, ); return poller.pollUntilDone(); } /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip - * file. - * @param downloadUrls An array of download urls for individual documents + * Gets a URL to download an invoice by billing subscription. The operation is supported for billing + * accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - async beginDownloadMultipleBillingSubscriptionInvoices( - downloadUrls: string[], - options?: InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams + async beginDownloadByBillingSubscription( + invoiceName: string, + options?: InvoicesDownloadByBillingSubscriptionOptionalParams, ): Promise< - PollerLike< - PollOperationState< - InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse - >, - InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse + SimplePollerLike< + OperationState, + InvoicesDownloadByBillingSubscriptionResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -784,8 +837,8 @@ export class InvoicesImpl implements Invoices { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -793,62 +846,88 @@ export class InvoicesImpl implements Invoices { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { downloadUrls, options }, - downloadMultipleBillingSubscriptionInvoicesOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { invoiceName, options }, + spec: downloadByBillingSubscriptionOperationSpec, + }); + const poller = await createHttpPoller< + InvoicesDownloadByBillingSubscriptionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip - * file. - * @param downloadUrls An array of download urls for individual documents + * Gets a URL to download an invoice by billing subscription. The operation is supported for billing + * accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - async beginDownloadMultipleBillingSubscriptionInvoicesAndWait( - downloadUrls: string[], - options?: InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams - ): Promise { - const poller = await this.beginDownloadMultipleBillingSubscriptionInvoices( - downloadUrls, - options + async beginDownloadByBillingSubscriptionAndWait( + invoiceName: string, + options?: InvoicesDownloadByBillingSubscriptionOptionalParams, + ): Promise { + const poller = await this.beginDownloadByBillingSubscription( + invoiceName, + options, ); return poller.pollUntilDone(); } /** - * ListByBillingAccountNext - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in - * MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY - * format. - * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - private _listByBillingAccountNext( - billingAccountName: string, - periodStartDate: string, - periodEndDate: string, - nextLink: string, - options?: InvoicesListByBillingAccountNextOptionalParams - ): Promise { + getByBillingSubscription( + invoiceName: string, + options?: InvoicesGetByBillingSubscriptionOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, periodStartDate, periodEndDate, nextLink, options }, - listByBillingAccountNextOperationSpec + { invoiceName, options }, + getByBillingSubscriptionOperationSpec, + ); + } + + /** + * Lists the invoices for a subscription. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param options The options parameters. + */ + private _listByBillingSubscription( + options?: InvoicesListByBillingSubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listByBillingSubscriptionOperationSpec, + ); + } + + /** + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement or Microsoft Customer Agreement. + * @param invoiceName The ID that uniquely identifies an invoice. + * @param options The options parameters. + */ + get( + invoiceName: string, + options?: InvoicesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { invoiceName, options }, + getOperationSpec, ); } @@ -856,369 +935,422 @@ export class InvoicesImpl implements Invoices { * ListByBillingProfileNext * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in - * MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY - * format. * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. * @param options The options parameters. */ private _listByBillingProfileNext( billingAccountName: string, billingProfileName: string, - periodStartDate: string, - periodEndDate: string, nextLink: string, - options?: InvoicesListByBillingProfileNextOptionalParams + options?: InvoicesListByBillingProfileNextOptionalParams, ): Promise { return this.client.sendOperationRequest( - { - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate, - nextLink, - options - }, - listByBillingProfileNextOperationSpec + { billingAccountName, billingProfileName, nextLink, options }, + listByBillingProfileNextOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: InvoicesListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, ); } /** * ListByBillingSubscriptionNext - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. * @param nextLink The nextLink from the previous successful call to the ListByBillingSubscription * method. * @param options The options parameters. */ private _listByBillingSubscriptionNext( - periodStartDate: string, - periodEndDate: string, nextLink: string, - options?: InvoicesListByBillingSubscriptionNextOptionalParams + options?: InvoicesListByBillingSubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( - { periodStartDate, periodEndDate, nextLink, options }, - listByBillingSubscriptionNextOperationSpec + { nextLink, options }, + listByBillingSubscriptionNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.InvoiceListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.periodStartDate, - Parameters.periodEndDate - ], - urlParameters: [Parameters.$host, Parameters.billingAccountName], - headerParameters: [Parameters.accept], - serializer -}; const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.InvoiceListResult + bodyMapper: Mappers.InvoiceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [ Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, Parameters.periodStartDate, - Parameters.periodEndDate + Parameters.periodEndDate, ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}", - httpMethod: "GET", +const downloadDocumentsByBillingAccountOperationSpec: coreClient.OperationSpec = + { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + 201: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + 202: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + 204: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters17, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; +const amendOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/amend", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.Invoice + headersMapper: Mappers.InvoicesAmendHeaders, + }, + 201: { + headersMapper: Mappers.InvoicesAmendHeaders, + }, + 202: { + headersMapper: Mappers.InvoicesAmendHeaders, + }, + 204: { + headersMapper: Mappers.InvoicesAmendHeaders, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.invoiceName + Parameters.invoiceName, ], headerParameters: [Parameters.accept], - serializer -}; -const getByIdOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/default/invoices/{invoiceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Invoice - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.invoiceName], - headerParameters: [Parameters.accept], - serializer + serializer, }; -const downloadInvoiceOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download", +const downloadByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, 201: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, 202: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, 204: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.downloadToken], + queryParameters: [Parameters.apiVersion, Parameters.documentName], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.invoiceName + Parameters.invoiceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const downloadMultipleBillingProfileInvoicesOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments", +const downloadSummaryByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/downloadSummary", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, 201: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, 202: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, 204: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.downloadUrls, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.billingAccountName], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.invoiceName, + ], + headerParameters: [Parameters.accept], + serializer, }; -const listByBillingSubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices", +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.InvoiceListResult + bodyMapper: Mappers.Invoice, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.periodStartDate, - Parameters.periodEndDate + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.invoiceName, ], - urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getBySubscriptionAndInvoiceIdOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}", +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Invoice + bodyMapper: Mappers.InvoiceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.invoiceName + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.periodStartDate, + Parameters.periodEndDate, ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], headerParameters: [Parameters.accept], - serializer + serializer, }; -const downloadBillingSubscriptionInvoiceOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download", +const downloadDocumentsByBillingSubscriptionOperationSpec: coreClient.OperationSpec = + { + path: "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + 201: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + 202: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + 204: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters17, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; +const downloadByBillingSubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, 201: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, 202: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, 204: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.DocumentDownloadResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.downloadToken], + queryParameters: [Parameters.apiVersion, Parameters.documentName], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.invoiceName + Parameters.invoiceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const downloadMultipleBillingSubscriptionInvoicesOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments", - httpMethod: "POST", +const getByBillingSubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DownloadUrl - }, - 201: { - bodyMapper: Mappers.DownloadUrl - }, - 202: { - bodyMapper: Mappers.DownloadUrl - }, - 204: { - bodyMapper: Mappers.DownloadUrl + bodyMapper: Mappers.Invoice, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.downloadUrls, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.invoiceName, + ], + headerParameters: [Parameters.accept], + serializer, }; -const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", +const listByBillingSubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.InvoiceListResult + bodyMapper: Mappers.InvoiceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [ Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, Parameters.periodStartDate, - Parameters.periodEndDate + Parameters.periodEndDate, ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/default/invoices/{invoiceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Invoice, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.invoiceName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.InvoiceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.nextLink + Parameters.nextLink, + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.InvoiceListResult + bodyMapper: Mappers.InvoiceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.periodStartDate, - Parameters.periodEndDate - ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByBillingSubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.InvoiceListResult + bodyMapper: Mappers.InvoiceListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.periodStartDate, - Parameters.periodEndDate - ], urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/operations.ts b/sdk/billing/arm-billing/src/operations/operations.ts index 65ac1c045528..cb12cdd81806 100644 --- a/sdk/billing/arm-billing/src/operations/operations.ts +++ b/sdk/billing/arm-billing/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models"; /// @@ -35,11 +35,11 @@ export class OperationsImpl implements Operations { } /** - * Lists the available billing REST API operations. + * List of operations supported by provider. * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -89,11 +89,11 @@ export class OperationsImpl implements Operations { } /** - * Lists the available billing REST API operations. + * List of operations supported by provider. * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,30 +121,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/partnerTransfers.ts b/sdk/billing/arm-billing/src/operations/partnerTransfers.ts new file mode 100644 index 000000000000..2891aadb9e24 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/partnerTransfers.ts @@ -0,0 +1,388 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { PartnerTransfers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + PartnerTransferDetails, + PartnerTransfersListNextOptionalParams, + PartnerTransfersListOptionalParams, + PartnerTransfersListResponse, + PartnerTransfersGetOptionalParams, + PartnerTransfersGetResponse, + PartnerInitiateTransferRequest, + PartnerTransfersInitiateOptionalParams, + PartnerTransfersInitiateResponse, + PartnerTransfersCancelOptionalParams, + PartnerTransfersCancelResponse, + PartnerTransfersListNextResponse, +} from "../models"; + +/// +/** Class containing PartnerTransfers operations. */ +export class PartnerTransfersImpl implements PartnerTransfers { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class PartnerTransfers class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * Lists the transfer requests sent to a customer. The operation is supported only for billing accounts + * with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + public list( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: PartnerTransfersListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + billingAccountName, + billingProfileName, + customerName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + billingAccountName, + billingProfileName, + customerName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: PartnerTransfersListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PartnerTransfersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + billingAccountName, + billingProfileName, + customerName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + billingAccountName, + billingProfileName, + customerName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: PartnerTransfersListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + billingAccountName, + billingProfileName, + customerName, + options, + )) { + yield* page; + } + } + + /** + * Gets a transfer request by ID. The operation is supported only for billing accounts with agreement + * type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + get( + billingAccountName: string, + billingProfileName: string, + customerName: string, + transferName: string, + options?: PartnerTransfersGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + transferName, + options, + }, + getOperationSpec, + ); + } + + /** + * Sends a request to a user in a customer's billing account to transfer billing ownership of their + * subscriptions. The operation is supported only for billing accounts with agreement type Microsoft + * Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param transferName The ID that uniquely identifies a transfer request. + * @param parameters Request parameters that are provided to the initiate transfer operation. + * @param options The options parameters. + */ + initiate( + billingAccountName: string, + billingProfileName: string, + customerName: string, + transferName: string, + parameters: PartnerInitiateTransferRequest, + options?: PartnerTransfersInitiateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + transferName, + parameters, + options, + }, + initiateOperationSpec, + ); + } + + /** + * Cancels a transfer request. The operation is supported only for billing accounts with agreement type + * Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + cancel( + billingAccountName: string, + billingProfileName: string, + customerName: string, + transferName: string, + options?: PartnerTransfersCancelOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + transferName, + options, + }, + cancelOperationSpec, + ); + } + + /** + * Lists the transfer requests sent to a customer. The operation is supported only for billing accounts + * with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + private _list( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: PartnerTransfersListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, customerName, options }, + listOperationSpec, + ); + } + + /** + * ListNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + billingAccountName: string, + billingProfileName: string, + customerName: string, + nextLink: string, + options?: PartnerTransfersListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + nextLink, + options, + }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers/{transferName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PartnerTransferDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + Parameters.transferName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const initiateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers/{transferName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PartnerTransferDetails, + }, + 201: { + bodyMapper: Mappers.PartnerTransferDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters25, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + Parameters.transferName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const cancelOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers/{transferName}/cancel", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PartnerTransferDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + Parameters.transferName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transfers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PartnerTransferDetailsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PartnerTransferDetailsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/paymentMethods.ts b/sdk/billing/arm-billing/src/operations/paymentMethods.ts new file mode 100644 index 000000000000..9d5c88cda42e --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/paymentMethods.ts @@ -0,0 +1,613 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { PaymentMethods } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + PaymentMethodLink, + PaymentMethodsListByBillingProfileNextOptionalParams, + PaymentMethodsListByBillingProfileOptionalParams, + PaymentMethodsListByBillingProfileResponse, + PaymentMethod, + PaymentMethodsListByBillingAccountNextOptionalParams, + PaymentMethodsListByBillingAccountOptionalParams, + PaymentMethodsListByBillingAccountResponse, + PaymentMethodsListByUserNextOptionalParams, + PaymentMethodsListByUserOptionalParams, + PaymentMethodsListByUserResponse, + PaymentMethodsGetByBillingProfileOptionalParams, + PaymentMethodsGetByBillingProfileResponse, + PaymentMethodsGetByBillingAccountOptionalParams, + PaymentMethodsGetByBillingAccountResponse, + PaymentMethodsDeleteByUserOptionalParams, + PaymentMethodsGetByUserOptionalParams, + PaymentMethodsGetByUserResponse, + PaymentMethodsListByBillingProfileNextResponse, + PaymentMethodsListByBillingAccountNextResponse, + PaymentMethodsListByUserNextResponse, +} from "../models"; + +/// +/** Class containing PaymentMethods operations. */ +export class PaymentMethodsImpl implements PaymentMethods { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class PaymentMethods class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * Lists payment methods attached to a billing profile. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: PaymentMethodsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountName, + billingProfileName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountName: string, + billingProfileName: string, + options?: PaymentMethodsListByBillingProfileOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PaymentMethodsListByBillingProfileResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingProfile( + billingAccountName, + billingProfileName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountName, + billingProfileName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountName: string, + billingProfileName: string, + options?: PaymentMethodsListByBillingProfileOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + options, + )) { + yield* page; + } + } + + /** + * Lists the payment methods available for a billing account. Along with the payment methods owned by + * the caller, these payment methods can be attached to a billing profile to make payments. The + * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountName: string, + options?: PaymentMethodsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: PaymentMethodsListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PaymentMethodsListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: PaymentMethodsListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * Lists the payment methods owned by the caller. + * @param options The options parameters. + */ + public listByUser( + options?: PaymentMethodsListByUserOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByUserPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByUserPagingPage(options, settings); + }, + }; + } + + private async *listByUserPagingPage( + options?: PaymentMethodsListByUserOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: PaymentMethodsListByUserResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByUser(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByUserNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByUserPagingAll( + options?: PaymentMethodsListByUserOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByUserPagingPage(options)) { + yield* page; + } + } + + /** + * Lists payment methods attached to a billing profile. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: PaymentMethodsListByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, options }, + listByBillingProfileOperationSpec, + ); + } + + /** + * Gets a payment method linked with a billing profile. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param options The options parameters. + */ + getByBillingProfile( + billingAccountName: string, + billingProfileName: string, + paymentMethodName: string, + options?: PaymentMethodsGetByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, paymentMethodName, options }, + getByBillingProfileOperationSpec, + ); + } + + /** + * Lists the payment methods available for a billing account. Along with the payment methods owned by + * the caller, these payment methods can be attached to a billing profile to make payments. The + * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: PaymentMethodsListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * Gets a payment method available for a billing account. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + paymentMethodName: string, + options?: PaymentMethodsGetByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, paymentMethodName, options }, + getByBillingAccountOperationSpec, + ); + } + + /** + * Lists the payment methods owned by the caller. + * @param options The options parameters. + */ + private _listByUser( + options?: PaymentMethodsListByUserOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listByUserOperationSpec, + ); + } + + /** + * Deletes a payment method owned by the caller. + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param options The options parameters. + */ + deleteByUser( + paymentMethodName: string, + options?: PaymentMethodsDeleteByUserOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { paymentMethodName, options }, + deleteByUserOperationSpec, + ); + } + + /** + * Gets a payment method owned by the caller. + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param options The options parameters. + */ + getByUser( + paymentMethodName: string, + options?: PaymentMethodsGetByUserOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { paymentMethodName, options }, + getByUserOperationSpec, + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountName: string, + billingProfileName: string, + nextLink: string, + options?: PaymentMethodsListByBillingProfileNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, nextLink, options }, + listByBillingProfileNextOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: PaymentMethodsListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } + + /** + * ListByUserNext + * @param nextLink The nextLink from the previous successful call to the ListByUser method. + * @param options The options parameters. + */ + private _listByUserNext( + nextLink: string, + options?: PaymentMethodsListByUserNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listByUserNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethodLinks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PaymentMethodLinksListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.billingProfileName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethodLinks/{paymentMethodName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PaymentMethodLink, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.billingProfileName1, + Parameters.paymentMethodName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PaymentMethodsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName1], + headerParameters: [Parameters.accept], + serializer, +}; +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods/{paymentMethodName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PaymentMethod, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName1, + Parameters.paymentMethodName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByUserOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/paymentMethods", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PaymentMethodsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const deleteByUserOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/paymentMethods/{paymentMethodName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.paymentMethodName], + headerParameters: [Parameters.accept], + serializer, +}; +const getByUserOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/paymentMethods/{paymentMethodName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PaymentMethod, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.paymentMethodName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PaymentMethodLinksListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountName1, + Parameters.billingProfileName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PaymentMethodsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByUserNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PaymentMethodsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/policies.ts b/sdk/billing/arm-billing/src/operations/policies.ts index 53fa0875c152..d57e5c1c3511 100644 --- a/sdk/billing/arm-billing/src/operations/policies.ts +++ b/sdk/billing/arm-billing/src/operations/policies.ts @@ -12,16 +12,34 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; import { - PoliciesGetByBillingProfileOptionalParams, - PoliciesGetByBillingProfileResponse, - Policy, - PoliciesUpdateOptionalParams, - PoliciesUpdateResponse, + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + ServiceDefinedResourceName, PoliciesGetByCustomerOptionalParams, PoliciesGetByCustomerResponse, CustomerPolicy, - PoliciesUpdateCustomerOptionalParams, - PoliciesUpdateCustomerResponse + PoliciesCreateOrUpdateByCustomerOptionalParams, + PoliciesCreateOrUpdateByCustomerResponse, + PoliciesGetByBillingProfileOptionalParams, + PoliciesGetByBillingProfileResponse, + BillingProfilePolicy, + PoliciesCreateOrUpdateByBillingProfileOptionalParams, + PoliciesCreateOrUpdateByBillingProfileResponse, + PoliciesGetByCustomerAtBillingAccountOptionalParams, + PoliciesGetByCustomerAtBillingAccountResponse, + PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams, + PoliciesCreateOrUpdateByCustomerAtBillingAccountResponse, + PoliciesGetByBillingAccountOptionalParams, + PoliciesGetByBillingAccountResponse, + BillingAccountPolicy, + PoliciesCreateOrUpdateByBillingAccountOptionalParams, + PoliciesCreateOrUpdateByBillingAccountResponse, + PoliciesGetBySubscriptionOptionalParams, + PoliciesGetBySubscriptionResponse, } from "../models"; /** Class containing Policies operations. */ @@ -36,6 +54,142 @@ export class PoliciesImpl implements Policies { this.client = client; } + /** + * Lists the policies for a customer. This operation is supported only for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param policyName Service-defined resource names such as 'default' which are reserved resource + * names. + * @param options The options parameters. + */ + getByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + policyName: ServiceDefinedResourceName, + options?: PoliciesGetByCustomerOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + policyName, + options, + }, + getByCustomerOperationSpec, + ); + } + + /** + * Updates the policies for a customer. This operation is supported only for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters A policy at customer scope. + * @param options The options parameters. + */ + async beginCreateOrUpdateByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + parameters: CustomerPolicy, + options?: PoliciesCreateOrUpdateByCustomerOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PoliciesCreateOrUpdateByCustomerResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + billingProfileName, + customerName, + parameters, + options, + }, + spec: createOrUpdateByCustomerOperationSpec, + }); + const poller = await createHttpPoller< + PoliciesCreateOrUpdateByCustomerResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Updates the policies for a customer. This operation is supported only for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters A policy at customer scope. + * @param options The options parameters. + */ + async beginCreateOrUpdateByCustomerAndWait( + billingAccountName: string, + billingProfileName: string, + customerName: string, + parameters: CustomerPolicy, + options?: PoliciesCreateOrUpdateByCustomerOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdateByCustomer( + billingAccountName, + billingProfileName, + customerName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + /** * Lists the policies for a billing profile. This operation is supported only for billing accounts with * agreement type Microsoft Customer Agreement. @@ -46,11 +200,11 @@ export class PoliciesImpl implements Policies { getByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: PoliciesGetByBillingProfileOptionalParams + options?: PoliciesGetByBillingProfileOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, options }, - getByBillingProfileOperationSpec + getByBillingProfileOperationSpec, ); } @@ -59,147 +213,546 @@ export class PoliciesImpl implements Policies { * with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. + * @param parameters A policy at billing profile scope. * @param options The options parameters. */ - update( + async beginCreateOrUpdateByBillingProfile( billingAccountName: string, billingProfileName: string, - parameters: Policy, - options?: PoliciesUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, parameters, options }, - updateOperationSpec + parameters: BillingProfilePolicy, + options?: PoliciesCreateOrUpdateByBillingProfileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PoliciesCreateOrUpdateByBillingProfileResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, billingProfileName, parameters, options }, + spec: createOrUpdateByBillingProfileOperationSpec, + }); + const poller = await createHttpPoller< + PoliciesCreateOrUpdateByBillingProfileResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Updates the policies for a billing profile. This operation is supported only for billing accounts + * with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param parameters A policy at billing profile scope. + * @param options The options parameters. + */ + async beginCreateOrUpdateByBillingProfileAndWait( + billingAccountName: string, + billingProfileName: string, + parameters: BillingProfilePolicy, + options?: PoliciesCreateOrUpdateByBillingProfileOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdateByBillingProfile( + billingAccountName, + billingProfileName, + parameters, + options, ); + return poller.pollUntilDone(); } /** - * Lists the policies for a customer. This operation is supported only for billing accounts with - * agreement type Microsoft Partner Agreement. + * Lists the policies for a customer at billing account scope. This operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - getByCustomer( + getByCustomerAtBillingAccount( billingAccountName: string, customerName: string, - options?: PoliciesGetByCustomerOptionalParams - ): Promise { + options?: PoliciesGetByCustomerAtBillingAccountOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, customerName, options }, - getByCustomerOperationSpec + getByCustomerAtBillingAccountOperationSpec, ); } /** - * Updates the policies for a customer. This operation is supported only for billing accounts with - * agreement type Microsoft Partner Agreement. + * Updates the policies for a customer at billing account scope. This operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters A policy at customer scope. + * @param options The options parameters. + */ + async beginCreateOrUpdateByCustomerAtBillingAccount( + billingAccountName: string, + customerName: string, + parameters: CustomerPolicy, + options?: PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PoliciesCreateOrUpdateByCustomerAtBillingAccountResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, customerName, parameters, options }, + spec: createOrUpdateByCustomerAtBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + PoliciesCreateOrUpdateByCustomerAtBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Updates the policies for a customer at billing account scope. This operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. + * @param parameters A policy at customer scope. * @param options The options parameters. */ - updateCustomer( + async beginCreateOrUpdateByCustomerAtBillingAccountAndWait( billingAccountName: string, customerName: string, parameters: CustomerPolicy, - options?: PoliciesUpdateCustomerOptionalParams - ): Promise { + options?: PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdateByCustomerAtBillingAccount( + billingAccountName, + customerName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Get the policies for a billing account of Enterprise Agreement type. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + options?: PoliciesGetByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + getByBillingAccountOperationSpec, + ); + } + + /** + * Update the policies for a billing account of Enterprise Agreement type. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters A policy at billing account scope. + * @param options The options parameters. + */ + async beginCreateOrUpdateByBillingAccount( + billingAccountName: string, + parameters: BillingAccountPolicy, + options?: PoliciesCreateOrUpdateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PoliciesCreateOrUpdateByBillingAccountResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, parameters, options }, + spec: createOrUpdateByBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + PoliciesCreateOrUpdateByBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Update the policies for a billing account of Enterprise Agreement type. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters A policy at billing account scope. + * @param options The options parameters. + */ + async beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName: string, + parameters: BillingAccountPolicy, + options?: PoliciesCreateOrUpdateByBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdateByBillingAccount( + billingAccountName, + parameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is + * supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner + * Agreement. + * @param options The options parameters. + */ + getBySubscription( + options?: PoliciesGetBySubscriptionOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, customerName, parameters, options }, - updateCustomerOperationSpec + { options }, + getBySubscriptionOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const getByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default", +const getByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/policies/{policyName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Policy + bodyMapper: Mappers.CustomerPolicy, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, + Parameters.customerName, + Parameters.policyName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default", +const createOrUpdateByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/policies/default", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Policy + bodyMapper: Mappers.CustomerPolicy, + }, + 201: { + bodyMapper: Mappers.CustomerPolicy, + }, + 202: { + bodyMapper: Mappers.CustomerPolicy, + }, + 204: { + bodyMapper: Mappers.CustomerPolicy, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters8, + requestBody: Parameters.parameters19, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, + Parameters.customerName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const getByCustomerOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default", +const getByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomerPolicy + bodyMapper: Mappers.BillingProfilePolicy, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.customerName + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const updateCustomerOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default", +const createOrUpdateByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.CustomerPolicy + bodyMapper: Mappers.BillingProfilePolicy, + }, + 201: { + bodyMapper: Mappers.BillingProfilePolicy, + }, + 202: { + bodyMapper: Mappers.BillingProfilePolicy, + }, + 204: { + bodyMapper: Mappers.BillingProfilePolicy, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters20, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const getByCustomerAtBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CustomerPolicy, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters9, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.customerName + Parameters.customerName, ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateByCustomerAtBillingAccountOperationSpec: coreClient.OperationSpec = + { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CustomerPolicy, + }, + 201: { + bodyMapper: Mappers.CustomerPolicy, + }, + 202: { + bodyMapper: Mappers.CustomerPolicy, + }, + 204: { + bodyMapper: Mappers.CustomerPolicy, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters19, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/policies/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BillingAccountPolicy, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/policies/default", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.BillingAccountPolicy, + }, + 201: { + bodyMapper: Mappers.BillingAccountPolicy, + }, + 202: { + bodyMapper: Mappers.BillingAccountPolicy, + }, + 204: { + bodyMapper: Mappers.BillingAccountPolicy, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters21, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.billingAccountName], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, +}; +const getBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/policies/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SubscriptionPolicy, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/products.ts b/sdk/billing/arm-billing/src/operations/products.ts index c53166ad8f51..bb82f9eeb3bc 100644 --- a/sdk/billing/arm-billing/src/operations/products.ts +++ b/sdk/billing/arm-billing/src/operations/products.ts @@ -13,33 +13,40 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Product, + ProductsListByInvoiceSectionNextOptionalParams, + ProductsListByInvoiceSectionOptionalParams, + ProductsListByInvoiceSectionResponse, + ProductsListByBillingProfileNextOptionalParams, + ProductsListByBillingProfileOptionalParams, + ProductsListByBillingProfileResponse, ProductsListByCustomerNextOptionalParams, ProductsListByCustomerOptionalParams, ProductsListByCustomerResponse, ProductsListByBillingAccountNextOptionalParams, ProductsListByBillingAccountOptionalParams, ProductsListByBillingAccountResponse, - ProductsListByBillingProfileNextOptionalParams, - ProductsListByBillingProfileOptionalParams, - ProductsListByBillingProfileResponse, - ProductsListByInvoiceSectionNextOptionalParams, - ProductsListByInvoiceSectionOptionalParams, - ProductsListByInvoiceSectionResponse, + MoveProductRequest, + ProductsMoveOptionalParams, + ProductsMoveResponse, + ProductsValidateMoveEligibilityOptionalParams, + ProductsValidateMoveEligibilityResponse, ProductsGetOptionalParams, ProductsGetResponse, + ProductPatch, ProductsUpdateOptionalParams, ProductsUpdateResponse, - TransferProductRequestProperties, - ProductsMoveOptionalParams, - ProductsMoveResponse, - ProductsValidateMoveOptionalParams, - ProductsValidateMoveResponse, + ProductsListByInvoiceSectionNextResponse, + ProductsListByBillingProfileNextResponse, ProductsListByCustomerNextResponse, ProductsListByBillingAccountNextResponse, - ProductsListByBillingProfileNextResponse, - ProductsListByInvoiceSectionNextResponse } from "../models"; /// @@ -56,21 +63,24 @@ export class ProductsImpl implements Products { } /** - * Lists the products for a customer. These don't include products billed based on usage.The operation - * is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * Lists the products for an invoice section. These don't include products billed based on usage. The + * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - public listByCustomer( + public listByInvoiceSection( billingAccountName: string, - customerName: string, - options?: ProductsListByCustomerOptionalParams + billingProfileName: string, + invoiceSectionName: string, + options?: ProductsListByInvoiceSectionOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByCustomerPagingAll( + const iter = this.listByInvoiceSectionPagingAll( billingAccountName, - customerName, - options + billingProfileName, + invoiceSectionName, + options, ); return { next() { @@ -83,29 +93,32 @@ export class ProductsImpl implements Products { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByCustomerPagingPage( + return this.listByInvoiceSectionPagingPage( billingAccountName, - customerName, + billingProfileName, + invoiceSectionName, options, - settings + settings, ); - } + }, }; } - private async *listByCustomerPagingPage( + private async *listByInvoiceSectionPagingPage( billingAccountName: string, - customerName: string, - options?: ProductsListByCustomerOptionalParams, - settings?: PageSettings + billingProfileName: string, + invoiceSectionName: string, + options?: ProductsListByInvoiceSectionOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: ProductsListByCustomerResponse; + let result: ProductsListByInvoiceSectionResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByCustomer( + result = await this._listByInvoiceSection( billingAccountName, - customerName, - options + billingProfileName, + invoiceSectionName, + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -113,11 +126,12 @@ export class ProductsImpl implements Products { yield page; } while (continuationToken) { - result = await this._listByCustomerNext( + result = await this._listByInvoiceSectionNext( billingAccountName, - customerName, + billingProfileName, + invoiceSectionName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -126,34 +140,39 @@ export class ProductsImpl implements Products { } } - private async *listByCustomerPagingAll( + private async *listByInvoiceSectionPagingAll( billingAccountName: string, - customerName: string, - options?: ProductsListByCustomerOptionalParams + billingProfileName: string, + invoiceSectionName: string, + options?: ProductsListByInvoiceSectionOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByCustomerPagingPage( + for await (const page of this.listByInvoiceSectionPagingPage( billingAccountName, - customerName, - options + billingProfileName, + invoiceSectionName, + options, )) { yield* page; } } /** - * Lists the products for a billing account. These don't include products billed based on usage. The + * Lists the products for a billing profile. These don't include products billed based on usage. The * operation is supported for billing accounts with agreement type Microsoft Customer Agreement or * Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - public listByBillingAccount( + public listByBillingProfile( billingAccountName: string, - options?: ProductsListByBillingAccountOptionalParams + billingProfileName: string, + options?: ProductsListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByBillingAccountPagingAll( + const iter = this.listByBillingProfilePagingAll( billingAccountName, - options + billingProfileName, + options, ); return { next() { @@ -166,34 +185,41 @@ export class ProductsImpl implements Products { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingAccountPagingPage( + return this.listByBillingProfilePagingPage( billingAccountName, + billingProfileName, options, - settings + settings, ); - } + }, }; } - private async *listByBillingAccountPagingPage( + private async *listByBillingProfilePagingPage( billingAccountName: string, - options?: ProductsListByBillingAccountOptionalParams, - settings?: PageSettings + billingProfileName: string, + options?: ProductsListByBillingProfileOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: ProductsListByBillingAccountResponse; + let result: ProductsListByBillingProfileResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingAccount(billingAccountName, options); + result = await this._listByBillingProfile( + billingAccountName, + billingProfileName, + options, + ); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listByBillingAccountNext( + result = await this._listByBillingProfileNext( billingAccountName, + billingProfileName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -202,35 +228,36 @@ export class ProductsImpl implements Products { } } - private async *listByBillingAccountPagingAll( + private async *listByBillingProfilePagingAll( billingAccountName: string, - options?: ProductsListByBillingAccountOptionalParams + billingProfileName: string, + options?: ProductsListByBillingProfileOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByBillingAccountPagingPage( + for await (const page of this.listByBillingProfilePagingPage( billingAccountName, - options + billingProfileName, + options, )) { yield* page; } } /** - * Lists the products for a billing profile. These don't include products billed based on usage. The - * operation is supported for billing accounts with agreement type Microsoft Customer Agreement or - * Microsoft Partner Agreement. + * Lists the products for a customer. These don't include products billed based on usage.The operation + * is supported only for billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - public listByBillingProfile( + public listByCustomer( billingAccountName: string, - billingProfileName: string, - options?: ProductsListByBillingProfileOptionalParams + customerName: string, + options?: ProductsListByCustomerOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByBillingProfilePagingAll( + const iter = this.listByCustomerPagingAll( billingAccountName, - billingProfileName, - options + customerName, + options, ); return { next() { @@ -243,29 +270,29 @@ export class ProductsImpl implements Products { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByBillingProfilePagingPage( + return this.listByCustomerPagingPage( billingAccountName, - billingProfileName, + customerName, options, - settings + settings, ); - } + }, }; } - private async *listByBillingProfilePagingPage( + private async *listByCustomerPagingPage( billingAccountName: string, - billingProfileName: string, - options?: ProductsListByBillingProfileOptionalParams, - settings?: PageSettings + customerName: string, + options?: ProductsListByCustomerOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: ProductsListByBillingProfileResponse; + let result: ProductsListByCustomerResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByBillingProfile( + result = await this._listByCustomer( billingAccountName, - billingProfileName, - options + customerName, + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -273,11 +300,11 @@ export class ProductsImpl implements Products { yield page; } while (continuationToken) { - result = await this._listByBillingProfileNext( + result = await this._listByCustomerNext( billingAccountName, - billingProfileName, + customerName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -286,39 +313,34 @@ export class ProductsImpl implements Products { } } - private async *listByBillingProfilePagingAll( + private async *listByCustomerPagingAll( billingAccountName: string, - billingProfileName: string, - options?: ProductsListByBillingProfileOptionalParams + customerName: string, + options?: ProductsListByCustomerOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByBillingProfilePagingPage( + for await (const page of this.listByCustomerPagingPage( billingAccountName, - billingProfileName, - options + customerName, + options, )) { yield* page; } } /** - * Lists the products for an invoice section. These don't include products billed based on usage. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Lists the products for a billing account. These don't include products billed based on usage. The + * operation is supported for billing accounts with agreement type Microsoft Customer Agreement or + * Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - public listByInvoiceSection( + public listByBillingAccount( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: ProductsListByInvoiceSectionOptionalParams + options?: ProductsListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator { - const iter = this.listByInvoiceSectionPagingAll( + const iter = this.listByBillingAccountPagingAll( billingAccountName, - billingProfileName, - invoiceSectionName, - options + options, ); return { next() { @@ -331,45 +353,34 @@ export class ProductsImpl implements Products { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listByInvoiceSectionPagingPage( + return this.listByBillingAccountPagingPage( billingAccountName, - billingProfileName, - invoiceSectionName, options, - settings + settings, ); - } + }, }; } - private async *listByInvoiceSectionPagingPage( + private async *listByBillingAccountPagingPage( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: ProductsListByInvoiceSectionOptionalParams, - settings?: PageSettings + options?: ProductsListByBillingAccountOptionalParams, + settings?: PageSettings, ): AsyncIterableIterator { - let result: ProductsListByInvoiceSectionResponse; + let result: ProductsListByBillingAccountResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._listByInvoiceSection( - billingAccountName, - billingProfileName, - invoiceSectionName, - options - ); + result = await this._listByBillingAccount(billingAccountName, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listByInvoiceSectionNext( + result = await this._listByBillingAccountNext( billingAccountName, - billingProfileName, - invoiceSectionName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -378,210 +389,273 @@ export class ProductsImpl implements Products { } } - private async *listByInvoiceSectionPagingAll( + private async *listByBillingAccountPagingAll( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: ProductsListByInvoiceSectionOptionalParams + options?: ProductsListByBillingAccountOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listByInvoiceSectionPagingPage( + for await (const page of this.listByBillingAccountPagingPage( billingAccountName, - billingProfileName, - invoiceSectionName, - options + options, )) { yield* page; } } /** - * Lists the products for a customer. These don't include products billed based on usage.The operation - * is supported only for billing accounts with agreement type Microsoft Partner Agreement. + * Lists the products for an invoice section. These don't include products billed based on usage. The + * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - private _listByCustomer( + private _listByInvoiceSection( billingAccountName: string, - customerName: string, - options?: ProductsListByCustomerOptionalParams - ): Promise { + billingProfileName: string, + invoiceSectionName: string, + options?: ProductsListByInvoiceSectionOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, customerName, options }, - listByCustomerOperationSpec + { billingAccountName, billingProfileName, invoiceSectionName, options }, + listByInvoiceSectionOperationSpec, ); } /** - * Lists the products for a billing account. These don't include products billed based on usage. The + * Lists the products for a billing profile. These don't include products billed based on usage. The * operation is supported for billing accounts with agreement type Microsoft Customer Agreement or * Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - private _listByBillingAccount( + private _listByBillingProfile( billingAccountName: string, - options?: ProductsListByBillingAccountOptionalParams - ): Promise { + billingProfileName: string, + options?: ProductsListByBillingProfileOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, options }, - listByBillingAccountOperationSpec + { billingAccountName, billingProfileName, options }, + listByBillingProfileOperationSpec, ); } /** - * Lists the products for a billing profile. These don't include products billed based on usage. The - * operation is supported for billing accounts with agreement type Microsoft Customer Agreement or - * Microsoft Partner Agreement. + * Lists the products for a customer. These don't include products billed based on usage.The operation + * is supported only for billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - private _listByBillingProfile( + private _listByCustomer( billingAccountName: string, - billingProfileName: string, - options?: ProductsListByBillingProfileOptionalParams - ): Promise { + customerName: string, + options?: ProductsListByCustomerOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, options }, - listByBillingProfileOperationSpec + { billingAccountName, customerName, options }, + listByCustomerOperationSpec, ); } /** - * Lists the products for an invoice section. These don't include products billed based on usage. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Moves a product's charges to a new invoice section. The new invoice section must belong to the same + * billing profile as the existing invoice section. This operation is supported only for products that + * are purchased with a recurring charge and for billing accounts with agreement type Microsoft + * Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param productName The ID that uniquely identifies a product. + * @param parameters The properties of the product to initiate a transfer. * @param options The options parameters. */ - private _listByInvoiceSection( + async beginMove( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: ProductsListByInvoiceSectionOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, billingProfileName, invoiceSectionName, options }, - listByInvoiceSectionOperationSpec - ); + productName: string, + parameters: MoveProductRequest, + options?: ProductsMoveOptionalParams, + ): Promise< + SimplePollerLike, ProductsMoveResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, productName, parameters, options }, + spec: moveOperationSpec, + }); + const poller = await createHttpPoller< + ProductsMoveResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; } /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. + * Moves a product's charges to a new invoice section. The new invoice section must belong to the same + * billing profile as the existing invoice section. This operation is supported only for products that + * are purchased with a recurring charge and for billing accounts with agreement type Microsoft + * Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param productName The ID that uniquely identifies a product. + * @param parameters The properties of the product to initiate a transfer. * @param options The options parameters. */ - get( + async beginMoveAndWait( billingAccountName: string, productName: string, - options?: ProductsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { billingAccountName, productName, options }, - getOperationSpec + parameters: MoveProductRequest, + options?: ProductsMoveOptionalParams, + ): Promise { + const poller = await this.beginMove( + billingAccountName, + productName, + parameters, + options, ); + return poller.pollUntilDone(); } /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Validates if a product's charges can be moved to a new invoice section. This operation is supported + * only for products that are purchased with a recurring charge and for billing accounts with agreement + * type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. + * @param parameters The properties of the product to initiate a transfer. * @param options The options parameters. */ - update( + validateMoveEligibility( billingAccountName: string, productName: string, - parameters: Product, - options?: ProductsUpdateOptionalParams - ): Promise { + parameters: MoveProductRequest, + options?: ProductsValidateMoveEligibilityOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, productName, parameters, options }, - updateOperationSpec + validateMoveEligibilityOperationSpec, ); } /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same - * billing profile as the existing invoice section. This operation is supported only for products that - * are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. + * Gets a product by ID. The operation is supported only for billing accounts with agreement type + * Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. * @param options The options parameters. */ - move( + get( billingAccountName: string, productName: string, - parameters: TransferProductRequestProperties, - options?: ProductsMoveOptionalParams - ): Promise { + options?: ProductsGetOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, productName, parameters, options }, - moveOperationSpec + { billingAccountName, productName, options }, + getOperationSpec, ); } /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported - * only for products that are purchased with a recurring charge and for billing accounts with agreement - * type Microsoft Customer Agreement. + * Updates the properties of a Product. Currently, auto renew can be updated. The operation is + * supported only for billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. + * @param parameters A product. * @param options The options parameters. */ - validateMove( + update( billingAccountName: string, productName: string, - parameters: TransferProductRequestProperties, - options?: ProductsValidateMoveOptionalParams - ): Promise { + parameters: ProductPatch, + options?: ProductsUpdateOptionalParams, + ): Promise { return this.client.sendOperationRequest( { billingAccountName, productName, parameters, options }, - validateMoveOperationSpec + updateOperationSpec, ); } /** - * ListByCustomerNext + * Lists the products for a billing account. These don't include products billed based on usage. The + * operation is supported for billing accounts with agreement type Microsoft Customer Agreement or + * Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. * @param options The options parameters. */ - private _listByCustomerNext( + private _listByBillingAccount( billingAccountName: string, - customerName: string, - nextLink: string, - options?: ProductsListByCustomerNextOptionalParams - ): Promise { + options?: ProductsListByBillingAccountOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, customerName, nextLink, options }, - listByCustomerNextOperationSpec + { billingAccountName, options }, + listByBillingAccountOperationSpec, ); } /** - * ListByBillingAccountNext + * ListByInvoiceSectionNext * @param billingAccountName The ID that uniquely identifies a billing account. - * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. * @param options The options parameters. */ - private _listByBillingAccountNext( + private _listByInvoiceSectionNext( billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, nextLink: string, - options?: ProductsListByBillingAccountNextOptionalParams - ): Promise { + options?: ProductsListByInvoiceSectionNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { billingAccountName, nextLink, options }, - listByBillingAccountNextOperationSpec + { + billingAccountName, + billingProfileName, + invoiceSectionName, + nextLink, + options, + }, + listByInvoiceSectionNextOperationSpec, ); } @@ -596,299 +670,334 @@ export class ProductsImpl implements Products { billingAccountName: string, billingProfileName: string, nextLink: string, - options?: ProductsListByBillingProfileNextOptionalParams + options?: ProductsListByBillingProfileNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, nextLink, options }, - listByBillingProfileNextOperationSpec + listByBillingProfileNextOperationSpec, ); } /** - * ListByInvoiceSectionNext + * ListByCustomerNext * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. + * @param customerName The ID that uniquely identifies a customer. + * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. * @param options The options parameters. */ - private _listByInvoiceSectionNext( + private _listByCustomerNext( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, + customerName: string, nextLink: string, - options?: ProductsListByInvoiceSectionNextOptionalParams - ): Promise { + options?: ProductsListByCustomerNextOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { - billingAccountName, - billingProfileName, - invoiceSectionName, - nextLink, - options - }, - listByInvoiceSectionNextOperationSpec + { billingAccountName, customerName, nextLink, options }, + listByCustomerNextOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: ProductsListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listByCustomerOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products", +const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProductsListResult + bodyMapper: Mappers.ProductListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.customerName + Parameters.billingProfileName, + Parameters.invoiceSectionName, ], headerParameters: [Parameters.accept], - serializer -}; -const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ProductsListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [Parameters.$host, Parameters.billingAccountName], - headerParameters: [Parameters.accept], - serializer + serializer, }; const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/products", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/products", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProductsListResult + bodyMapper: Mappers.ProductListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products", +const listByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProductsListResult + bodyMapper: Mappers.ProductListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName, - Parameters.invoiceSectionName + Parameters.customerName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}", - httpMethod: "GET", +const moveOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/move", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.Product + bodyMapper: Mappers.Product, + }, + 201: { + bodyMapper: Mappers.Product, + }, + 202: { + bodyMapper: Mappers.Product, + }, + 204: { + bodyMapper: Mappers.Product, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, + requestBody: Parameters.parameters22, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.productName + Parameters.productName, ], - headerParameters: [Parameters.accept], - serializer + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}", - httpMethod: "PATCH", +const validateMoveEligibilityOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/validateMoveEligibility", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.Product + bodyMapper: Mappers.MoveProductEligibilityResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters6, + requestBody: Parameters.parameters22, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.productName + Parameters.productName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const moveOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/move", - httpMethod: "POST", +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Product - }, - 202: { - headersMapper: Mappers.ProductsMoveHeaders + bodyMapper: Mappers.Product, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters7, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.productName + Parameters.productName, ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer + headerParameters: [Parameters.accept], + serializer, }; -const validateMoveOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/validateMoveEligibility", - httpMethod: "POST", +const updateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ValidateProductTransferEligibilityResult + bodyMapper: Mappers.Product, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - requestBody: Parameters.parameters7, + requestBody: Parameters.parameters23, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.productName + Parameters.productName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; -const listByCustomerNextOperationSpec: coreClient.OperationSpec = { +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProductListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProductsListResult + bodyMapper: Mappers.ProductListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.customerName + Parameters.billingProfileName, + Parameters.invoiceSectionName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProductsListResult + bodyMapper: Mappers.ProductListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.nextLink + Parameters.nextLink, + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { +const listByCustomerNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProductsListResult + bodyMapper: Mappers.ProductListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName + Parameters.customerName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; -const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ProductsListResult + bodyMapper: Mappers.ProductListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName, - Parameters.invoiceSectionName ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/recipientTransfers.ts b/sdk/billing/arm-billing/src/operations/recipientTransfers.ts new file mode 100644 index 000000000000..1686987b3be9 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/recipientTransfers.ts @@ -0,0 +1,291 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { RecipientTransfers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + RecipientTransferDetails, + RecipientTransfersListNextOptionalParams, + RecipientTransfersListOptionalParams, + RecipientTransfersListResponse, + AcceptTransferRequest, + RecipientTransfersAcceptOptionalParams, + RecipientTransfersAcceptResponse, + RecipientTransfersValidateOptionalParams, + RecipientTransfersValidateResponse, + RecipientTransfersDeclineOptionalParams, + RecipientTransfersDeclineResponse, + RecipientTransfersGetOptionalParams, + RecipientTransfersGetResponse, + RecipientTransfersListNextResponse, +} from "../models"; + +/// +/** Class containing RecipientTransfers operations. */ +export class RecipientTransfersImpl implements RecipientTransfers { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class RecipientTransfers class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * Lists the transfer requests received by the caller. + * @param options The options parameters. + */ + public list( + options?: RecipientTransfersListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: RecipientTransfersListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: RecipientTransfersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: RecipientTransfersListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Accepts a transfer request. + * @param transferName The ID that uniquely identifies a transfer request. + * @param parameters Request parameters that are provided to the accept transfer operation. + * @param options The options parameters. + */ + accept( + transferName: string, + parameters: AcceptTransferRequest, + options?: RecipientTransfersAcceptOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { transferName, parameters, options }, + acceptOperationSpec, + ); + } + + /** + * Validates if a subscription or a reservation can be transferred. Use this operation to validate your + * subscriptions or reservation before using the accept transfer operation. + * @param transferName The ID that uniquely identifies a transfer request. + * @param parameters Request parameters that are provided to the validate transfer operation. + * @param options The options parameters. + */ + validate( + transferName: string, + parameters: AcceptTransferRequest, + options?: RecipientTransfersValidateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { transferName, parameters, options }, + validateOperationSpec, + ); + } + + /** + * Declines a transfer request. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + decline( + transferName: string, + options?: RecipientTransfersDeclineOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { transferName, options }, + declineOperationSpec, + ); + } + + /** + * Gets a transfer request by ID. The caller must be the recipient of the transfer request. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + get( + transferName: string, + options?: RecipientTransfersGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { transferName, options }, + getOperationSpec, + ); + } + + /** + * Lists the transfer requests received by the caller. + * @param options The options parameters. + */ + private _list( + options?: RecipientTransfersListOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: RecipientTransfersListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const acceptOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/transfers/{transferName}/accept", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.RecipientTransferDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters26, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.transferName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const validateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/transfers/{transferName}/validate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ValidateTransferListResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters26, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.transferName], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const declineOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/transfers/{transferName}/decline", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.RecipientTransferDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.transferName], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/transfers/{transferName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RecipientTransferDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.transferName], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/transfers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RecipientTransferDetailsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RecipientTransferDetailsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/reservationOrders.ts b/sdk/billing/arm-billing/src/operations/reservationOrders.ts new file mode 100644 index 000000000000..7d7ebdd0b4d5 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/reservationOrders.ts @@ -0,0 +1,222 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { ReservationOrders } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + ReservationOrder, + ReservationOrdersListByBillingAccountNextOptionalParams, + ReservationOrdersListByBillingAccountOptionalParams, + ReservationOrdersListByBillingAccountResponse, + ReservationOrdersGetByBillingAccountOptionalParams, + ReservationOrdersGetByBillingAccountResponse, + ReservationOrdersListByBillingAccountNextResponse, +} from "../models"; + +/// +/** Class containing ReservationOrders operations. */ +export class ReservationOrdersImpl implements ReservationOrders { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class ReservationOrders class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * List all the `ReservationOrders in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountName: string, + options?: ReservationOrdersListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: ReservationOrdersListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ReservationOrdersListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: ReservationOrdersListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * Get the details of the ReservationOrder in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + reservationOrderId: string, + options?: ReservationOrdersGetByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, reservationOrderId, options }, + getByBillingAccountOperationSpec, + ); + } + + /** + * List all the `ReservationOrders in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: ReservationOrdersListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: ReservationOrdersListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservationOrders/{reservationOrderId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationOrder, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.reservationOrderId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservationOrders", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationOrderList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.skiptoken, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationOrderList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/reservations.ts b/sdk/billing/arm-billing/src/operations/reservations.ts index 6620ead12a0f..a71bead5130f 100644 --- a/sdk/billing/arm-billing/src/operations/reservations.ts +++ b/sdk/billing/arm-billing/src/operations/reservations.ts @@ -13,6 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Reservation, ReservationsListByBillingAccountNextOptionalParams, @@ -21,8 +27,17 @@ import { ReservationsListByBillingProfileNextOptionalParams, ReservationsListByBillingProfileOptionalParams, ReservationsListByBillingProfileResponse, + ReservationsListByReservationOrderNextOptionalParams, + ReservationsListByReservationOrderOptionalParams, + ReservationsListByReservationOrderResponse, + ReservationsGetByReservationOrderOptionalParams, + ReservationsGetByReservationOrderResponse, + Patch, + ReservationsUpdateByBillingAccountOptionalParams, + ReservationsUpdateByBillingAccountResponse, ReservationsListByBillingAccountNextResponse, - ReservationsListByBillingProfileNextResponse + ReservationsListByBillingProfileNextResponse, + ReservationsListByReservationOrderNextResponse, } from "../models"; /// @@ -39,18 +54,18 @@ export class ReservationsImpl implements Reservations { } /** - * Lists the reservations for a billing account and the roll up counts of reservations group by + * Lists the reservations in the billing account and the roll up counts of reservations group by * provisioning states. * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ public listByBillingAccount( billingAccountName: string, - options?: ReservationsListByBillingAccountOptionalParams + options?: ReservationsListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByBillingAccountPagingAll( billingAccountName, - options + options, ); return { next() { @@ -66,16 +81,16 @@ export class ReservationsImpl implements Reservations { return this.listByBillingAccountPagingPage( billingAccountName, options, - settings + settings, ); - } + }, }; } private async *listByBillingAccountPagingPage( billingAccountName: string, options?: ReservationsListByBillingAccountOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ReservationsListByBillingAccountResponse; let continuationToken = settings?.continuationToken; @@ -90,7 +105,7 @@ export class ReservationsImpl implements Reservations { result = await this._listByBillingAccountNext( billingAccountName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -101,11 +116,11 @@ export class ReservationsImpl implements Reservations { private async *listByBillingAccountPagingAll( billingAccountName: string, - options?: ReservationsListByBillingAccountOptionalParams + options?: ReservationsListByBillingAccountOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByBillingAccountPagingPage( billingAccountName, - options + options, )) { yield* page; } @@ -121,12 +136,12 @@ export class ReservationsImpl implements Reservations { public listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: ReservationsListByBillingProfileOptionalParams + options?: ReservationsListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByBillingProfilePagingAll( billingAccountName, billingProfileName, - options + options, ); return { next() { @@ -143,9 +158,9 @@ export class ReservationsImpl implements Reservations { billingAccountName, billingProfileName, options, - settings + settings, ); - } + }, }; } @@ -153,7 +168,7 @@ export class ReservationsImpl implements Reservations { billingAccountName: string, billingProfileName: string, options?: ReservationsListByBillingProfileOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ReservationsListByBillingProfileResponse; let continuationToken = settings?.continuationToken; @@ -161,7 +176,7 @@ export class ReservationsImpl implements Reservations { result = await this._listByBillingProfile( billingAccountName, billingProfileName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -173,7 +188,7 @@ export class ReservationsImpl implements Reservations { billingAccountName, billingProfileName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -185,30 +200,114 @@ export class ReservationsImpl implements Reservations { private async *listByBillingProfilePagingAll( billingAccountName: string, billingProfileName: string, - options?: ReservationsListByBillingProfileOptionalParams + options?: ReservationsListByBillingProfileOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByBillingProfilePagingPage( billingAccountName, billingProfileName, - options + options, )) { yield* page; } } /** - * Lists the reservations for a billing account and the roll up counts of reservations group by + * List Reservations within a single ReservationOrder in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param options The options parameters. + */ + public listByReservationOrder( + billingAccountName: string, + reservationOrderId: string, + options?: ReservationsListByReservationOrderOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByReservationOrderPagingAll( + billingAccountName, + reservationOrderId, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByReservationOrderPagingPage( + billingAccountName, + reservationOrderId, + options, + settings, + ); + }, + }; + } + + private async *listByReservationOrderPagingPage( + billingAccountName: string, + reservationOrderId: string, + options?: ReservationsListByReservationOrderOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ReservationsListByReservationOrderResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReservationOrder( + billingAccountName, + reservationOrderId, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByReservationOrderNext( + billingAccountName, + reservationOrderId, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByReservationOrderPagingAll( + billingAccountName: string, + reservationOrderId: string, + options?: ReservationsListByReservationOrderOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByReservationOrderPagingPage( + billingAccountName, + reservationOrderId, + options, + )) { + yield* page; + } + } + + /** + * Lists the reservations in the billing account and the roll up counts of reservations group by * provisioning states. * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ private _listByBillingAccount( billingAccountName: string, - options?: ReservationsListByBillingAccountOptionalParams + options?: ReservationsListByBillingAccountOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, options }, - listByBillingAccountOperationSpec + listByBillingAccountOperationSpec, ); } @@ -222,11 +321,153 @@ export class ReservationsImpl implements Reservations { private _listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: ReservationsListByBillingProfileOptionalParams + options?: ReservationsListByBillingProfileOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, options }, - listByBillingProfileOperationSpec + listByBillingProfileOperationSpec, + ); + } + + /** + * Get specific Reservation details in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation item + * @param options The options parameters. + */ + getByReservationOrder( + billingAccountName: string, + reservationOrderId: string, + reservationId: string, + options?: ReservationsGetByReservationOrderOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, reservationOrderId, reservationId, options }, + getByReservationOrderOperationSpec, + ); + } + + /** + * Update reservation by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation item + * @param body Request body for patching a reservation + * @param options The options parameters. + */ + async beginUpdateByBillingAccount( + billingAccountName: string, + reservationOrderId: string, + reservationId: string, + body: Patch, + options?: ReservationsUpdateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ReservationsUpdateByBillingAccountResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + reservationOrderId, + reservationId, + body, + options, + }, + spec: updateByBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + ReservationsUpdateByBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Update reservation by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation item + * @param body Request body for patching a reservation + * @param options The options parameters. + */ + async beginUpdateByBillingAccountAndWait( + billingAccountName: string, + reservationOrderId: string, + reservationId: string, + body: Patch, + options?: ReservationsUpdateByBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginUpdateByBillingAccount( + billingAccountName, + reservationOrderId, + reservationId, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * List Reservations within a single ReservationOrder in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param options The options parameters. + */ + private _listByReservationOrder( + billingAccountName: string, + reservationOrderId: string, + options?: ReservationsListByReservationOrderOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, reservationOrderId, options }, + listByReservationOrderOperationSpec, ); } @@ -239,11 +480,11 @@ export class ReservationsImpl implements Reservations { private _listByBillingAccountNext( billingAccountName: string, nextLink: string, - options?: ReservationsListByBillingAccountNextOptionalParams + options?: ReservationsListByBillingAccountNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, nextLink, options }, - listByBillingAccountNextOperationSpec + listByBillingAccountNextOperationSpec, ); } @@ -258,11 +499,30 @@ export class ReservationsImpl implements Reservations { billingAccountName: string, billingProfileName: string, nextLink: string, - options?: ReservationsListByBillingProfileNextOptionalParams + options?: ReservationsListByBillingProfileNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, billingProfileName, nextLink, options }, - listByBillingProfileNextOperationSpec + listByBillingProfileNextOperationSpec, + ); + } + + /** + * ListByReservationOrderNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param nextLink The nextLink from the previous successful call to the ListByReservationOrder method. + * @param options The options parameters. + */ + private _listByReservationOrderNext( + billingAccountName: string, + reservationOrderId: string, + nextLink: string, + options?: ReservationsListByReservationOrderNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, reservationOrderId, nextLink, options }, + listByReservationOrderNextOperationSpec, ); } } @@ -270,105 +530,186 @@ export class ReservationsImpl implements Reservations { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listByBillingAccountOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservations", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ReservationsListResult + bodyMapper: Mappers.ReservationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [ Parameters.apiVersion, Parameters.filter, - Parameters.orderby, + Parameters.orderBy, + Parameters.skiptoken, + Parameters.take, + Parameters.selectedState, Parameters.refreshSummary, - Parameters.selectedState ], urlParameters: [Parameters.$host, Parameters.billingAccountName], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByBillingProfileOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/reservations", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/reservations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ReservationsListResult + bodyMapper: Mappers.ReservationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [ Parameters.apiVersion, Parameters.filter, - Parameters.orderby, + Parameters.orderBy, + Parameters.skiptoken, + Parameters.take, + Parameters.selectedState, Parameters.refreshSummary, - Parameters.selectedState ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.billingProfileName + Parameters.billingProfileName, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const getByReservationOrderOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservationOrders/{reservationOrderId}/reservations/{reservationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Reservation, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.reservationOrderId, + Parameters.reservationId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservationOrders/{reservationOrderId}/reservations/{reservationId}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Reservation, + }, + 201: { + bodyMapper: Mappers.Reservation, + }, + 202: { + bodyMapper: Mappers.Reservation, + }, + 204: { + bodyMapper: Mappers.Reservation, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.reservationOrderId, + Parameters.reservationId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByReservationOrderOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservationOrders/{reservationOrderId}/reservations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.reservationOrderId, + ], + headerParameters: [Parameters.accept], + serializer, }; const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ReservationsListResult + bodyMapper: Mappers.ReservationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.orderby, - Parameters.refreshSummary, - Parameters.selectedState - ], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ReservationsListResult + bodyMapper: Mappers.ReservationsListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.orderby, - Parameters.refreshSummary, - Parameters.selectedState + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByReservationOrderNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ReservationList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.billingProfileName + Parameters.reservationOrderId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/savingsPlanOrders.ts b/sdk/billing/arm-billing/src/operations/savingsPlanOrders.ts new file mode 100644 index 000000000000..cc68f538cbe8 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/savingsPlanOrders.ts @@ -0,0 +1,222 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { SavingsPlanOrders } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + SavingsPlanOrderModel, + SavingsPlanOrdersListByBillingAccountNextOptionalParams, + SavingsPlanOrdersListByBillingAccountOptionalParams, + SavingsPlanOrdersListByBillingAccountResponse, + SavingsPlanOrdersGetByBillingAccountOptionalParams, + SavingsPlanOrdersGetByBillingAccountResponse, + SavingsPlanOrdersListByBillingAccountNextResponse, +} from "../models"; + +/// +/** Class containing SavingsPlanOrders operations. */ +export class SavingsPlanOrdersImpl implements SavingsPlanOrders { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class SavingsPlanOrders class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * List all Savings plan orders by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountName: string, + options?: SavingsPlanOrdersListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: SavingsPlanOrdersListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: SavingsPlanOrdersListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: SavingsPlanOrdersListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * Get a savings plan order by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + savingsPlanOrderId: string, + options?: SavingsPlanOrdersGetByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, savingsPlanOrderId, options }, + getByBillingAccountOperationSpec, + ); + } + + /** + * List all Savings plan orders by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: SavingsPlanOrdersListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: SavingsPlanOrdersListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/savingsPlanOrders/{savingsPlanOrderId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanOrderModel, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.savingsPlanOrderId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/savingsPlanOrders", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanOrderModelList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.skiptoken, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanOrderModelList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/savingsPlans.ts b/sdk/billing/arm-billing/src/operations/savingsPlans.ts new file mode 100644 index 000000000000..a0ec362cb245 --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/savingsPlans.ts @@ -0,0 +1,586 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { SavingsPlans } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + SavingsPlanModel, + SavingsPlansListBySavingsPlanOrderNextOptionalParams, + SavingsPlansListBySavingsPlanOrderOptionalParams, + SavingsPlansListBySavingsPlanOrderResponse, + SavingsPlansListByBillingAccountNextOptionalParams, + SavingsPlansListByBillingAccountOptionalParams, + SavingsPlansListByBillingAccountResponse, + SavingsPlansGetByBillingAccountOptionalParams, + SavingsPlansGetByBillingAccountResponse, + SavingsPlanUpdateRequest, + SavingsPlansUpdateByBillingAccountOptionalParams, + SavingsPlansUpdateByBillingAccountResponse, + SavingsPlanUpdateValidateRequest, + SavingsPlansValidateUpdateByBillingAccountOptionalParams, + SavingsPlansValidateUpdateByBillingAccountResponse, + SavingsPlansListBySavingsPlanOrderNextResponse, + SavingsPlansListByBillingAccountNextResponse, +} from "../models"; + +/// +/** Class containing SavingsPlans operations. */ +export class SavingsPlansImpl implements SavingsPlans { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class SavingsPlans class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * List savings plans in an order by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param options The options parameters. + */ + public listBySavingsPlanOrder( + billingAccountName: string, + savingsPlanOrderId: string, + options?: SavingsPlansListBySavingsPlanOrderOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySavingsPlanOrderPagingAll( + billingAccountName, + savingsPlanOrderId, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySavingsPlanOrderPagingPage( + billingAccountName, + savingsPlanOrderId, + options, + settings, + ); + }, + }; + } + + private async *listBySavingsPlanOrderPagingPage( + billingAccountName: string, + savingsPlanOrderId: string, + options?: SavingsPlansListBySavingsPlanOrderOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: SavingsPlansListBySavingsPlanOrderResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySavingsPlanOrder( + billingAccountName, + savingsPlanOrderId, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySavingsPlanOrderNext( + billingAccountName, + savingsPlanOrderId, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySavingsPlanOrderPagingAll( + billingAccountName: string, + savingsPlanOrderId: string, + options?: SavingsPlansListBySavingsPlanOrderOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySavingsPlanOrderPagingPage( + billingAccountName, + savingsPlanOrderId, + options, + )) { + yield* page; + } + } + + /** + * List savings plans by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + public listByBillingAccount( + billingAccountName: string, + options?: SavingsPlansListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingAccountPagingAll( + billingAccountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingAccountPagingPage( + billingAccountName, + options, + settings, + ); + }, + }; + } + + private async *listByBillingAccountPagingPage( + billingAccountName: string, + options?: SavingsPlansListByBillingAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: SavingsPlansListByBillingAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingAccount(billingAccountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingAccountNext( + billingAccountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingAccountPagingAll( + billingAccountName: string, + options?: SavingsPlansListByBillingAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingAccountPagingPage( + billingAccountName, + options, + )) { + yield* page; + } + } + + /** + * List savings plans in an order by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param options The options parameters. + */ + private _listBySavingsPlanOrder( + billingAccountName: string, + savingsPlanOrderId: string, + options?: SavingsPlansListBySavingsPlanOrderOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, savingsPlanOrderId, options }, + listBySavingsPlanOrderOperationSpec, + ); + } + + /** + * List savings plans by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + private _listByBillingAccount( + billingAccountName: string, + options?: SavingsPlansListByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, options }, + listByBillingAccountOperationSpec, + ); + } + + /** + * Get savings plan by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param savingsPlanId ID of the savings plan + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + savingsPlanOrderId: string, + savingsPlanId: string, + options?: SavingsPlansGetByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, savingsPlanOrderId, savingsPlanId, options }, + getByBillingAccountOperationSpec, + ); + } + + /** + * Update savings plan by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param savingsPlanId ID of the savings plan + * @param body Request body for patching a savings plan order alias + * @param options The options parameters. + */ + async beginUpdateByBillingAccount( + billingAccountName: string, + savingsPlanOrderId: string, + savingsPlanId: string, + body: SavingsPlanUpdateRequest, + options?: SavingsPlansUpdateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SavingsPlansUpdateByBillingAccountResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + body, + options, + }, + spec: updateByBillingAccountOperationSpec, + }); + const poller = await createHttpPoller< + SavingsPlansUpdateByBillingAccountResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Update savings plan by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param savingsPlanId ID of the savings plan + * @param body Request body for patching a savings plan order alias + * @param options The options parameters. + */ + async beginUpdateByBillingAccountAndWait( + billingAccountName: string, + savingsPlanOrderId: string, + savingsPlanId: string, + body: SavingsPlanUpdateRequest, + options?: SavingsPlansUpdateByBillingAccountOptionalParams, + ): Promise { + const poller = await this.beginUpdateByBillingAccount( + billingAccountName, + savingsPlanOrderId, + savingsPlanId, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Validate savings plan patch by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param savingsPlanId ID of the savings plan + * @param body Request body for patching a savings plan order alias + * @param options The options parameters. + */ + validateUpdateByBillingAccount( + billingAccountName: string, + savingsPlanOrderId: string, + savingsPlanId: string, + body: SavingsPlanUpdateValidateRequest, + options?: SavingsPlansValidateUpdateByBillingAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, savingsPlanOrderId, savingsPlanId, body, options }, + validateUpdateByBillingAccountOperationSpec, + ); + } + + /** + * ListBySavingsPlanOrderNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param nextLink The nextLink from the previous successful call to the ListBySavingsPlanOrder method. + * @param options The options parameters. + */ + private _listBySavingsPlanOrderNext( + billingAccountName: string, + savingsPlanOrderId: string, + nextLink: string, + options?: SavingsPlansListBySavingsPlanOrderNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, savingsPlanOrderId, nextLink, options }, + listBySavingsPlanOrderNextOperationSpec, + ); + } + + /** + * ListByBillingAccountNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param nextLink The nextLink from the previous successful call to the ListByBillingAccount method. + * @param options The options parameters. + */ + private _listByBillingAccountNext( + billingAccountName: string, + nextLink: string, + options?: SavingsPlansListByBillingAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, nextLink, options }, + listByBillingAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySavingsPlanOrderOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanModelList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.savingsPlanOrderId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/savingsPlans", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanModelListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.skiptoken, + Parameters.take, + Parameters.selectedState, + Parameters.refreshSummary, + ], + urlParameters: [Parameters.$host, Parameters.billingAccountName], + headerParameters: [Parameters.accept], + serializer, +}; +const getByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanModel, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion, Parameters.expand], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.savingsPlanOrderId, + Parameters.savingsPlanId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanModel, + }, + 201: { + bodyMapper: Mappers.SavingsPlanModel, + }, + 202: { + bodyMapper: Mappers.SavingsPlanModel, + }, + 204: { + bodyMapper: Mappers.SavingsPlanModel, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.savingsPlanOrderId, + Parameters.savingsPlanId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const validateUpdateByBillingAccountOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/validate", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanValidateResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.savingsPlanOrderId, + Parameters.savingsPlanId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listBySavingsPlanOrderNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanModelList, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.savingsPlanOrderId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SavingsPlanModelListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operations/transactions.ts b/sdk/billing/arm-billing/src/operations/transactions.ts index e5ee25229ff7..5267ac01a9f7 100644 --- a/sdk/billing/arm-billing/src/operations/transactions.ts +++ b/sdk/billing/arm-billing/src/operations/transactions.ts @@ -13,12 +13,35 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BillingManagementClient } from "../billingManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Transaction, + TransactionsListByCustomerNextOptionalParams, + TransactionType, + TransactionsListByCustomerOptionalParams, + TransactionsListByCustomerResponse, + TransactionsListByInvoiceSectionNextOptionalParams, + TransactionsListByInvoiceSectionOptionalParams, + TransactionsListByInvoiceSectionResponse, + TransactionsListByBillingProfileNextOptionalParams, + TransactionsListByBillingProfileOptionalParams, + TransactionsListByBillingProfileResponse, TransactionsListByInvoiceNextOptionalParams, TransactionsListByInvoiceOptionalParams, TransactionsListByInvoiceResponse, - TransactionsListByInvoiceNextResponse + TransactionsTransactionsDownloadByInvoiceOptionalParams, + TransactionsTransactionsDownloadByInvoiceResponse, + TransactionsGetTransactionSummaryByInvoiceOptionalParams, + TransactionsGetTransactionSummaryByInvoiceResponse, + TransactionsListByCustomerNextResponse, + TransactionsListByInvoiceSectionNextResponse, + TransactionsListByBillingProfileNextResponse, + TransactionsListByInvoiceNextResponse, } from "../models"; /// @@ -34,6 +57,363 @@ export class TransactionsImpl implements Transactions { this.client = client; } + /** + * Lists the billed or unbilled transactions by customer id for given start date and end date. + * Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed + * under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is + * generated. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param periodStartDate The start date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param periodEndDate The end date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param typeParam The type of transaction. + * @param options The options parameters. + */ + public listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByCustomerOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCustomerPagingAll( + billingAccountName, + billingProfileName, + customerName, + periodStartDate, + periodEndDate, + typeParam, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByCustomerPagingPage( + billingAccountName, + billingProfileName, + customerName, + periodStartDate, + periodEndDate, + typeParam, + options, + settings, + ); + }, + }; + } + + private async *listByCustomerPagingPage( + billingAccountName: string, + billingProfileName: string, + customerName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByCustomerOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TransactionsListByCustomerResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCustomer( + billingAccountName, + billingProfileName, + customerName, + periodStartDate, + periodEndDate, + typeParam, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCustomerNext( + billingAccountName, + billingProfileName, + customerName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCustomerPagingAll( + billingAccountName: string, + billingProfileName: string, + customerName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByCustomerOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCustomerPagingPage( + billingAccountName, + billingProfileName, + customerName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + yield* page; + } + } + + /** + * Lists the billed or unbilled transactions by invoice section name for given start date and end date. + * Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed + * under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is + * generated. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param periodStartDate The start date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param periodEndDate The end date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param typeParam The type of transaction. + * @param options The options parameters. + */ + public listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByInvoiceSectionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByInvoiceSectionPagingAll( + billingAccountName, + billingProfileName, + invoiceSectionName, + periodStartDate, + periodEndDate, + typeParam, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByInvoiceSectionPagingPage( + billingAccountName, + billingProfileName, + invoiceSectionName, + periodStartDate, + periodEndDate, + typeParam, + options, + settings, + ); + }, + }; + } + + private async *listByInvoiceSectionPagingPage( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByInvoiceSectionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TransactionsListByInvoiceSectionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByInvoiceSection( + billingAccountName, + billingProfileName, + invoiceSectionName, + periodStartDate, + periodEndDate, + typeParam, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByInvoiceSectionNext( + billingAccountName, + billingProfileName, + invoiceSectionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByInvoiceSectionPagingAll( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByInvoiceSectionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByInvoiceSectionPagingPage( + billingAccountName, + billingProfileName, + invoiceSectionName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + yield* page; + } + } + + /** + * Lists the billed or unbilled transactions by billing profile name for given start and end date. + * Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed + * under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is + * generated. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param periodStartDate The start date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param periodEndDate The end date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param typeParam The type of transaction. + * @param options The options parameters. + */ + public listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByBillingProfilePagingAll( + billingAccountName, + billingProfileName, + periodStartDate, + periodEndDate, + typeParam, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + periodStartDate, + periodEndDate, + typeParam, + options, + settings, + ); + }, + }; + } + + private async *listByBillingProfilePagingPage( + billingAccountName: string, + billingProfileName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByBillingProfileOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TransactionsListByBillingProfileResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByBillingProfile( + billingAccountName, + billingProfileName, + periodStartDate, + periodEndDate, + typeParam, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByBillingProfileNext( + billingAccountName, + billingProfileName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByBillingProfilePagingAll( + billingAccountName: string, + billingProfileName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByBillingProfileOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByBillingProfilePagingPage( + billingAccountName, + billingProfileName, + periodStartDate, + periodEndDate, + typeParam, + options, + )) { + yield* page; + } + } + /** * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage * charges. @@ -44,12 +424,12 @@ export class TransactionsImpl implements Transactions { public listByInvoice( billingAccountName: string, invoiceName: string, - options?: TransactionsListByInvoiceOptionalParams + options?: TransactionsListByInvoiceOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByInvoicePagingAll( billingAccountName, invoiceName, - options + options, ); return { next() { @@ -66,9 +446,9 @@ export class TransactionsImpl implements Transactions { billingAccountName, invoiceName, options, - settings + settings, ); - } + }, }; } @@ -76,7 +456,7 @@ export class TransactionsImpl implements Transactions { billingAccountName: string, invoiceName: string, options?: TransactionsListByInvoiceOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: TransactionsListByInvoiceResponse; let continuationToken = settings?.continuationToken; @@ -84,7 +464,7 @@ export class TransactionsImpl implements Transactions { result = await this._listByInvoice( billingAccountName, invoiceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -96,7 +476,7 @@ export class TransactionsImpl implements Transactions { billingAccountName, invoiceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -108,17 +488,128 @@ export class TransactionsImpl implements Transactions { private async *listByInvoicePagingAll( billingAccountName: string, invoiceName: string, - options?: TransactionsListByInvoiceOptionalParams + options?: TransactionsListByInvoiceOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByInvoicePagingPage( billingAccountName, invoiceName, - options + options, )) { yield* page; } } + /** + * Lists the billed or unbilled transactions by customer id for given start date and end date. + * Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed + * under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is + * generated. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param periodStartDate The start date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param periodEndDate The end date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param typeParam The type of transaction. + * @param options The options parameters. + */ + private _listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByCustomerOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + periodStartDate, + periodEndDate, + typeParam, + options, + }, + listByCustomerOperationSpec, + ); + } + + /** + * Lists the billed or unbilled transactions by invoice section name for given start date and end date. + * Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed + * under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is + * generated. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param periodStartDate The start date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param periodEndDate The end date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param typeParam The type of transaction. + * @param options The options parameters. + */ + private _listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByInvoiceSectionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + periodStartDate, + periodEndDate, + typeParam, + options, + }, + listByInvoiceSectionOperationSpec, + ); + } + + /** + * Lists the billed or unbilled transactions by billing profile name for given start and end date. + * Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed + * under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is + * generated. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param periodStartDate The start date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param periodEndDate The end date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param typeParam The type of transaction. + * @param options The options parameters. + */ + private _listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByBillingProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + periodStartDate, + periodEndDate, + typeParam, + options, + }, + listByBillingProfileOperationSpec, + ); + } + /** * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage * charges. @@ -129,11 +620,194 @@ export class TransactionsImpl implements Transactions { private _listByInvoice( billingAccountName: string, invoiceName: string, - options?: TransactionsListByInvoiceOptionalParams + options?: TransactionsListByInvoiceOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, invoiceName, options }, - listByInvoiceOperationSpec + listByInvoiceOperationSpec, + ); + } + + /** + * Gets a URL to download the transactions document for an invoice. The operation is supported for + * billing accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param invoiceName The ID that uniquely identifies an invoice. + * @param options The options parameters. + */ + async beginTransactionsDownloadByInvoice( + billingAccountName: string, + invoiceName: string, + options?: TransactionsTransactionsDownloadByInvoiceOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TransactionsTransactionsDownloadByInvoiceResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountName, invoiceName, options }, + spec: transactionsDownloadByInvoiceOperationSpec, + }); + const poller = await createHttpPoller< + TransactionsTransactionsDownloadByInvoiceResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Gets a URL to download the transactions document for an invoice. The operation is supported for + * billing accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param invoiceName The ID that uniquely identifies an invoice. + * @param options The options parameters. + */ + async beginTransactionsDownloadByInvoiceAndWait( + billingAccountName: string, + invoiceName: string, + options?: TransactionsTransactionsDownloadByInvoiceOptionalParams, + ): Promise { + const poller = await this.beginTransactionsDownloadByInvoice( + billingAccountName, + invoiceName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage + * charges. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param invoiceName The ID that uniquely identifies an invoice. + * @param options The options parameters. + */ + getTransactionSummaryByInvoice( + billingAccountName: string, + invoiceName: string, + options?: TransactionsGetTransactionSummaryByInvoiceOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, invoiceName, options }, + getTransactionSummaryByInvoiceOperationSpec, + ); + } + + /** + * ListByCustomerNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. + * @param options The options parameters. + */ + private _listByCustomerNext( + billingAccountName: string, + billingProfileName: string, + customerName: string, + nextLink: string, + options?: TransactionsListByCustomerNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + customerName, + nextLink, + options, + }, + listByCustomerNextOperationSpec, + ); + } + + /** + * ListByInvoiceSectionNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param nextLink The nextLink from the previous successful call to the ListByInvoiceSection method. + * @param options The options parameters. + */ + private _listByInvoiceSectionNext( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + nextLink: string, + options?: TransactionsListByInvoiceSectionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + nextLink, + options, + }, + listByInvoiceSectionNextOperationSpec, + ); + } + + /** + * ListByBillingProfileNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param nextLink The nextLink from the previous successful call to the ListByBillingProfile method. + * @param options The options parameters. + */ + private _listByBillingProfileNext( + billingAccountName: string, + billingProfileName: string, + nextLink: string, + options?: TransactionsListByBillingProfileNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, nextLink, options }, + listByBillingProfileNextOperationSpec, ); } @@ -148,56 +822,272 @@ export class TransactionsImpl implements Transactions { billingAccountName: string, invoiceName: string, nextLink: string, - options?: TransactionsListByInvoiceNextOptionalParams + options?: TransactionsListByInvoiceNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { billingAccountName, invoiceName, nextLink, options }, - listByInvoiceNextOperationSpec + listByInvoiceNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const listByCustomerOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers/{customerName}/transactions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransactionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.periodStartDate1, + Parameters.periodEndDate1, + Parameters.typeParam, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByInvoiceSectionOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransactionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.periodStartDate1, + Parameters.periodEndDate1, + Parameters.typeParam, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransactionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + Parameters.periodStartDate1, + Parameters.periodEndDate1, + Parameters.typeParam, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; const listByInvoiceOperationSpec: coreClient.OperationSpec = { - path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/transactions", + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/transactions", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TransactionListResult + bodyMapper: Mappers.TransactionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.orderBy, + Parameters.top, + Parameters.skip, + Parameters.count, + Parameters.search, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.invoiceName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const transactionsDownloadByInvoiceOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/transactionsDownload", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + 201: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + 202: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + 204: { + bodyMapper: Mappers.DocumentDownloadResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, - Parameters.invoiceName + Parameters.invoiceName, ], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const getTransactionSummaryByInvoiceOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/transactionSummary", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransactionSummary, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.search, + ], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.invoiceName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCustomerNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransactionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.customerName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByInvoiceSectionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransactionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransactionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + ], + headerParameters: [Parameters.accept], + serializer, }; const listByInvoiceNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.TransactionListResult + bodyMapper: Mappers.TransactionListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.billingAccountName, Parameters.nextLink, - Parameters.invoiceName + Parameters.invoiceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/billing/arm-billing/src/operations/transfers.ts b/sdk/billing/arm-billing/src/operations/transfers.ts new file mode 100644 index 000000000000..85892e811b8b --- /dev/null +++ b/sdk/billing/arm-billing/src/operations/transfers.ts @@ -0,0 +1,388 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Transfers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { BillingManagementClient } from "../billingManagementClient"; +import { + TransferDetails, + TransfersListNextOptionalParams, + TransfersListOptionalParams, + TransfersListResponse, + TransfersGetOptionalParams, + TransfersGetResponse, + InitiateTransferRequest, + TransfersInitiateOptionalParams, + TransfersInitiateResponse, + TransfersCancelOptionalParams, + TransfersCancelResponse, + TransfersListNextResponse, +} from "../models"; + +/// +/** Class containing Transfers operations. */ +export class TransfersImpl implements Transfers { + private readonly client: BillingManagementClient; + + /** + * Initialize a new instance of the class Transfers class. + * @param client Reference to the service client + */ + constructor(client: BillingManagementClient) { + this.client = client; + } + + /** + * Lists the transfer requests for an invoice section. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + public list( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: TransfersListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: TransfersListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TransfersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + billingAccountName, + billingProfileName, + invoiceSectionName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: TransfersListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + billingAccountName, + billingProfileName, + invoiceSectionName, + options, + )) { + yield* page; + } + } + + /** + * Gets a transfer request by ID. The operation is supported only for billing accounts with agreement + * type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + get( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + transferName: string, + options?: TransfersGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + options, + }, + getOperationSpec, + ); + } + + /** + * Sends a request to a user in another billing account to transfer billing ownership of their + * subscriptions. The operation is supported only for billing accounts with agreement type Microsoft + * Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param transferName The ID that uniquely identifies a transfer request. + * @param parameters Request parameters that are provided to the initiate transfer operation. + * @param options The options parameters. + */ + initiate( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + transferName: string, + parameters: InitiateTransferRequest, + options?: TransfersInitiateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + parameters, + options, + }, + initiateOperationSpec, + ); + } + + /** + * Cancels a transfer request. The operation is supported only for billing accounts with agreement type + * Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + cancel( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + transferName: string, + options?: TransfersCancelOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + transferName, + options, + }, + cancelOperationSpec, + ); + } + + /** + * Lists the transfer requests for an invoice section. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + private _list( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: TransfersListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { billingAccountName, billingProfileName, invoiceSectionName, options }, + listOperationSpec, + ); + } + + /** + * ListNext + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + nextLink: string, + options?: TransfersListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + billingAccountName, + billingProfileName, + invoiceSectionName, + nextLink, + options, + }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransferDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + Parameters.transferName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const initiateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TransferDetails, + }, + 201: { + bodyMapper: Mappers.TransferDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters24, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + Parameters.transferName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const cancelOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}/cancel", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.TransferDetails, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + Parameters.transferName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransferDetailsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransferDetailsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.billingAccountName, + Parameters.nextLink, + Parameters.billingProfileName, + Parameters.invoiceSectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/address.ts b/sdk/billing/arm-billing/src/operationsInterfaces/address.ts index 70b8ea9c3965..e5a66be00b42 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/address.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/address.ts @@ -9,7 +9,7 @@ import { AddressDetails, AddressValidateOptionalParams, - AddressValidateResponse + AddressValidateResponse, } from "../models"; /** Interface representing a Address. */ @@ -17,11 +17,11 @@ export interface Address { /** * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo * address. - * @param address Address details. + * @param parameters Address details. * @param options The options parameters. */ validate( - address: AddressDetails, - options?: AddressValidateOptionalParams + parameters: AddressDetails, + options?: AddressValidateOptionalParams, ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/agreements.ts b/sdk/billing/arm-billing/src/operationsInterfaces/agreements.ts index b136b9560ace..860d4ff6d2f3 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/agreements.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/agreements.ts @@ -11,7 +11,7 @@ import { Agreement, AgreementsListByBillingAccountOptionalParams, AgreementsGetOptionalParams, - AgreementsGetResponse + AgreementsGetResponse, } from "../models"; /// @@ -24,7 +24,7 @@ export interface Agreements { */ listByBillingAccount( billingAccountName: string, - options?: AgreementsListByBillingAccountOptionalParams + options?: AgreementsListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator; /** * Gets an agreement by ID. @@ -35,6 +35,6 @@ export interface Agreements { get( billingAccountName: string, agreementName: string, - options?: AgreementsGetOptionalParams + options?: AgreementsGetOptionalParams, ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/associatedTenants.ts b/sdk/billing/arm-billing/src/operationsInterfaces/associatedTenants.ts new file mode 100644 index 000000000000..558dfb5d1f1a --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/associatedTenants.ts @@ -0,0 +1,105 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + AssociatedTenant, + AssociatedTenantsListByBillingAccountOptionalParams, + AssociatedTenantsDeleteOptionalParams, + AssociatedTenantsDeleteResponse, + AssociatedTenantsGetOptionalParams, + AssociatedTenantsGetResponse, + AssociatedTenantsCreateOrUpdateOptionalParams, + AssociatedTenantsCreateOrUpdateResponse, +} from "../models"; + +/// +/** Interface representing a AssociatedTenants. */ +export interface AssociatedTenants { + /** + * Lists the associated tenants that can collaborate with the billing account on commerce activities + * like viewing and downloading invoices, managing payments, making purchases, and managing or + * provisioning licenses. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: AssociatedTenantsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Deletes an associated tenant for a billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param options The options parameters. + */ + beginDelete( + billingAccountName: string, + associatedTenantName: string, + options?: AssociatedTenantsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AssociatedTenantsDeleteResponse + > + >; + /** + * Deletes an associated tenant for a billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param options The options parameters. + */ + beginDeleteAndWait( + billingAccountName: string, + associatedTenantName: string, + options?: AssociatedTenantsDeleteOptionalParams, + ): Promise; + /** + * Gets an associated tenant by ID. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param options The options parameters. + */ + get( + billingAccountName: string, + associatedTenantName: string, + options?: AssociatedTenantsGetOptionalParams, + ): Promise; + /** + * Create or update an associated tenant for the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param parameters An associated tenant. + * @param options The options parameters. + */ + beginCreateOrUpdate( + billingAccountName: string, + associatedTenantName: string, + parameters: AssociatedTenant, + options?: AssociatedTenantsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AssociatedTenantsCreateOrUpdateResponse + > + >; + /** + * Create or update an associated tenant for the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param parameters An associated tenant. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + billingAccountName: string, + associatedTenantName: string, + parameters: AssociatedTenant, + options?: AssociatedTenantsCreateOrUpdateOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/availableBalances.ts b/sdk/billing/arm-billing/src/operationsInterfaces/availableBalances.ts index bce0970573f8..f6aba7357858 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/availableBalances.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/availableBalances.ts @@ -7,23 +7,38 @@ */ import { - AvailableBalancesGetOptionalParams, - AvailableBalancesGetResponse + AvailableBalancesGetByBillingAccountOptionalParams, + AvailableBalancesGetByBillingAccountResponse, + AvailableBalancesGetByBillingProfileOptionalParams, + AvailableBalancesGetByBillingProfileResponse, } from "../models"; /** Interface representing a AvailableBalances. */ export interface AvailableBalances { /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now - * to settle due or past due invoices. The operation is supported only for billing accounts with + * The Available Credit or Payment on Account Balance for a billing account. The credit balance can be + * used to settle due or past due invoices and is supported for billing accounts with agreement type + * Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with + * agreement type Microsoft Customer Agreement or Microsoft Online Services Program. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + options?: AvailableBalancesGetByBillingAccountOptionalParams, + ): Promise; + /** + * The Available Credit or Payment on Account Balance for a billing profile. The credit balance can be + * used to settle due or past due invoices and is supported for billing accounts with agreement type + * Microsoft Customer Agreement. The payment on account balance is supported for billing accounts with * agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - get( + getByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: AvailableBalancesGetOptionalParams - ): Promise; + options?: AvailableBalancesGetByBillingProfileOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingAccounts.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingAccounts.ts index 3b4b3e3664a6..84872f9387eb 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/billingAccounts.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/billingAccounts.ts @@ -7,39 +7,134 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { - BillingAccount, - BillingAccountsListOptionalParams, InvoiceSectionWithCreateSubPermission, BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams, + BillingAccount, + BillingAccountsListOptionalParams, + PaymentTerm, + BillingAccountsAddPaymentTermsOptionalParams, + BillingAccountsAddPaymentTermsResponse, + BillingAccountsCancelPaymentTermsOptionalParams, + BillingAccountsCancelPaymentTermsResponse, + BillingAccountsConfirmTransitionOptionalParams, + BillingAccountsConfirmTransitionResponse, + BillingAccountsValidatePaymentTermsOptionalParams, + BillingAccountsValidatePaymentTermsResponse, BillingAccountsGetOptionalParams, BillingAccountsGetResponse, - BillingAccountUpdateRequest, + BillingAccountPatch, BillingAccountsUpdateOptionalParams, - BillingAccountsUpdateResponse + BillingAccountsUpdateResponse, } from "../models"; /// /** Interface representing a BillingAccounts. */ export interface BillingAccounts { + /** + * Lists the invoice sections for which the user has permission to create Azure subscriptions. The + * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listInvoiceSectionsByCreateSubscriptionPermission( + billingAccountName: string, + options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams, + ): PagedAsyncIterableIterator; /** * Lists the billing accounts that a user has access to. * @param options The options parameters. */ list( - options?: BillingAccountsListOptionalParams + options?: BillingAccountsListOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Adds payment terms to all the billing profiles under the billing account. Currently, payment terms + * can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and + * AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are + * authorized to add the payment terms and is not a self-serve action. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of payment term. * @param options The options parameters. */ - listInvoiceSectionsByCreateSubscriptionPermission( + beginAddPaymentTerms( billingAccountName: string, - options?: BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionOptionalParams - ): PagedAsyncIterableIterator; + parameters: PaymentTerm[], + options?: BillingAccountsAddPaymentTermsOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingAccountsAddPaymentTermsResponse + > + >; + /** + * Adds payment terms to all the billing profiles under the billing account. Currently, payment terms + * can be added only on billing accounts that have Agreement Type as 'Microsoft Customer Agreement' and + * AccountType as 'Enterprise'. This action needs pre-authorization and only Field Sellers are + * authorized to add the payment terms and is not a self-serve action. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of payment term. + * @param options The options parameters. + */ + beginAddPaymentTermsAndWait( + billingAccountName: string, + parameters: PaymentTerm[], + options?: BillingAccountsAddPaymentTermsOptionalParams, + ): Promise; + /** + * Cancels all the payment terms on billing account that falls after the cancellation date in the + * request. Currently, cancel payment terms is only served by admin actions and is not a self-serve + * action. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters Date after which any payment terms that needs to be cancelled. + * @param options The options parameters. + */ + beginCancelPaymentTerms( + billingAccountName: string, + parameters: Date, + options?: BillingAccountsCancelPaymentTermsOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingAccountsCancelPaymentTermsResponse + > + >; + /** + * Cancels all the payment terms on billing account that falls after the cancellation date in the + * request. Currently, cancel payment terms is only served by admin actions and is not a self-serve + * action. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters Date after which any payment terms that needs to be cancelled. + * @param options The options parameters. + */ + beginCancelPaymentTermsAndWait( + billingAccountName: string, + parameters: Date, + options?: BillingAccountsCancelPaymentTermsOptionalParams, + ): Promise; + /** + * Gets the transition details for a billing account that has transitioned from agreement type + * Microsoft Online Services Program to agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + confirmTransition( + billingAccountName: string, + options?: BillingAccountsConfirmTransitionOptionalParams, + ): Promise; + /** + * Validates payment terms on a billing account with agreement type 'Microsoft Customer Agreement' and + * account type 'Enterprise'. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of payment term. + * @param options The options parameters. + */ + validatePaymentTerms( + billingAccountName: string, + parameters: PaymentTerm[], + options?: BillingAccountsValidatePaymentTermsOptionalParams, + ): Promise; /** * Gets a billing account by its ID. * @param billingAccountName The ID that uniquely identifies a billing account. @@ -47,35 +142,41 @@ export interface BillingAccounts { */ get( billingAccountName: string, - options?: BillingAccountsGetOptionalParams + options?: BillingAccountsGetOptionalParams, ): Promise; /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Updates the properties of a billing account. Currently, displayName and address can be updated for + * billing accounts with agreement type Microsoft Customer Agreement. Currently address and + * notification email address can be updated for billing accounts with agreement type Microsoft Online + * Services Agreement. Currently, purchase order number can be edited for billing accounts with + * agreement type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. + * @param parameters A billing account. * @param options The options parameters. */ beginUpdate( billingAccountName: string, - parameters: BillingAccountUpdateRequest, - options?: BillingAccountsUpdateOptionalParams + parameters: BillingAccountPatch, + options?: BillingAccountsUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, BillingAccountsUpdateResponse > >; /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Updates the properties of a billing account. Currently, displayName and address can be updated for + * billing accounts with agreement type Microsoft Customer Agreement. Currently address and + * notification email address can be updated for billing accounts with agreement type Microsoft Online + * Services Agreement. Currently, purchase order number can be edited for billing accounts with + * agreement type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. + * @param parameters A billing account. * @param options The options parameters. */ beginUpdateAndWait( billingAccountName: string, - parameters: BillingAccountUpdateRequest, - options?: BillingAccountsUpdateOptionalParams + parameters: BillingAccountPatch, + options?: BillingAccountsUpdateOptionalParams, ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingPeriods.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingPeriods.ts deleted file mode 100644 index 5d3bb439bcf4..000000000000 --- a/sdk/billing/arm-billing/src/operationsInterfaces/billingPeriods.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - BillingPeriod, - BillingPeriodsListOptionalParams, - BillingPeriodsGetOptionalParams, - BillingPeriodsGetResponse -} from "../models"; - -/// -/** Interface representing a BillingPeriods. */ -export interface BillingPeriods { - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only - * supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased - * directly through the Azure web portal are not supported through this preview API. - * @param options The options parameters. - */ - list( - options?: BillingPeriodsListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other - * subscription types which were not purchased directly through the Azure web portal are not supported - * through this preview API. - * @param billingPeriodName The name of a BillingPeriod resource. - * @param options The options parameters. - */ - get( - billingPeriodName: string, - options?: BillingPeriodsGetOptionalParams - ): Promise; -} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingPermissions.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingPermissions.ts index 708738a07ad6..50f889b5273f 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/billingPermissions.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/billingPermissions.ts @@ -8,58 +8,189 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { - BillingPermissionsProperties, - BillingPermissionsListByCustomerOptionalParams, + BillingPermission, BillingPermissionsListByBillingAccountOptionalParams, - BillingPermissionsListByInvoiceSectionsOptionalParams, - BillingPermissionsListByBillingProfileOptionalParams + BillingPermissionsListByBillingProfileOptionalParams, + BillingPermissionsListByCustomerOptionalParams, + BillingPermissionsListByInvoiceSectionOptionalParams, + BillingPermissionsListByCustomerAtBillingAccountOptionalParams, + BillingPermissionsListByDepartmentOptionalParams, + BillingPermissionsListByEnrollmentAccountOptionalParams, + CheckAccessRequest, + BillingPermissionsCheckAccessByBillingProfileOptionalParams, + BillingPermissionsCheckAccessByBillingProfileResponse, + BillingPermissionsCheckAccessByCustomerOptionalParams, + BillingPermissionsCheckAccessByCustomerResponse, + BillingPermissionsCheckAccessByInvoiceSectionOptionalParams, + BillingPermissionsCheckAccessByInvoiceSectionResponse, + BillingPermissionsCheckAccessByBillingAccountOptionalParams, + BillingPermissionsCheckAccessByBillingAccountResponse, + BillingPermissionsCheckAccessByDepartmentOptionalParams, + BillingPermissionsCheckAccessByDepartmentResponse, + BillingPermissionsCheckAccessByEnrollmentAccountOptionalParams, + BillingPermissionsCheckAccessByEnrollmentAccountResponse, } from "../models"; /// /** Interface representing a BillingPermissions. */ export interface BillingPermissions { + /** + * Lists the billing permissions the caller has on a billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: BillingPermissionsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the billing permissions the caller has on a billing profile. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingPermissionsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator; /** * Lists the billing permissions the caller has for a customer. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ listByCustomer( billingAccountName: string, + billingProfileName: string, customerName: string, - options?: BillingPermissionsListByCustomerOptionalParams - ): PagedAsyncIterableIterator; + options?: BillingPermissionsListByCustomerOptionalParams, + ): PagedAsyncIterableIterator; /** - * Lists the billing permissions the caller has on a billing account. + * Lists the billing permissions the caller has for an invoice section. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - listByBillingAccount( + listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingPermissionsListByInvoiceSectionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the billing permissions the caller has for a customer at billing account level. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + listByCustomerAtBillingAccount( billingAccountName: string, - options?: BillingPermissionsListByBillingAccountOptionalParams - ): PagedAsyncIterableIterator; + customerName: string, + options?: BillingPermissionsListByCustomerAtBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; /** - * Lists the billing permissions the caller has on an invoice section. + * Lists the billing permissions the caller has for a department. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + listByDepartment( + billingAccountName: string, + departmentName: string, + options?: BillingPermissionsListByDepartmentOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the billing permissions the caller has for an enrollment account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + listByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingPermissionsListByEnrollmentAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Provides a list of check access response objects for a billing profile. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param parameters The request object against which access of the caller will be checked. * @param options The options parameters. */ - listByInvoiceSections( + checkAccessByBillingProfile( billingAccountName: string, billingProfileName: string, - invoiceSectionName: string, - options?: BillingPermissionsListByInvoiceSectionsOptionalParams - ): PagedAsyncIterableIterator; + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByBillingProfileOptionalParams, + ): Promise; /** - * Lists the billing permissions the caller has on a billing profile. + * Provides a list of check access response objects for a customer. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters The request object against which access of the caller will be checked. * @param options The options parameters. */ - listByBillingProfile( + checkAccessByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByCustomerOptionalParams, + ): Promise; + /** + * Provides a list of check access response objects for an invoice section. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByInvoiceSection( billingAccountName: string, billingProfileName: string, - options?: BillingPermissionsListByBillingProfileOptionalParams - ): PagedAsyncIterableIterator; + invoiceSectionName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByInvoiceSectionOptionalParams, + ): Promise; + /** + * Provides a list of check access response objects for a billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByBillingAccount( + billingAccountName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByBillingAccountOptionalParams, + ): Promise; + /** + * Provides a list of check access response objects for a department. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByDepartment( + billingAccountName: string, + departmentName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByDepartmentOptionalParams, + ): Promise; + /** + * Provides a list of check access response objects for an enrollment account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param parameters The request object against which access of the caller will be checked. + * @param options The options parameters. + */ + checkAccessByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + parameters: CheckAccessRequest, + options?: BillingPermissionsCheckAccessByEnrollmentAccountOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingProfiles.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingProfiles.ts index 3f8dc7cef720..bcce47f42772 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/billingProfiles.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/billingProfiles.ts @@ -7,14 +7,18 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { BillingProfile, BillingProfilesListByBillingAccountOptionalParams, + BillingProfilesValidateDeleteEligibilityOptionalParams, + BillingProfilesValidateDeleteEligibilityResponse, + BillingProfilesDeleteOptionalParams, + BillingProfilesDeleteResponse, BillingProfilesGetOptionalParams, BillingProfilesGetResponse, BillingProfilesCreateOrUpdateOptionalParams, - BillingProfilesCreateOrUpdateResponse + BillingProfilesCreateOrUpdateResponse, } from "../models"; /// @@ -22,17 +26,58 @@ import { export interface BillingProfiles { /** * Lists the billing profiles that a user has access to. The operation is supported for billing - * accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * accounts with agreement of type Microsoft Customer Agreement and Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ listByBillingAccount( billingAccountName: string, - options?: BillingProfilesListByBillingAccountOptionalParams + options?: BillingProfilesListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator; + /** + * Validates if the billing profile can be deleted. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement and Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + validateDeleteEligibility( + billingAccountName: string, + billingProfileName: string, + options?: BillingProfilesValidateDeleteEligibilityOptionalParams, + ): Promise; + /** + * Deletes a billing profile. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement and Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + beginDelete( + billingAccountName: string, + billingProfileName: string, + options?: BillingProfilesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingProfilesDeleteResponse + > + >; + /** + * Deletes a billing profile. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement and Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + beginDeleteAndWait( + billingAccountName: string, + billingProfileName: string, + options?: BillingProfilesDeleteOptionalParams, + ): Promise; /** * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. + * type Microsoft Customer Agreement and Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. @@ -40,39 +85,41 @@ export interface BillingProfiles { get( billingAccountName: string, billingProfileName: string, - options?: BillingProfilesGetOptionalParams + options?: BillingProfilesGetOptionalParams, ): Promise; /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. + * type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual + * (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. + * @param parameters A billing profile. * @param options The options parameters. */ beginCreateOrUpdate( billingAccountName: string, billingProfileName: string, parameters: BillingProfile, - options?: BillingProfilesCreateOrUpdateOptionalParams + options?: BillingProfilesCreateOrUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, BillingProfilesCreateOrUpdateResponse > >; /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. + * type Microsoft Customer Agreement and Microsoft Partner Agreement. If you are a MCA Individual + * (Pay-as-you-go) customer, then please use the Azure portal experience to create the billing profile. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. + * @param parameters A billing profile. * @param options The options parameters. */ beginCreateOrUpdateAndWait( billingAccountName: string, billingProfileName: string, parameters: BillingProfile, - options?: BillingProfilesCreateOrUpdateOptionalParams + options?: BillingProfilesCreateOrUpdateOptionalParams, ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingPropertyOperations.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingPropertyOperations.ts index bc146835f5e7..fe95ea7560c4 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/billingPropertyOperations.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/billingPropertyOperations.ts @@ -11,27 +11,27 @@ import { BillingPropertyGetResponse, BillingProperty, BillingPropertyUpdateOptionalParams, - BillingPropertyUpdateResponse + BillingPropertyUpdateResponse, } from "../models"; /** Interface representing a BillingPropertyOperations. */ export interface BillingPropertyOperations { /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts - * with agreement type Enterprise Agreement. + * Gets the billing properties for a subscription * @param options The options parameters. */ get( - options?: BillingPropertyGetOptionalParams + options?: BillingPropertyGetOptionalParams, ): Promise; /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation - * is supported only for billing accounts with agreement type Microsoft Customer Agreement. - * @param parameters Request parameters that are provided to the update billing property operation. + * Updates the billing property of a subscription. Currently, cost center can be updated for billing + * accounts with agreement type Microsoft Customer Agreement and subscription service usage address can + * be updated for billing accounts with agreement type Microsoft Online Service Program. + * @param parameters A billing property. * @param options The options parameters. */ update( parameters: BillingProperty, - options?: BillingPropertyUpdateOptionalParams + options?: BillingPropertyUpdateOptionalParams, ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingRequests.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingRequests.ts new file mode 100644 index 000000000000..41fd4199a0f7 --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/billingRequests.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + BillingRequest, + BillingRequestsListByBillingProfileOptionalParams, + BillingRequestsListByCustomerOptionalParams, + BillingRequestsListByInvoiceSectionOptionalParams, + BillingRequestsListByBillingAccountOptionalParams, + BillingRequestsListByUserOptionalParams, + BillingRequestsGetOptionalParams, + BillingRequestsGetResponse, + BillingRequestsCreateOrUpdateOptionalParams, + BillingRequestsCreateOrUpdateResponse, +} from "../models"; + +/// +/** Interface representing a BillingRequests. */ +export interface BillingRequests { + /** + * The list of billing requests submitted for the billing profile. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRequestsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator; + /** + * The list of billing requests submitted for the customer. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRequestsListByCustomerOptionalParams, + ): PagedAsyncIterableIterator; + /** + * The list of billing requests submitted for the invoice section. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRequestsListByInvoiceSectionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * The list of billing requests submitted for the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: BillingRequestsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * The list of billing requests submitted by a user. + * @param options The options parameters. + */ + listByUser( + options?: BillingRequestsListByUserOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a billing request by its ID. + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param options The options parameters. + */ + get( + billingRequestName: string, + options?: BillingRequestsGetOptionalParams, + ): Promise; + /** + * Create or update a billing request. + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param parameters A request submitted by a user to manage billing. Users with an owner role on the + * scope can approve or decline these requests. + * @param options The options parameters. + */ + beginCreateOrUpdate( + billingRequestName: string, + parameters: BillingRequest, + options?: BillingRequestsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRequestsCreateOrUpdateResponse + > + >; + /** + * Create or update a billing request. + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param parameters A request submitted by a user to manage billing. Users with an owner role on the + * scope can approve or decline these requests. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + billingRequestName: string, + parameters: BillingRequest, + options?: BillingRequestsCreateOrUpdateOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleAssignments.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleAssignments.ts index a65e406dab05..64f6d201fb2c 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleAssignments.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleAssignments.ts @@ -7,37 +7,86 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { BillingRoleAssignment, - BillingRoleAssignmentsListByBillingAccountOptionalParams, - BillingRoleAssignmentsListByInvoiceSectionOptionalParams, BillingRoleAssignmentsListByBillingProfileOptionalParams, - BillingRoleAssignmentsGetByBillingAccountOptionalParams, - BillingRoleAssignmentsGetByBillingAccountResponse, - BillingRoleAssignmentsDeleteByBillingAccountOptionalParams, - BillingRoleAssignmentsDeleteByBillingAccountResponse, - BillingRoleAssignmentsGetByInvoiceSectionOptionalParams, - BillingRoleAssignmentsGetByInvoiceSectionResponse, - BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams, - BillingRoleAssignmentsDeleteByInvoiceSectionResponse, + BillingRoleAssignmentsListByCustomerOptionalParams, + BillingRoleAssignmentsListByInvoiceSectionOptionalParams, + BillingRoleAssignmentsListByBillingAccountOptionalParams, + BillingRoleAssignmentsListByDepartmentOptionalParams, + BillingRoleAssignmentsListByEnrollmentAccountOptionalParams, + BillingRoleAssignmentsDeleteByBillingProfileOptionalParams, BillingRoleAssignmentsGetByBillingProfileOptionalParams, BillingRoleAssignmentsGetByBillingProfileResponse, - BillingRoleAssignmentsDeleteByBillingProfileOptionalParams, - BillingRoleAssignmentsDeleteByBillingProfileResponse + BillingRoleAssignmentProperties, + BillingRoleAssignmentsCreateByBillingProfileOptionalParams, + BillingRoleAssignmentsCreateByBillingProfileResponse, + BillingRoleAssignmentsDeleteByCustomerOptionalParams, + BillingRoleAssignmentsGetByCustomerOptionalParams, + BillingRoleAssignmentsGetByCustomerResponse, + BillingRoleAssignmentsCreateByCustomerOptionalParams, + BillingRoleAssignmentsCreateByCustomerResponse, + BillingRoleAssignmentsResolveByCustomerOptionalParams, + BillingRoleAssignmentsResolveByCustomerResponse, + BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams, + BillingRoleAssignmentsGetByInvoiceSectionOptionalParams, + BillingRoleAssignmentsGetByInvoiceSectionResponse, + BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams, + BillingRoleAssignmentsCreateByInvoiceSectionResponse, + BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams, + BillingRoleAssignmentsResolveByInvoiceSectionResponse, + BillingRoleAssignmentsResolveByBillingProfileOptionalParams, + BillingRoleAssignmentsResolveByBillingProfileResponse, + BillingRoleAssignmentsDeleteByBillingAccountOptionalParams, + BillingRoleAssignmentsGetByBillingAccountOptionalParams, + BillingRoleAssignmentsGetByBillingAccountResponse, + BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams, + BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse, + BillingRoleAssignmentsCreateByBillingAccountOptionalParams, + BillingRoleAssignmentsCreateByBillingAccountResponse, + BillingRoleAssignmentsDeleteByDepartmentOptionalParams, + BillingRoleAssignmentsGetByDepartmentOptionalParams, + BillingRoleAssignmentsGetByDepartmentResponse, + BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams, + BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse, + BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams, + BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams, + BillingRoleAssignmentsGetByEnrollmentAccountResponse, + BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams, + BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse, + BillingRoleAssignmentsResolveByBillingAccountOptionalParams, + BillingRoleAssignmentsResolveByBillingAccountResponse, } from "../models"; /// /** Interface representing a BillingRoleAssignments. */ export interface BillingRoleAssignments { /** - * Lists the role assignments for the caller on a billing account. The operation is supported for + * Lists the role assignments for the caller on a billing profile. The operation is supported for * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - listByBillingAccount( + listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleAssignmentsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the role assignments for the caller on customer. The operation is supported for billing + * accounts with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + listByCustomer( billingAccountName: string, - options?: BillingRoleAssignmentsListByBillingAccountOptionalParams + billingProfileName: string, + customerName: string, + options?: BillingRoleAssignmentsListByCustomerOptionalParams, ): PagedAsyncIterableIterator; /** * Lists the role assignments for the caller on an invoice section. The operation is supported for @@ -51,44 +100,224 @@ export interface BillingRoleAssignments { billingAccountName: string, billingProfileName: string, invoiceSectionName: string, - options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams + options?: BillingRoleAssignmentsListByInvoiceSectionOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. + * Lists the role assignments for the caller on a billing account. The operation is supported for + * billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or + * Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: BillingRoleAssignmentsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the role assignments for the caller on a department. The operation is supported for billing + * accounts of type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + listByDepartment( + billingAccountName: string, + departmentName: string, + options?: BillingRoleAssignmentsListByDepartmentOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the role assignments for the caller on a enrollment account. The operation is supported for + * billing accounts of type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + listByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingRoleAssignmentsListByEnrollmentAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Deletes a role assignment on a billing profile. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param options The options parameters. */ - listByBillingProfile( + deleteByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: BillingRoleAssignmentsListByBillingProfileOptionalParams - ): PagedAsyncIterableIterator; + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsDeleteByBillingProfileOptionalParams, + ): Promise; /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing + * Gets a role assignment for the caller on a billing profile. The operation is supported for billing * accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param options The options parameters. */ - getByBillingAccount( + getByBillingProfile( billingAccountName: string, + billingProfileName: string, billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsGetByBillingAccountOptionalParams - ): Promise; + options?: BillingRoleAssignmentsGetByBillingProfileOptionalParams, + ): Promise; /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Adds a role assignment on a billing profile. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateByBillingProfile( + billingAccountName: string, + billingProfileName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByBillingProfileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateByBillingProfileResponse + > + >; + /** + * Adds a role assignment on a billing profile. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateByBillingProfileAndWait( + billingAccountName: string, + billingProfileName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByBillingProfileOptionalParams, + ): Promise; + /** + * Deletes a role assignment on a customer. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param options The options parameters. */ - deleteByBillingAccount( + deleteByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsDeleteByCustomerOptionalParams, + ): Promise; + /** + * Gets a role assignment for the caller on a customer. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + getByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsGetByCustomerOptionalParams, + ): Promise; + /** + * Adds a role assignment on a customer. The operation is supported for billing accounts with agreement + * type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByCustomerOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateByCustomerResponse + > + >; + /** + * Adds a role assignment on a customer. The operation is supported for billing accounts with agreement + * type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateByCustomerAndWait( + billingAccountName: string, + billingProfileName: string, + customerName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByCustomerOptionalParams, + ): Promise; + /** + * Lists the role assignments for the caller on a customer while fetching user info for each role + * assignment. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + beginResolveByCustomer( billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleAssignmentsResolveByCustomerOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsResolveByCustomerResponse + > + >; + /** + * Lists the role assignments for the caller on a customer while fetching user info for each role + * assignment. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + beginResolveByCustomerAndWait( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleAssignmentsResolveByCustomerOptionalParams, + ): Promise; + /** + * Deletes a role assignment on an invoice section. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + deleteByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsDeleteByBillingAccountOptionalParams - ): Promise; + options?: BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams, + ): Promise; /** * Gets a role assignment for the caller on an invoice section. The operation is supported for billing * accounts with agreement type Microsoft Customer Agreement. @@ -103,50 +332,353 @@ export interface BillingRoleAssignments { billingProfileName: string, invoiceSectionName: string, billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsGetByInvoiceSectionOptionalParams + options?: BillingRoleAssignmentsGetByInvoiceSectionOptionalParams, ): Promise; /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. + * Adds a role assignment on an invoice section. The operation is supported for billing accounts with + * agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. * @param options The options parameters. */ - deleteByInvoiceSection( + beginCreateByInvoiceSection( billingAccountName: string, billingProfileName: string, invoiceSectionName: string, - billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsDeleteByInvoiceSectionOptionalParams - ): Promise; + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateByInvoiceSectionResponse + > + >; /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing - * accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Adds a role assignment on an invoice section. The operation is supported for billing accounts with + * agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param parameters The properties of the billing role assignment. * @param options The options parameters. */ - getByBillingProfile( + beginCreateByInvoiceSectionAndWait( billingAccountName: string, billingProfileName: string, - billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsGetByBillingProfileOptionalParams - ): Promise; + invoiceSectionName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByInvoiceSectionOptionalParams, + ): Promise; /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Lists the role assignments for the caller on an invoice section while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - deleteByBillingProfile( + beginResolveByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsResolveByInvoiceSectionResponse + > + >; + /** + * Lists the role assignments for the caller on an invoice section while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + beginResolveByInvoiceSectionAndWait( billingAccountName: string, billingProfileName: string, + invoiceSectionName: string, + options?: BillingRoleAssignmentsResolveByInvoiceSectionOptionalParams, + ): Promise; + /** + * Lists the role assignments for the caller on an billing profile while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + beginResolveByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleAssignmentsResolveByBillingProfileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsResolveByBillingProfileResponse + > + >; + /** + * Lists the role assignments for the caller on an billing profile while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + beginResolveByBillingProfileAndWait( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleAssignmentsResolveByBillingProfileOptionalParams, + ): Promise; + /** + * Deletes a role assignment on a billing account. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + deleteByBillingAccount( + billingAccountName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsDeleteByBillingAccountOptionalParams, + ): Promise; + /** + * Gets a role assignment for the caller on a billing account. The operation is supported for billing + * accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsGetByBillingAccountOptionalParams, + ): Promise; + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateOrUpdateByBillingAccount( + billingAccountName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateOrUpdateByBillingAccountResponse + > + >; + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByBillingAccountOptionalParams, + ): Promise; + /** + * Adds a role assignment on a billing account. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateByBillingAccount( + billingAccountName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateByBillingAccountResponse + > + >; + /** + * Adds a role assignment on a billing account. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateByBillingAccountAndWait( + billingAccountName: string, + parameters: BillingRoleAssignmentProperties, + options?: BillingRoleAssignmentsCreateByBillingAccountOptionalParams, + ): Promise; + /** + * Deletes a role assignment on a department. The operation is supported only for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + deleteByDepartment( + billingAccountName: string, + departmentName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsDeleteByDepartmentOptionalParams, + ): Promise; + /** + * Gets a role assignment for the caller on a department. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + getByDepartment( + billingAccountName: string, + departmentName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsGetByDepartmentOptionalParams, + ): Promise; + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateOrUpdateByDepartment( + billingAccountName: string, + departmentName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateOrUpdateByDepartmentResponse + > + >; + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateOrUpdateByDepartmentAndWait( + billingAccountName: string, + departmentName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByDepartmentOptionalParams, + ): Promise; + /** + * Deletes a role assignment on a enrollment Account. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + deleteByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsDeleteByEnrollmentAccountOptionalParams, + ): Promise; + /** + * Gets a role assignment for the caller on a enrollment Account. The operation is supported only for + * billing accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param options The options parameters. + */ + getByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + billingRoleAssignmentName: string, + options?: BillingRoleAssignmentsGetByEnrollmentAccountOptionalParams, + ): Promise; + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateOrUpdateByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, billingRoleAssignmentName: string, - options?: BillingRoleAssignmentsDeleteByBillingProfileOptionalParams - ): Promise; + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountResponse + > + >; + /** + * Create or update a billing role assignment. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param parameters The properties of the billing role assignment. + * @param options The options parameters. + */ + beginCreateOrUpdateByEnrollmentAccountAndWait( + billingAccountName: string, + enrollmentAccountName: string, + billingRoleAssignmentName: string, + parameters: BillingRoleAssignment, + options?: BillingRoleAssignmentsCreateOrUpdateByEnrollmentAccountOptionalParams, + ): Promise; + /** + * Lists the role assignments for the caller on a billing account while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + beginResolveByBillingAccount( + billingAccountName: string, + options?: BillingRoleAssignmentsResolveByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingRoleAssignmentsResolveByBillingAccountResponse + > + >; + /** + * Lists the role assignments for the caller on a billing account while fetching user info for each + * role assignment. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + beginResolveByBillingAccountAndWait( + billingAccountName: string, + options?: BillingRoleAssignmentsResolveByBillingAccountOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleDefinitionOperations.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleDefinitionOperations.ts new file mode 100644 index 000000000000..c5f73157885e --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleDefinitionOperations.ts @@ -0,0 +1,198 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + BillingRoleDefinition, + BillingRoleDefinitionListByBillingProfileOptionalParams, + BillingRoleDefinitionListByCustomerOptionalParams, + BillingRoleDefinitionListByInvoiceSectionOptionalParams, + BillingRoleDefinitionListByBillingAccountOptionalParams, + BillingRoleDefinitionListByDepartmentOptionalParams, + BillingRoleDefinitionListByEnrollmentAccountOptionalParams, + BillingRoleDefinitionGetByBillingProfileOptionalParams, + BillingRoleDefinitionGetByBillingProfileResponse, + BillingRoleDefinitionGetByCustomerOptionalParams, + BillingRoleDefinitionGetByCustomerResponse, + BillingRoleDefinitionGetByInvoiceSectionOptionalParams, + BillingRoleDefinitionGetByInvoiceSectionResponse, + BillingRoleDefinitionGetByBillingAccountOptionalParams, + BillingRoleDefinitionGetByBillingAccountResponse, + BillingRoleDefinitionGetByDepartmentOptionalParams, + BillingRoleDefinitionGetByDepartmentResponse, + BillingRoleDefinitionGetByEnrollmentAccountOptionalParams, + BillingRoleDefinitionGetByEnrollmentAccountResponse, +} from "../models"; + +/// +/** Interface representing a BillingRoleDefinitionOperations. */ +export interface BillingRoleDefinitionOperations { + /** + * Lists the role definitions for a billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingRoleDefinitionListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the role definitions for a customer. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: BillingRoleDefinitionListByCustomerOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the role definitions for an invoice section. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingRoleDefinitionListByInvoiceSectionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the role definitions for a billing account. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: BillingRoleDefinitionListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List the definition for a department. The operation is supported for billing accounts with agreement + * type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + listByDepartment( + billingAccountName: string, + departmentName: string, + options?: BillingRoleDefinitionListByDepartmentOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List the definition for an enrollment account. The operation is supported for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + listByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingRoleDefinitionListByEnrollmentAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets the definition for a role on a billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByBillingProfile( + billingAccountName: string, + billingProfileName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByBillingProfileOptionalParams, + ): Promise; + /** + * Gets the definition for a role on a customer. The operation is supported only for billing accounts + * with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByCustomerOptionalParams, + ): Promise; + /** + * Gets the definition for a role on an invoice section. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByInvoiceSectionOptionalParams, + ): Promise; + /** + * Gets the definition for a role on a billing account. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise + * Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByBillingAccountOptionalParams, + ): Promise; + /** + * Gets the definition for a role on a department. The operation is supported for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByDepartment( + billingAccountName: string, + departmentName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByDepartmentOptionalParams, + ): Promise; + /** + * Gets the definition for a role on an enrollment account. The operation is supported for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param roleDefinitionName The ID that uniquely identifies a role definition. + * @param options The options parameters. + */ + getByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + roleDefinitionName: string, + options?: BillingRoleDefinitionGetByEnrollmentAccountOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleDefinitions.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleDefinitions.ts deleted file mode 100644 index a9fa89f58a02..000000000000 --- a/sdk/billing/arm-billing/src/operationsInterfaces/billingRoleDefinitions.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - BillingRoleDefinition, - BillingRoleDefinitionsListByBillingAccountOptionalParams, - BillingRoleDefinitionsListByInvoiceSectionOptionalParams, - BillingRoleDefinitionsListByBillingProfileOptionalParams, - BillingRoleDefinitionsGetByBillingAccountOptionalParams, - BillingRoleDefinitionsGetByBillingAccountResponse, - BillingRoleDefinitionsGetByInvoiceSectionOptionalParams, - BillingRoleDefinitionsGetByInvoiceSectionResponse, - BillingRoleDefinitionsGetByBillingProfileOptionalParams, - BillingRoleDefinitionsGetByBillingProfileResponse -} from "../models"; - -/// -/** Interface representing a BillingRoleDefinitions. */ -export interface BillingRoleDefinitions { - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param options The options parameters. - */ - listByBillingAccount( - billingAccountName: string, - options?: BillingRoleDefinitionsListByBillingAccountOptionalParams - ): PagedAsyncIterableIterator; - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param options The options parameters. - */ - listByInvoiceSection( - billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: BillingRoleDefinitionsListByInvoiceSectionOptionalParams - ): PagedAsyncIterableIterator; - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param options The options parameters. - */ - listByBillingProfile( - billingAccountName: string, - billingProfileName: string, - options?: BillingRoleDefinitionsListByBillingProfileOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param options The options parameters. - */ - getByBillingAccount( - billingAccountName: string, - billingRoleDefinitionName: string, - options?: BillingRoleDefinitionsGetByBillingAccountOptionalParams - ): Promise; - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param options The options parameters. - */ - getByInvoiceSection( - billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - billingRoleDefinitionName: string, - options?: BillingRoleDefinitionsGetByInvoiceSectionOptionalParams - ): Promise; - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param options The options parameters. - */ - getByBillingProfile( - billingAccountName: string, - billingProfileName: string, - billingRoleDefinitionName: string, - options?: BillingRoleDefinitionsGetByBillingProfileOptionalParams - ): Promise; -} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingSubscriptions.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingSubscriptions.ts index db9556f0ac3e..2c5f301ad034 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/billingSubscriptions.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/billingSubscriptions.ts @@ -7,138 +7,346 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { BillingSubscription, - BillingSubscriptionsListByCustomerOptionalParams, - BillingSubscriptionsListByBillingAccountOptionalParams, BillingSubscriptionsListByBillingProfileOptionalParams, + BillingSubscriptionsListByCustomerOptionalParams, BillingSubscriptionsListByInvoiceSectionOptionalParams, + BillingSubscriptionsListByBillingAccountOptionalParams, + BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams, + BillingSubscriptionsListByEnrollmentAccountOptionalParams, + BillingSubscriptionsGetByBillingProfileOptionalParams, + BillingSubscriptionsGetByBillingProfileResponse, + CancelSubscriptionRequest, + BillingSubscriptionsCancelOptionalParams, + BillingSubscriptionsCancelResponse, + BillingSubscriptionMergeRequest, + BillingSubscriptionsMergeOptionalParams, + BillingSubscriptionsMergeResponse, + MoveBillingSubscriptionRequest, + BillingSubscriptionsMoveOptionalParams, + BillingSubscriptionsMoveResponse, + BillingSubscriptionSplitRequest, + BillingSubscriptionsSplitOptionalParams, + BillingSubscriptionsSplitResponse, + BillingSubscriptionsValidateMoveEligibilityOptionalParams, + BillingSubscriptionsValidateMoveEligibilityResponse, + BillingSubscriptionsDeleteOptionalParams, + BillingSubscriptionsDeleteResponse, BillingSubscriptionsGetOptionalParams, BillingSubscriptionsGetResponse, + BillingSubscriptionPatch, BillingSubscriptionsUpdateOptionalParams, BillingSubscriptionsUpdateResponse, - TransferBillingSubscriptionRequestProperties, - BillingSubscriptionsMoveOptionalParams, - BillingSubscriptionsMoveResponse, - BillingSubscriptionsValidateMoveOptionalParams, - BillingSubscriptionsValidateMoveResponse } from "../models"; /// /** Interface representing a BillingSubscriptions. */ export interface BillingSubscriptions { + /** + * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing + * accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: BillingSubscriptionsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator; /** * Lists the subscriptions for a customer. The operation is supported only for billing accounts with * agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ listByCustomer( billingAccountName: string, + billingProfileName: string, customerName: string, - options?: BillingSubscriptionsListByCustomerOptionalParams + options?: BillingSubscriptionsListByCustomerOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * Lists the subscriptions that are billed to an invoice section. The operation is supported only for + * billing accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: BillingSubscriptionsListByInvoiceSectionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the subscriptions for a billing account. * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ listByBillingAccount( billingAccountName: string, - options?: BillingSubscriptionsListByBillingAccountOptionalParams + options?: BillingSubscriptionsListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing - * accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. + * Lists the subscriptions for a customer at billing account level. The operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - listByBillingProfile( + listByCustomerAtBillingAccount( billingAccountName: string, - billingProfileName: string, - options?: BillingSubscriptionsListByBillingProfileOptionalParams + customerName: string, + options?: BillingSubscriptionsListByCustomerAtBillingAccountOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. + * Lists the subscriptions for an enrollment account. The operation is supported for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + listByEnrollmentAccount( + billingAccountName: string, + enrollmentAccountName: string, + options?: BillingSubscriptionsListByEnrollmentAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a subscription by its billing profile and ID. The operation is supported for billing accounts + * with agreement type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. * @param options The options parameters. */ - listByInvoiceSection( + getByBillingProfile( billingAccountName: string, billingProfileName: string, - invoiceSectionName: string, - options?: BillingSubscriptionsListByInvoiceSectionOptionalParams - ): PagedAsyncIterableIterator; + billingSubscriptionName: string, + options?: BillingSubscriptionsGetByBillingProfileOptionalParams, + ): Promise; /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement and Microsoft Partner Agreement. + * Cancels a usage-based subscription. This operation is supported only for billing accounts of type + * Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters for cancel customer subscription. * @param options The options parameters. */ - get( + beginCancel( billingAccountName: string, - options?: BillingSubscriptionsGetOptionalParams - ): Promise; + billingSubscriptionName: string, + parameters: CancelSubscriptionRequest, + options?: BillingSubscriptionsCancelOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsCancelResponse + > + >; /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Cancels a usage-based subscription. This operation is supported only for billing accounts of type + * Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters for cancel customer subscription. * @param options The options parameters. */ - update( + beginCancelAndWait( billingAccountName: string, - parameters: BillingSubscription, - options?: BillingSubscriptionsUpdateOptionalParams - ): Promise; + billingSubscriptionName: string, + parameters: CancelSubscriptionRequest, + options?: BillingSubscriptionsCancelOptionalParams, + ): Promise; /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the - * same billing profile as the existing invoice section. This operation is supported for billing + * Merges the billing subscription provided in the request with a target billing subscription. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters that are provided to merge the two billing subscriptions. + * @param options The options parameters. + */ + beginMerge( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionMergeRequest, + options?: BillingSubscriptionsMergeOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsMergeResponse + > + >; + /** + * Merges the billing subscription provided in the request with a target billing subscription. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters that are provided to merge the two billing subscriptions. + * @param options The options parameters. + */ + beginMergeAndWait( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionMergeRequest, + options?: BillingSubscriptionsMergeOptionalParams, + ): Promise; + /** + * Moves charges for a subscription to a new invoice section. The new invoice section must belong to + * the same billing profile as the existing invoice section. This operation is supported for billing * accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters to transfer billing subscription. * @param options The options parameters. */ beginMove( billingAccountName: string, - parameters: TransferBillingSubscriptionRequestProperties, - options?: BillingSubscriptionsMoveOptionalParams + billingSubscriptionName: string, + parameters: MoveBillingSubscriptionRequest, + options?: BillingSubscriptionsMoveOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, BillingSubscriptionsMoveResponse > >; /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the - * same billing profile as the existing invoice section. This operation is supported for billing + * Moves charges for a subscription to a new invoice section. The new invoice section must belong to + * the same billing profile as the existing invoice section. This operation is supported for billing * accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters to transfer billing subscription. * @param options The options parameters. */ beginMoveAndWait( billingAccountName: string, - parameters: TransferBillingSubscriptionRequestProperties, - options?: BillingSubscriptionsMoveOptionalParams + billingSubscriptionName: string, + parameters: MoveBillingSubscriptionRequest, + options?: BillingSubscriptionsMoveOptionalParams, ): Promise; /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is + * Splits a subscription into a new subscription with quantity less than current subscription quantity + * and not equal to 0. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters that are provided to split the billing subscription. + * @param options The options parameters. + */ + beginSplit( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionSplitRequest, + options?: BillingSubscriptionsSplitOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsSplitResponse + > + >; + /** + * Splits a subscription into a new subscription with quantity less than current subscription quantity + * and not equal to 0. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters that are provided to split the billing subscription. + * @param options The options parameters. + */ + beginSplitAndWait( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionSplitRequest, + options?: BillingSubscriptionsSplitOptionalParams, + ): Promise; + /** + * Validates if charges for a subscription can be moved to a new invoice section. This operation is * supported for billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters Request parameters to transfer billing subscription. + * @param options The options parameters. + */ + validateMoveEligibility( + billingAccountName: string, + billingSubscriptionName: string, + parameters: MoveBillingSubscriptionRequest, + options?: BillingSubscriptionsValidateMoveEligibilityOptionalParams, + ): Promise; + /** + * Cancels a billing subscription. This operation is supported only for billing accounts of type + * Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. * @param options The options parameters. */ - validateMove( + beginDelete( billingAccountName: string, - parameters: TransferBillingSubscriptionRequestProperties, - options?: BillingSubscriptionsValidateMoveOptionalParams - ): Promise; + billingSubscriptionName: string, + options?: BillingSubscriptionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsDeleteResponse + > + >; + /** + * Cancels a billing subscription. This operation is supported only for billing accounts of type + * Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param options The options parameters. + */ + beginDeleteAndWait( + billingAccountName: string, + billingSubscriptionName: string, + options?: BillingSubscriptionsDeleteOptionalParams, + ): Promise; + /** + * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement, Microsoft Partner Agreement, and Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param options The options parameters. + */ + get( + billingAccountName: string, + billingSubscriptionName: string, + options?: BillingSubscriptionsGetOptionalParams, + ): Promise; + /** + * Updates the properties of a billing subscription. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters The billing properties of a subscription. + * @param options The options parameters. + */ + beginUpdate( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionPatch, + options?: BillingSubscriptionsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsUpdateResponse + > + >; + /** + * Updates the properties of a billing subscription. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingSubscriptionName The ID that uniquely identifies a subscription. + * @param parameters The billing properties of a subscription. + * @param options The options parameters. + */ + beginUpdateAndWait( + billingAccountName: string, + billingSubscriptionName: string, + parameters: BillingSubscriptionPatch, + options?: BillingSubscriptionsUpdateOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/billingSubscriptionsAliases.ts b/sdk/billing/arm-billing/src/operationsInterfaces/billingSubscriptionsAliases.ts new file mode 100644 index 000000000000..ef1f20cf7587 --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/billingSubscriptionsAliases.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + BillingSubscriptionAlias, + BillingSubscriptionsAliasesListByBillingAccountOptionalParams, + BillingSubscriptionsAliasesGetOptionalParams, + BillingSubscriptionsAliasesGetResponse, + BillingSubscriptionsAliasesCreateOrUpdateOptionalParams, + BillingSubscriptionsAliasesCreateOrUpdateResponse, +} from "../models"; + +/// +/** Interface representing a BillingSubscriptionsAliases. */ +export interface BillingSubscriptionsAliases { + /** + * Lists the subscription aliases for a billing account. The operation is supported for seat based + * billing subscriptions. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: BillingSubscriptionsAliasesListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a subscription by its alias ID. The operation is supported for seat based billing + * subscriptions. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param aliasName The ID that uniquely identifies a subscription alias. + * @param options The options parameters. + */ + get( + billingAccountName: string, + aliasName: string, + options?: BillingSubscriptionsAliasesGetOptionalParams, + ): Promise; + /** + * Creates or updates a billing subscription by its alias ID. The operation is supported for seat + * based billing subscriptions. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param aliasName The ID that uniquely identifies a subscription alias. + * @param parameters A billing subscription alias. + * @param options The options parameters. + */ + beginCreateOrUpdate( + billingAccountName: string, + aliasName: string, + parameters: BillingSubscriptionAlias, + options?: BillingSubscriptionsAliasesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + BillingSubscriptionsAliasesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a billing subscription by its alias ID. The operation is supported for seat + * based billing subscriptions. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param aliasName The ID that uniquely identifies a subscription alias. + * @param parameters A billing subscription alias. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + billingAccountName: string, + aliasName: string, + parameters: BillingSubscriptionAlias, + options?: BillingSubscriptionsAliasesCreateOrUpdateOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/customers.ts b/sdk/billing/arm-billing/src/operationsInterfaces/customers.ts index 2cebc54ccd49..b3df692c20b7 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/customers.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/customers.ts @@ -12,7 +12,9 @@ import { CustomersListByBillingProfileOptionalParams, CustomersListByBillingAccountOptionalParams, CustomersGetOptionalParams, - CustomersGetResponse + CustomersGetResponse, + CustomersGetByBillingAccountOptionalParams, + CustomersGetByBillingAccountResponse, } from "../models"; /// @@ -28,7 +30,7 @@ export interface Customers { listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: CustomersListByBillingProfileOptionalParams + options?: CustomersListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator; /** * Lists the customers that are billed to a billing account. The operation is supported only for @@ -38,18 +40,32 @@ export interface Customers { */ listByBillingAccount( billingAccountName: string, - options?: CustomersListByBillingAccountOptionalParams + options?: CustomersListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type * Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ get( billingAccountName: string, + billingProfileName: string, customerName: string, - options?: CustomersGetOptionalParams + options?: CustomersGetOptionalParams, ): Promise; + /** + * Gets a customer by its ID at billing account level. The operation is supported only for billing + * accounts with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + customerName: string, + options?: CustomersGetByBillingAccountOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/departments.ts b/sdk/billing/arm-billing/src/operationsInterfaces/departments.ts new file mode 100644 index 000000000000..25b2d4b0321a --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/departments.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Department, + DepartmentsListByBillingAccountOptionalParams, + DepartmentsGetOptionalParams, + DepartmentsGetResponse, +} from "../models"; + +/// +/** Interface representing a Departments. */ +export interface Departments { + /** + * Lists the departments that a user has access to. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: DepartmentsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a department by ID. The operation is supported only for billing accounts with agreement type + * Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param options The options parameters. + */ + get( + billingAccountName: string, + departmentName: string, + options?: DepartmentsGetOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/enrollmentAccounts.ts b/sdk/billing/arm-billing/src/operationsInterfaces/enrollmentAccounts.ts index 0a01922a1bb0..87f9ef35ad81 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/enrollmentAccounts.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/enrollmentAccounts.ts @@ -8,29 +8,64 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { - EnrollmentAccountSummary, - EnrollmentAccountsListOptionalParams, + EnrollmentAccount, + EnrollmentAccountsListByDepartmentOptionalParams, + EnrollmentAccountsListByBillingAccountOptionalParams, + EnrollmentAccountsGetByDepartmentOptionalParams, + EnrollmentAccountsGetByDepartmentResponse, EnrollmentAccountsGetOptionalParams, - EnrollmentAccountsGetResponse + EnrollmentAccountsGetResponse, } from "../models"; /// /** Interface representing a EnrollmentAccounts. */ export interface EnrollmentAccounts { /** - * Lists the enrollment accounts the caller has access to. + * Lists the enrollment accounts for a department. The operation is supported only for billing accounts + * with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. * @param options The options parameters. */ - list( - options?: EnrollmentAccountsListOptionalParams - ): PagedAsyncIterableIterator; + listByDepartment( + billingAccountName: string, + departmentName: string, + options?: EnrollmentAccountsListByDepartmentOptionalParams, + ): PagedAsyncIterableIterator; /** - * Gets a enrollment account by name. - * @param name Enrollment Account name. + * Lists the enrollment accounts for a billing account. The operation is supported only for billing + * accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: EnrollmentAccountsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets an enrollment account by department. The operation is supported only for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param departmentName The name of the department. + * @param enrollmentAccountName The name of the enrollment account. + * @param options The options parameters. + */ + getByDepartment( + billingAccountName: string, + departmentName: string, + enrollmentAccountName: string, + options?: EnrollmentAccountsGetByDepartmentOptionalParams, + ): Promise; + /** + * Gets an enrollment account by ID. The operation is supported only for billing accounts with + * agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param enrollmentAccountName The name of the enrollment account. * @param options The options parameters. */ get( - name: string, - options?: EnrollmentAccountsGetOptionalParams + billingAccountName: string, + enrollmentAccountName: string, + options?: EnrollmentAccountsGetOptionalParams, ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/index.ts b/sdk/billing/arm-billing/src/operationsInterfaces/index.ts index 44525347c3ce..658119e77c6f 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/index.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/index.ts @@ -6,24 +6,33 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./agreements"; +export * from "./associatedTenants"; +export * from "./availableBalances"; export * from "./billingAccounts"; export * from "./address"; -export * from "./availableBalances"; -export * from "./instructions"; -export * from "./billingProfiles"; -export * from "./customers"; -export * from "./invoiceSections"; export * from "./billingPermissions"; +export * from "./billingProfiles"; +export * from "./billingPropertyOperations"; +export * from "./billingRequests"; +export * from "./billingRoleAssignments"; +export * from "./billingRoleDefinitionOperations"; +export * from "./savingsPlanOrders"; +export * from "./savingsPlans"; export * from "./billingSubscriptions"; -export * from "./products"; +export * from "./billingSubscriptionsAliases"; +export * from "./customers"; +export * from "./departments"; +export * from "./enrollmentAccounts"; export * from "./invoices"; -export * from "./transactions"; -export * from "./policies"; -export * from "./billingPropertyOperations"; +export * from "./invoiceSections"; export * from "./operations"; -export * from "./billingRoleDefinitions"; -export * from "./billingRoleAssignments"; -export * from "./agreements"; +export * from "./paymentMethods"; +export * from "./policies"; +export * from "./products"; export * from "./reservations"; -export * from "./enrollmentAccounts"; -export * from "./billingPeriods"; +export * from "./reservationOrders"; +export * from "./transactions"; +export * from "./transfers"; +export * from "./partnerTransfers"; +export * from "./recipientTransfers"; diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/instructions.ts b/sdk/billing/arm-billing/src/operationsInterfaces/instructions.ts deleted file mode 100644 index 22e1d2486029..000000000000 --- a/sdk/billing/arm-billing/src/operationsInterfaces/instructions.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - Instruction, - InstructionsListByBillingProfileOptionalParams, - InstructionsGetOptionalParams, - InstructionsGetResponse, - InstructionsPutOptionalParams, - InstructionsPutResponse -} from "../models"; - -/// -/** Interface representing a Instructions. */ -export interface Instructions { - /** - * Lists the instructions by billing profile id. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param options The options parameters. - */ - listByBillingProfile( - billingAccountName: string, - billingProfileName: string, - options?: InstructionsListByBillingProfileOptionalParams - ): PagedAsyncIterableIterator; - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for - * certain customers. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param options The options parameters. - */ - get( - billingAccountName: string, - billingProfileName: string, - instructionName: string, - options?: InstructionsGetOptionalParams - ): Promise; - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for - * certain customers. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @param options The options parameters. - */ - put( - billingAccountName: string, - billingProfileName: string, - instructionName: string, - parameters: Instruction, - options?: InstructionsPutOptionalParams - ): Promise; -} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/invoiceSections.ts b/sdk/billing/arm-billing/src/operationsInterfaces/invoiceSections.ts index 99ee83a06d19..74cffc96ce9f 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/invoiceSections.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/invoiceSections.ts @@ -7,14 +7,18 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { InvoiceSection, InvoiceSectionsListByBillingProfileOptionalParams, + InvoiceSectionsValidateDeleteEligibilityOptionalParams, + InvoiceSectionsValidateDeleteEligibilityResponse, + InvoiceSectionsDeleteOptionalParams, + InvoiceSectionsDeleteResponse, InvoiceSectionsGetOptionalParams, InvoiceSectionsGetResponse, InvoiceSectionsCreateOrUpdateOptionalParams, - InvoiceSectionsCreateOrUpdateResponse + InvoiceSectionsCreateOrUpdateResponse, } from "../models"; /// @@ -30,8 +34,55 @@ export interface InvoiceSections { listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: InvoiceSectionsListByBillingProfileOptionalParams + options?: InvoiceSectionsListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator; + /** + * Validates if the invoice section can be deleted. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + validateDeleteEligibility( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: InvoiceSectionsValidateDeleteEligibilityOptionalParams, + ): Promise; + /** + * Deletes an invoice section. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + beginDelete( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: InvoiceSectionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + InvoiceSectionsDeleteResponse + > + >; + /** + * Deletes an invoice section. The operation is supported for billing accounts with agreement type + * Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + beginDeleteAndWait( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: InvoiceSectionsDeleteOptionalParams, + ): Promise; /** * Gets an invoice section by its ID. The operation is supported only for billing accounts with * agreement type Microsoft Customer Agreement. @@ -44,7 +95,7 @@ export interface InvoiceSections { billingAccountName: string, billingProfileName: string, invoiceSectionName: string, - options?: InvoiceSectionsGetOptionalParams + options?: InvoiceSectionsGetOptionalParams, ): Promise; /** * Creates or updates an invoice section. The operation is supported only for billing accounts with @@ -52,7 +103,7 @@ export interface InvoiceSections { * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. + * @param parameters An invoice section. * @param options The options parameters. */ beginCreateOrUpdate( @@ -60,10 +111,10 @@ export interface InvoiceSections { billingProfileName: string, invoiceSectionName: string, parameters: InvoiceSection, - options?: InvoiceSectionsCreateOrUpdateOptionalParams + options?: InvoiceSectionsCreateOrUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, InvoiceSectionsCreateOrUpdateResponse > >; @@ -73,7 +124,7 @@ export interface InvoiceSections { * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. + * @param parameters An invoice section. * @param options The options parameters. */ beginCreateOrUpdateAndWait( @@ -81,6 +132,6 @@ export interface InvoiceSections { billingProfileName: string, invoiceSectionName: string, parameters: InvoiceSection, - options?: InvoiceSectionsCreateOrUpdateOptionalParams + options?: InvoiceSectionsCreateOrUpdateOptionalParams, ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/invoices.ts b/sdk/billing/arm-billing/src/operationsInterfaces/invoices.ts index 8aa605da3de5..df38c0fb9334 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/invoices.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/invoices.ts @@ -7,227 +7,267 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Invoice, - InvoicesListByBillingAccountOptionalParams, InvoicesListByBillingProfileOptionalParams, + InvoicesListByBillingAccountOptionalParams, InvoicesListByBillingSubscriptionOptionalParams, + DocumentDownloadRequest, + InvoicesDownloadDocumentsByBillingAccountOptionalParams, + InvoicesDownloadDocumentsByBillingAccountResponse, + InvoicesAmendOptionalParams, + InvoicesAmendResponse, + InvoicesDownloadByBillingAccountOptionalParams, + InvoicesDownloadByBillingAccountResponse, + InvoicesDownloadSummaryByBillingAccountOptionalParams, + InvoicesDownloadSummaryByBillingAccountResponse, + InvoicesGetByBillingAccountOptionalParams, + InvoicesGetByBillingAccountResponse, + InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams, + InvoicesDownloadDocumentsByBillingSubscriptionResponse, + InvoicesDownloadByBillingSubscriptionOptionalParams, + InvoicesDownloadByBillingSubscriptionResponse, + InvoicesGetByBillingSubscriptionOptionalParams, + InvoicesGetByBillingSubscriptionResponse, InvoicesGetOptionalParams, InvoicesGetResponse, - InvoicesGetByIdOptionalParams, - InvoicesGetByIdResponse, - InvoicesDownloadInvoiceOptionalParams, - InvoicesDownloadInvoiceResponse, - InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams, - InvoicesDownloadMultipleBillingProfileInvoicesResponse, - InvoicesGetBySubscriptionAndInvoiceIdOptionalParams, - InvoicesGetBySubscriptionAndInvoiceIdResponse, - InvoicesDownloadBillingSubscriptionInvoiceOptionalParams, - InvoicesDownloadBillingSubscriptionInvoiceResponse, - InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams, - InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse } from "../models"; /// /** Interface representing a Invoices. */ export interface Invoices { /** - * Lists the invoices for a billing account for a given start date and end date. The operation is + * Lists the invoices for a billing profile for a given start date and end date. The operation is * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer * Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in - * MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY - * format. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param options The options parameters. */ - listByBillingAccount( + listByBillingProfile( billingAccountName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingAccountOptionalParams + billingProfileName: string, + options?: InvoicesListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is - * supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. + * Lists the invoices for a billing account for a given start date and end date. The operation is + * supported for all billing account types. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in - * MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY - * format. * @param options The options parameters. */ - listByBillingProfile( + listByBillingAccount( billingAccountName: string, - billingProfileName: string, - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingProfileOptionalParams + options?: InvoicesListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists the invoices for a subscription. - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. + * Lists the invoices for a subscription. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param options The options parameters. */ listByBillingSubscription( - periodStartDate: string, - periodEndDate: string, - options?: InvoicesListByBillingSubscriptionOptionalParams + options?: InvoicesListByBillingSubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip + * file. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters A list of download details for individual documents. + * @param options The options parameters. + */ + beginDownloadDocumentsByBillingAccount( + billingAccountName: string, + parameters: DocumentDownloadRequest[], + options?: InvoicesDownloadDocumentsByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + InvoicesDownloadDocumentsByBillingAccountResponse + > + >; + /** + * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip + * file. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters A list of download details for individual documents. + * @param options The options parameters. + */ + beginDownloadDocumentsByBillingAccountAndWait( + billingAccountName: string, + parameters: DocumentDownloadRequest[], + options?: InvoicesDownloadDocumentsByBillingAccountOptionalParams, + ): Promise; + /** + * Regenerate an invoice by billing account name and invoice name. The operation is supported for + * billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - get( + beginAmend( billingAccountName: string, invoiceName: string, - options?: InvoicesGetOptionalParams - ): Promise; + options?: InvoicesAmendOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + InvoicesAmendResponse + > + >; /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. + * Regenerate an invoice by billing account name and invoice name. The operation is supported for + * billing accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - getById( + beginAmendAndWait( + billingAccountName: string, invoiceName: string, - options?: InvoicesGetByIdOptionalParams - ): Promise; + options?: InvoicesAmendOptionalParams, + ): Promise; /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Gets a URL to download an invoice document. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. * @param options The options parameters. */ - beginDownloadInvoice( + beginDownloadByBillingAccount( billingAccountName: string, invoiceName: string, - downloadToken: string, - options?: InvoicesDownloadInvoiceOptionalParams + options?: InvoicesDownloadByBillingAccountOptionalParams, ): Promise< - PollerLike< - PollOperationState, - InvoicesDownloadInvoiceResponse + SimplePollerLike< + OperationState, + InvoicesDownloadByBillingAccountResponse > >; /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. + * Gets a URL to download an invoice document. The operation is supported for billing accounts with + * agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. * @param options The options parameters. */ - beginDownloadInvoiceAndWait( + beginDownloadByBillingAccountAndWait( billingAccountName: string, invoiceName: string, - downloadToken: string, - options?: InvoicesDownloadInvoiceOptionalParams - ): Promise; + options?: InvoicesDownloadByBillingAccountOptionalParams, + ): Promise; /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip - * file. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. + * Gets a URL to download the summary document for an invoice. The operation is supported for billing + * accounts with agreement type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - beginDownloadMultipleBillingProfileInvoices( + beginDownloadSummaryByBillingAccount( billingAccountName: string, - downloadUrls: string[], - options?: InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams + invoiceName: string, + options?: InvoicesDownloadSummaryByBillingAccountOptionalParams, ): Promise< - PollerLike< - PollOperationState< - InvoicesDownloadMultipleBillingProfileInvoicesResponse - >, - InvoicesDownloadMultipleBillingProfileInvoicesResponse + SimplePollerLike< + OperationState, + InvoicesDownloadSummaryByBillingAccountResponse > >; /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip - * file. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. + * Gets a URL to download the summary document for an invoice. The operation is supported for billing + * accounts with agreement type Enterprise Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - beginDownloadMultipleBillingProfileInvoicesAndWait( + beginDownloadSummaryByBillingAccountAndWait( billingAccountName: string, - downloadUrls: string[], - options?: InvoicesDownloadMultipleBillingProfileInvoicesOptionalParams - ): Promise; + invoiceName: string, + options?: InvoicesDownloadSummaryByBillingAccountOptionalParams, + ): Promise; /** - * Gets an invoice by subscription ID and invoice ID. + * Gets an invoice by billing account name and ID. The operation is supported for all billing account + * types. + * @param billingAccountName The ID that uniquely identifies a billing account. * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - getBySubscriptionAndInvoiceId( + getByBillingAccount( + billingAccountName: string, invoiceName: string, - options?: InvoicesGetBySubscriptionAndInvoiceIdOptionalParams - ): Promise; + options?: InvoicesGetByBillingAccountOptionalParams, + ): Promise; /** - * Gets a URL to download an invoice. + * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip + * file. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. + * @param parameters A list of download details for individual documents. + * @param options The options parameters. + */ + beginDownloadDocumentsByBillingSubscription( + parameters: DocumentDownloadRequest[], + options?: InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + InvoicesDownloadDocumentsByBillingSubscriptionResponse + > + >; + /** + * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip + * file. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. + * @param parameters A list of download details for individual documents. + * @param options The options parameters. + */ + beginDownloadDocumentsByBillingSubscriptionAndWait( + parameters: DocumentDownloadRequest[], + options?: InvoicesDownloadDocumentsByBillingSubscriptionOptionalParams, + ): Promise; + /** + * Gets a URL to download an invoice by billing subscription. The operation is supported for billing + * accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. * @param options The options parameters. */ - beginDownloadBillingSubscriptionInvoice( + beginDownloadByBillingSubscription( invoiceName: string, - downloadToken: string, - options?: InvoicesDownloadBillingSubscriptionInvoiceOptionalParams + options?: InvoicesDownloadByBillingSubscriptionOptionalParams, ): Promise< - PollerLike< - PollOperationState, - InvoicesDownloadBillingSubscriptionInvoiceResponse + SimplePollerLike< + OperationState, + InvoicesDownloadByBillingSubscriptionResponse > >; /** - * Gets a URL to download an invoice. + * Gets a URL to download an invoice by billing subscription. The operation is supported for billing + * accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. * @param options The options parameters. */ - beginDownloadBillingSubscriptionInvoiceAndWait( + beginDownloadByBillingSubscriptionAndWait( invoiceName: string, - downloadToken: string, - options?: InvoicesDownloadBillingSubscriptionInvoiceOptionalParams - ): Promise; + options?: InvoicesDownloadByBillingSubscriptionOptionalParams, + ): Promise; /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip - * file. - * @param downloadUrls An array of download urls for individual documents + * Gets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts + * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - beginDownloadMultipleBillingSubscriptionInvoices( - downloadUrls: string[], - options?: InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams - ): Promise< - PollerLike< - PollOperationState< - InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse - >, - InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse - > - >; + getByBillingSubscription( + invoiceName: string, + options?: InvoicesGetByBillingSubscriptionOptionalParams, + ): Promise; /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip - * file. - * @param downloadUrls An array of download urls for individual documents + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft + * Partner Agreement or Microsoft Customer Agreement. + * @param invoiceName The ID that uniquely identifies an invoice. * @param options The options parameters. */ - beginDownloadMultipleBillingSubscriptionInvoicesAndWait( - downloadUrls: string[], - options?: InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalParams - ): Promise; + get( + invoiceName: string, + options?: InvoicesGetOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/operations.ts b/sdk/billing/arm-billing/src/operationsInterfaces/operations.ts index da85e93ba937..ff9d59da1139 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/operations.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/operations.ts @@ -13,10 +13,10 @@ import { Operation, OperationsListOptionalParams } from "../models"; /** Interface representing a Operations. */ export interface Operations { /** - * Lists the available billing REST API operations. + * List of operations supported by provider. * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/partnerTransfers.ts b/sdk/billing/arm-billing/src/operationsInterfaces/partnerTransfers.ts new file mode 100644 index 000000000000..1d937fe3888e --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/partnerTransfers.ts @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PartnerTransferDetails, + PartnerTransfersListOptionalParams, + PartnerTransfersGetOptionalParams, + PartnerTransfersGetResponse, + PartnerInitiateTransferRequest, + PartnerTransfersInitiateOptionalParams, + PartnerTransfersInitiateResponse, + PartnerTransfersCancelOptionalParams, + PartnerTransfersCancelResponse, +} from "../models"; + +/// +/** Interface representing a PartnerTransfers. */ +export interface PartnerTransfers { + /** + * Lists the transfer requests sent to a customer. The operation is supported only for billing accounts + * with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param options The options parameters. + */ + list( + billingAccountName: string, + billingProfileName: string, + customerName: string, + options?: PartnerTransfersListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a transfer request by ID. The operation is supported only for billing accounts with agreement + * type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + get( + billingAccountName: string, + billingProfileName: string, + customerName: string, + transferName: string, + options?: PartnerTransfersGetOptionalParams, + ): Promise; + /** + * Sends a request to a user in a customer's billing account to transfer billing ownership of their + * subscriptions. The operation is supported only for billing accounts with agreement type Microsoft + * Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param transferName The ID that uniquely identifies a transfer request. + * @param parameters Request parameters that are provided to the initiate transfer operation. + * @param options The options parameters. + */ + initiate( + billingAccountName: string, + billingProfileName: string, + customerName: string, + transferName: string, + parameters: PartnerInitiateTransferRequest, + options?: PartnerTransfersInitiateOptionalParams, + ): Promise; + /** + * Cancels a transfer request. The operation is supported only for billing accounts with agreement type + * Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + cancel( + billingAccountName: string, + billingProfileName: string, + customerName: string, + transferName: string, + options?: PartnerTransfersCancelOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/paymentMethods.ts b/sdk/billing/arm-billing/src/operationsInterfaces/paymentMethods.ts new file mode 100644 index 000000000000..74adb18c6633 --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/paymentMethods.ts @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PaymentMethodLink, + PaymentMethodsListByBillingProfileOptionalParams, + PaymentMethod, + PaymentMethodsListByBillingAccountOptionalParams, + PaymentMethodsListByUserOptionalParams, + PaymentMethodsGetByBillingProfileOptionalParams, + PaymentMethodsGetByBillingProfileResponse, + PaymentMethodsGetByBillingAccountOptionalParams, + PaymentMethodsGetByBillingAccountResponse, + PaymentMethodsDeleteByUserOptionalParams, + PaymentMethodsGetByUserOptionalParams, + PaymentMethodsGetByUserResponse, +} from "../models"; + +/// +/** Interface representing a PaymentMethods. */ +export interface PaymentMethods { + /** + * Lists payment methods attached to a billing profile. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + options?: PaymentMethodsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the payment methods available for a billing account. Along with the payment methods owned by + * the caller, these payment methods can be attached to a billing profile to make payments. The + * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: PaymentMethodsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the payment methods owned by the caller. + * @param options The options parameters. + */ + listByUser( + options?: PaymentMethodsListByUserOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a payment method linked with a billing profile. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param options The options parameters. + */ + getByBillingProfile( + billingAccountName: string, + billingProfileName: string, + paymentMethodName: string, + options?: PaymentMethodsGetByBillingProfileOptionalParams, + ): Promise; + /** + * Gets a payment method available for a billing account. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + paymentMethodName: string, + options?: PaymentMethodsGetByBillingAccountOptionalParams, + ): Promise; + /** + * Deletes a payment method owned by the caller. + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param options The options parameters. + */ + deleteByUser( + paymentMethodName: string, + options?: PaymentMethodsDeleteByUserOptionalParams, + ): Promise; + /** + * Gets a payment method owned by the caller. + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param options The options parameters. + */ + getByUser( + paymentMethodName: string, + options?: PaymentMethodsGetByUserOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/policies.ts b/sdk/billing/arm-billing/src/operationsInterfaces/policies.ts index 7f557a197a19..df5933b8b7cc 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/policies.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/policies.ts @@ -6,21 +6,88 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { - PoliciesGetByBillingProfileOptionalParams, - PoliciesGetByBillingProfileResponse, - Policy, - PoliciesUpdateOptionalParams, - PoliciesUpdateResponse, + ServiceDefinedResourceName, PoliciesGetByCustomerOptionalParams, PoliciesGetByCustomerResponse, CustomerPolicy, - PoliciesUpdateCustomerOptionalParams, - PoliciesUpdateCustomerResponse + PoliciesCreateOrUpdateByCustomerOptionalParams, + PoliciesCreateOrUpdateByCustomerResponse, + PoliciesGetByBillingProfileOptionalParams, + PoliciesGetByBillingProfileResponse, + BillingProfilePolicy, + PoliciesCreateOrUpdateByBillingProfileOptionalParams, + PoliciesCreateOrUpdateByBillingProfileResponse, + PoliciesGetByCustomerAtBillingAccountOptionalParams, + PoliciesGetByCustomerAtBillingAccountResponse, + PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams, + PoliciesCreateOrUpdateByCustomerAtBillingAccountResponse, + PoliciesGetByBillingAccountOptionalParams, + PoliciesGetByBillingAccountResponse, + BillingAccountPolicy, + PoliciesCreateOrUpdateByBillingAccountOptionalParams, + PoliciesCreateOrUpdateByBillingAccountResponse, + PoliciesGetBySubscriptionOptionalParams, + PoliciesGetBySubscriptionResponse, } from "../models"; /** Interface representing a Policies. */ export interface Policies { + /** + * Lists the policies for a customer. This operation is supported only for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param policyName Service-defined resource names such as 'default' which are reserved resource + * names. + * @param options The options parameters. + */ + getByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + policyName: ServiceDefinedResourceName, + options?: PoliciesGetByCustomerOptionalParams, + ): Promise; + /** + * Updates the policies for a customer. This operation is supported only for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters A policy at customer scope. + * @param options The options parameters. + */ + beginCreateOrUpdateByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + parameters: CustomerPolicy, + options?: PoliciesCreateOrUpdateByCustomerOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PoliciesCreateOrUpdateByCustomerResponse + > + >; + /** + * Updates the policies for a customer. This operation is supported only for billing accounts with + * agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters A policy at customer scope. + * @param options The options parameters. + */ + beginCreateOrUpdateByCustomerAndWait( + billingAccountName: string, + billingProfileName: string, + customerName: string, + parameters: CustomerPolicy, + options?: PoliciesCreateOrUpdateByCustomerOptionalParams, + ): Promise; /** * Lists the policies for a billing profile. This operation is supported only for billing accounts with * agreement type Microsoft Customer Agreement. @@ -31,46 +98,129 @@ export interface Policies { getByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: PoliciesGetByBillingProfileOptionalParams + options?: PoliciesGetByBillingProfileOptionalParams, ): Promise; /** * Updates the policies for a billing profile. This operation is supported only for billing accounts * with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. + * @param parameters A policy at billing profile scope. * @param options The options parameters. */ - update( + beginCreateOrUpdateByBillingProfile( billingAccountName: string, billingProfileName: string, - parameters: Policy, - options?: PoliciesUpdateOptionalParams - ): Promise; + parameters: BillingProfilePolicy, + options?: PoliciesCreateOrUpdateByBillingProfileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PoliciesCreateOrUpdateByBillingProfileResponse + > + >; /** - * Lists the policies for a customer. This operation is supported only for billing accounts with - * agreement type Microsoft Partner Agreement. + * Updates the policies for a billing profile. This operation is supported only for billing accounts + * with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param parameters A policy at billing profile scope. + * @param options The options parameters. + */ + beginCreateOrUpdateByBillingProfileAndWait( + billingAccountName: string, + billingProfileName: string, + parameters: BillingProfilePolicy, + options?: PoliciesCreateOrUpdateByBillingProfileOptionalParams, + ): Promise; + /** + * Lists the policies for a customer at billing account scope. This operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - getByCustomer( + getByCustomerAtBillingAccount( billingAccountName: string, customerName: string, - options?: PoliciesGetByCustomerOptionalParams - ): Promise; + options?: PoliciesGetByCustomerAtBillingAccountOptionalParams, + ): Promise; /** - * Updates the policies for a customer. This operation is supported only for billing accounts with - * agreement type Microsoft Partner Agreement. + * Updates the policies for a customer at billing account scope. This operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. + * @param parameters A policy at customer scope. * @param options The options parameters. */ - updateCustomer( + beginCreateOrUpdateByCustomerAtBillingAccount( billingAccountName: string, customerName: string, parameters: CustomerPolicy, - options?: PoliciesUpdateCustomerOptionalParams - ): Promise; + options?: PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PoliciesCreateOrUpdateByCustomerAtBillingAccountResponse + > + >; + /** + * Updates the policies for a customer at billing account scope. This operation is supported only for + * billing accounts with agreement type Microsoft Partner Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param customerName The ID that uniquely identifies a customer. + * @param parameters A policy at customer scope. + * @param options The options parameters. + */ + beginCreateOrUpdateByCustomerAtBillingAccountAndWait( + billingAccountName: string, + customerName: string, + parameters: CustomerPolicy, + options?: PoliciesCreateOrUpdateByCustomerAtBillingAccountOptionalParams, + ): Promise; + /** + * Get the policies for a billing account of Enterprise Agreement type. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + options?: PoliciesGetByBillingAccountOptionalParams, + ): Promise; + /** + * Update the policies for a billing account of Enterprise Agreement type. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters A policy at billing account scope. + * @param options The options parameters. + */ + beginCreateOrUpdateByBillingAccount( + billingAccountName: string, + parameters: BillingAccountPolicy, + options?: PoliciesCreateOrUpdateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + PoliciesCreateOrUpdateByBillingAccountResponse + > + >; + /** + * Update the policies for a billing account of Enterprise Agreement type. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param parameters A policy at billing account scope. + * @param options The options parameters. + */ + beginCreateOrUpdateByBillingAccountAndWait( + billingAccountName: string, + parameters: BillingAccountPolicy, + options?: PoliciesCreateOrUpdateByBillingAccountOptionalParams, + ): Promise; + /** + * Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is + * supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner + * Agreement. + * @param options The options parameters. + */ + getBySubscription( + options?: PoliciesGetBySubscriptionOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/products.ts b/sdk/billing/arm-billing/src/operationsInterfaces/products.ts index adeefa9d26ae..457b88958f60 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/products.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/products.ts @@ -7,48 +7,41 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Product, + ProductsListByInvoiceSectionOptionalParams, + ProductsListByBillingProfileOptionalParams, ProductsListByCustomerOptionalParams, ProductsListByBillingAccountOptionalParams, - ProductsListByBillingProfileOptionalParams, - ProductsListByInvoiceSectionOptionalParams, + MoveProductRequest, + ProductsMoveOptionalParams, + ProductsMoveResponse, + ProductsValidateMoveEligibilityOptionalParams, + ProductsValidateMoveEligibilityResponse, ProductsGetOptionalParams, ProductsGetResponse, + ProductPatch, ProductsUpdateOptionalParams, ProductsUpdateResponse, - TransferProductRequestProperties, - ProductsMoveOptionalParams, - ProductsMoveResponse, - ProductsValidateMoveOptionalParams, - ProductsValidateMoveResponse } from "../models"; /// /** Interface representing a Products. */ export interface Products { /** - * Lists the products for a customer. These don't include products billed based on usage.The operation - * is supported only for billing accounts with agreement type Microsoft Partner Agreement. - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param options The options parameters. - */ - listByCustomer( - billingAccountName: string, - customerName: string, - options?: ProductsListByCustomerOptionalParams - ): PagedAsyncIterableIterator; - /** - * Lists the products for a billing account. These don't include products billed based on usage. The - * operation is supported for billing accounts with agreement type Microsoft Customer Agreement or - * Microsoft Partner Agreement. + * Lists the products for an invoice section. These don't include products billed based on usage. The + * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param options The options parameters. */ - listByBillingAccount( + listByInvoiceSection( billingAccountName: string, - options?: ProductsListByBillingAccountOptionalParams + billingProfileName: string, + invoiceSectionName: string, + options?: ProductsListByInvoiceSectionOptionalParams, ): PagedAsyncIterableIterator; /** * Lists the products for a billing profile. These don't include products billed based on usage. The @@ -61,48 +54,49 @@ export interface Products { listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: ProductsListByBillingProfileOptionalParams + options?: ProductsListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists the products for an invoice section. These don't include products billed based on usage. The - * operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Lists the products for a customer. These don't include products billed based on usage.The operation + * is supported only for billing accounts with agreement type Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param customerName The ID that uniquely identifies a customer. * @param options The options parameters. */ - listByInvoiceSection( + listByCustomer( billingAccountName: string, - billingProfileName: string, - invoiceSectionName: string, - options?: ProductsListByInvoiceSectionOptionalParams + customerName: string, + options?: ProductsListByCustomerOptionalParams, ): PagedAsyncIterableIterator; /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. + * Lists the products for a billing account. These don't include products billed based on usage. The + * operation is supported for billing accounts with agreement type Microsoft Customer Agreement or + * Microsoft Partner Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. * @param options The options parameters. */ - get( + listByBillingAccount( billingAccountName: string, - productName: string, - options?: ProductsGetOptionalParams - ): Promise; + options?: ProductsListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. + * Moves a product's charges to a new invoice section. The new invoice section must belong to the same + * billing profile as the existing invoice section. This operation is supported only for products that + * are purchased with a recurring charge and for billing accounts with agreement type Microsoft + * Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. + * @param parameters The properties of the product to initiate a transfer. * @param options The options parameters. */ - update( + beginMove( billingAccountName: string, productName: string, - parameters: Product, - options?: ProductsUpdateOptionalParams - ): Promise; + parameters: MoveProductRequest, + options?: ProductsMoveOptionalParams, + ): Promise< + SimplePollerLike, ProductsMoveResponse> + >; /** * Moves a product's charges to a new invoice section. The new invoice section must belong to the same * billing profile as the existing invoice section. This operation is supported only for products that @@ -110,14 +104,14 @@ export interface Products { * Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. + * @param parameters The properties of the product to initiate a transfer. * @param options The options parameters. */ - move( + beginMoveAndWait( billingAccountName: string, productName: string, - parameters: TransferProductRequestProperties, - options?: ProductsMoveOptionalParams + parameters: MoveProductRequest, + options?: ProductsMoveOptionalParams, ): Promise; /** * Validates if a product's charges can be moved to a new invoice section. This operation is supported @@ -125,13 +119,39 @@ export interface Products { * type Microsoft Customer Agreement. * @param billingAccountName The ID that uniquely identifies a billing account. * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. + * @param parameters The properties of the product to initiate a transfer. * @param options The options parameters. */ - validateMove( + validateMoveEligibility( billingAccountName: string, productName: string, - parameters: TransferProductRequestProperties, - options?: ProductsValidateMoveOptionalParams - ): Promise; + parameters: MoveProductRequest, + options?: ProductsValidateMoveEligibilityOptionalParams, + ): Promise; + /** + * Gets a product by ID. The operation is supported only for billing accounts with agreement type + * Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param productName The ID that uniquely identifies a product. + * @param options The options parameters. + */ + get( + billingAccountName: string, + productName: string, + options?: ProductsGetOptionalParams, + ): Promise; + /** + * Updates the properties of a Product. Currently, auto renew can be updated. The operation is + * supported only for billing accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param productName The ID that uniquely identifies a product. + * @param parameters A product. + * @param options The options parameters. + */ + update( + billingAccountName: string, + productName: string, + parameters: ProductPatch, + options?: ProductsUpdateOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/recipientTransfers.ts b/sdk/billing/arm-billing/src/operationsInterfaces/recipientTransfers.ts new file mode 100644 index 000000000000..66161cb151cf --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/recipientTransfers.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + RecipientTransferDetails, + RecipientTransfersListOptionalParams, + AcceptTransferRequest, + RecipientTransfersAcceptOptionalParams, + RecipientTransfersAcceptResponse, + RecipientTransfersValidateOptionalParams, + RecipientTransfersValidateResponse, + RecipientTransfersDeclineOptionalParams, + RecipientTransfersDeclineResponse, + RecipientTransfersGetOptionalParams, + RecipientTransfersGetResponse, +} from "../models"; + +/// +/** Interface representing a RecipientTransfers. */ +export interface RecipientTransfers { + /** + * Lists the transfer requests received by the caller. + * @param options The options parameters. + */ + list( + options?: RecipientTransfersListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Accepts a transfer request. + * @param transferName The ID that uniquely identifies a transfer request. + * @param parameters Request parameters that are provided to the accept transfer operation. + * @param options The options parameters. + */ + accept( + transferName: string, + parameters: AcceptTransferRequest, + options?: RecipientTransfersAcceptOptionalParams, + ): Promise; + /** + * Validates if a subscription or a reservation can be transferred. Use this operation to validate your + * subscriptions or reservation before using the accept transfer operation. + * @param transferName The ID that uniquely identifies a transfer request. + * @param parameters Request parameters that are provided to the validate transfer operation. + * @param options The options parameters. + */ + validate( + transferName: string, + parameters: AcceptTransferRequest, + options?: RecipientTransfersValidateOptionalParams, + ): Promise; + /** + * Declines a transfer request. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + decline( + transferName: string, + options?: RecipientTransfersDeclineOptionalParams, + ): Promise; + /** + * Gets a transfer request by ID. The caller must be the recipient of the transfer request. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + get( + transferName: string, + options?: RecipientTransfersGetOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/reservationOrders.ts b/sdk/billing/arm-billing/src/operationsInterfaces/reservationOrders.ts new file mode 100644 index 000000000000..63434f18abda --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/reservationOrders.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ReservationOrder, + ReservationOrdersListByBillingAccountOptionalParams, + ReservationOrdersGetByBillingAccountOptionalParams, + ReservationOrdersGetByBillingAccountResponse, +} from "../models"; + +/// +/** Interface representing a ReservationOrders. */ +export interface ReservationOrders { + /** + * List all the `ReservationOrders in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: ReservationOrdersListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get the details of the ReservationOrder in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + reservationOrderId: string, + options?: ReservationOrdersGetByBillingAccountOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/reservations.ts b/sdk/billing/arm-billing/src/operationsInterfaces/reservations.ts index 4e21822ab8ba..af770f0ad16c 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/reservations.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/reservations.ts @@ -7,24 +7,31 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Reservation, ReservationsListByBillingAccountOptionalParams, - ReservationsListByBillingProfileOptionalParams + ReservationsListByBillingProfileOptionalParams, + ReservationsListByReservationOrderOptionalParams, + ReservationsGetByReservationOrderOptionalParams, + ReservationsGetByReservationOrderResponse, + Patch, + ReservationsUpdateByBillingAccountOptionalParams, + ReservationsUpdateByBillingAccountResponse, } from "../models"; /// /** Interface representing a Reservations. */ export interface Reservations { /** - * Lists the reservations for a billing account and the roll up counts of reservations group by + * Lists the reservations in the billing account and the roll up counts of reservations group by * provisioning states. * @param billingAccountName The ID that uniquely identifies a billing account. * @param options The options parameters. */ listByBillingAccount( billingAccountName: string, - options?: ReservationsListByBillingAccountOptionalParams + options?: ReservationsListByBillingAccountOptionalParams, ): PagedAsyncIterableIterator; /** * Lists the reservations for a billing profile and the roll up counts of reservations group by @@ -36,6 +43,65 @@ export interface Reservations { listByBillingProfile( billingAccountName: string, billingProfileName: string, - options?: ReservationsListByBillingProfileOptionalParams + options?: ReservationsListByBillingProfileOptionalParams, ): PagedAsyncIterableIterator; + /** + * List Reservations within a single ReservationOrder in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param options The options parameters. + */ + listByReservationOrder( + billingAccountName: string, + reservationOrderId: string, + options?: ReservationsListByReservationOrderOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get specific Reservation details in the billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation item + * @param options The options parameters. + */ + getByReservationOrder( + billingAccountName: string, + reservationOrderId: string, + reservationId: string, + options?: ReservationsGetByReservationOrderOptionalParams, + ): Promise; + /** + * Update reservation by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation item + * @param body Request body for patching a reservation + * @param options The options parameters. + */ + beginUpdateByBillingAccount( + billingAccountName: string, + reservationOrderId: string, + reservationId: string, + body: Patch, + options?: ReservationsUpdateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ReservationsUpdateByBillingAccountResponse + > + >; + /** + * Update reservation by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the reservation item + * @param body Request body for patching a reservation + * @param options The options parameters. + */ + beginUpdateByBillingAccountAndWait( + billingAccountName: string, + reservationOrderId: string, + reservationId: string, + body: Patch, + options?: ReservationsUpdateByBillingAccountOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/savingsPlanOrders.ts b/sdk/billing/arm-billing/src/operationsInterfaces/savingsPlanOrders.ts new file mode 100644 index 000000000000..82f06001c843 --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/savingsPlanOrders.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + SavingsPlanOrderModel, + SavingsPlanOrdersListByBillingAccountOptionalParams, + SavingsPlanOrdersGetByBillingAccountOptionalParams, + SavingsPlanOrdersGetByBillingAccountResponse, +} from "../models"; + +/// +/** Interface representing a SavingsPlanOrders. */ +export interface SavingsPlanOrders { + /** + * List all Savings plan orders by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: SavingsPlanOrdersListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a savings plan order by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + savingsPlanOrderId: string, + options?: SavingsPlanOrdersGetByBillingAccountOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/savingsPlans.ts b/sdk/billing/arm-billing/src/operationsInterfaces/savingsPlans.ts new file mode 100644 index 000000000000..5efbbb59e1ce --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/savingsPlans.ts @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + SavingsPlanModel, + SavingsPlansListBySavingsPlanOrderOptionalParams, + SavingsPlansListByBillingAccountOptionalParams, + SavingsPlansGetByBillingAccountOptionalParams, + SavingsPlansGetByBillingAccountResponse, + SavingsPlanUpdateRequest, + SavingsPlansUpdateByBillingAccountOptionalParams, + SavingsPlansUpdateByBillingAccountResponse, + SavingsPlanUpdateValidateRequest, + SavingsPlansValidateUpdateByBillingAccountOptionalParams, + SavingsPlansValidateUpdateByBillingAccountResponse, +} from "../models"; + +/// +/** Interface representing a SavingsPlans. */ +export interface SavingsPlans { + /** + * List savings plans in an order by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param options The options parameters. + */ + listBySavingsPlanOrder( + billingAccountName: string, + savingsPlanOrderId: string, + options?: SavingsPlansListBySavingsPlanOrderOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List savings plans by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param options The options parameters. + */ + listByBillingAccount( + billingAccountName: string, + options?: SavingsPlansListByBillingAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get savings plan by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param savingsPlanId ID of the savings plan + * @param options The options parameters. + */ + getByBillingAccount( + billingAccountName: string, + savingsPlanOrderId: string, + savingsPlanId: string, + options?: SavingsPlansGetByBillingAccountOptionalParams, + ): Promise; + /** + * Update savings plan by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param savingsPlanId ID of the savings plan + * @param body Request body for patching a savings plan order alias + * @param options The options parameters. + */ + beginUpdateByBillingAccount( + billingAccountName: string, + savingsPlanOrderId: string, + savingsPlanId: string, + body: SavingsPlanUpdateRequest, + options?: SavingsPlansUpdateByBillingAccountOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SavingsPlansUpdateByBillingAccountResponse + > + >; + /** + * Update savings plan by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param savingsPlanId ID of the savings plan + * @param body Request body for patching a savings plan order alias + * @param options The options parameters. + */ + beginUpdateByBillingAccountAndWait( + billingAccountName: string, + savingsPlanOrderId: string, + savingsPlanId: string, + body: SavingsPlanUpdateRequest, + options?: SavingsPlansUpdateByBillingAccountOptionalParams, + ): Promise; + /** + * Validate savings plan patch by billing account. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param savingsPlanOrderId Order ID of the savings plan + * @param savingsPlanId ID of the savings plan + * @param body Request body for patching a savings plan order alias + * @param options The options parameters. + */ + validateUpdateByBillingAccount( + billingAccountName: string, + savingsPlanOrderId: string, + savingsPlanId: string, + body: SavingsPlanUpdateValidateRequest, + options?: SavingsPlansValidateUpdateByBillingAccountOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/transactions.ts b/sdk/billing/arm-billing/src/operationsInterfaces/transactions.ts index 3216b9b1647d..944838df17da 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/transactions.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/transactions.ts @@ -7,14 +7,93 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Transaction, - TransactionsListByInvoiceOptionalParams + TransactionType, + TransactionsListByCustomerOptionalParams, + TransactionsListByInvoiceSectionOptionalParams, + TransactionsListByBillingProfileOptionalParams, + TransactionsListByInvoiceOptionalParams, + TransactionsTransactionsDownloadByInvoiceOptionalParams, + TransactionsTransactionsDownloadByInvoiceResponse, + TransactionsGetTransactionSummaryByInvoiceOptionalParams, + TransactionsGetTransactionSummaryByInvoiceResponse, } from "../models"; /// /** Interface representing a Transactions. */ export interface Transactions { + /** + * Lists the billed or unbilled transactions by customer id for given start date and end date. + * Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed + * under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is + * generated. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param customerName The ID that uniquely identifies a customer. + * @param periodStartDate The start date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param periodEndDate The end date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param typeParam The type of transaction. + * @param options The options parameters. + */ + listByCustomer( + billingAccountName: string, + billingProfileName: string, + customerName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByCustomerOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the billed or unbilled transactions by invoice section name for given start date and end date. + * Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed + * under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is + * generated. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param periodStartDate The start date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param periodEndDate The end date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param typeParam The type of transaction. + * @param options The options parameters. + */ + listByInvoiceSection( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByInvoiceSectionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists the billed or unbilled transactions by billing profile name for given start and end date. + * Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed + * under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is + * generated. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param periodStartDate The start date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param periodEndDate The end date to fetch the transactions. The date should be specified in + * MM-DD-YYYY format. + * @param typeParam The type of transaction. + * @param options The options parameters. + */ + listByBillingProfile( + billingAccountName: string, + billingProfileName: string, + periodStartDate: Date, + periodEndDate: Date, + typeParam: TransactionType, + options?: TransactionsListByBillingProfileOptionalParams, + ): PagedAsyncIterableIterator; /** * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage * charges. @@ -25,6 +104,47 @@ export interface Transactions { listByInvoice( billingAccountName: string, invoiceName: string, - options?: TransactionsListByInvoiceOptionalParams + options?: TransactionsListByInvoiceOptionalParams, ): PagedAsyncIterableIterator; + /** + * Gets a URL to download the transactions document for an invoice. The operation is supported for + * billing accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param invoiceName The ID that uniquely identifies an invoice. + * @param options The options parameters. + */ + beginTransactionsDownloadByInvoice( + billingAccountName: string, + invoiceName: string, + options?: TransactionsTransactionsDownloadByInvoiceOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TransactionsTransactionsDownloadByInvoiceResponse + > + >; + /** + * Gets a URL to download the transactions document for an invoice. The operation is supported for + * billing accounts with agreement type Enterprise Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param invoiceName The ID that uniquely identifies an invoice. + * @param options The options parameters. + */ + beginTransactionsDownloadByInvoiceAndWait( + billingAccountName: string, + invoiceName: string, + options?: TransactionsTransactionsDownloadByInvoiceOptionalParams, + ): Promise; + /** + * Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage + * charges. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param invoiceName The ID that uniquely identifies an invoice. + * @param options The options parameters. + */ + getTransactionSummaryByInvoice( + billingAccountName: string, + invoiceName: string, + options?: TransactionsGetTransactionSummaryByInvoiceOptionalParams, + ): Promise; } diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/transfers.ts b/sdk/billing/arm-billing/src/operationsInterfaces/transfers.ts new file mode 100644 index 000000000000..9f1f0cc3d390 --- /dev/null +++ b/sdk/billing/arm-billing/src/operationsInterfaces/transfers.ts @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + TransferDetails, + TransfersListOptionalParams, + TransfersGetOptionalParams, + TransfersGetResponse, + InitiateTransferRequest, + TransfersInitiateOptionalParams, + TransfersInitiateResponse, + TransfersCancelOptionalParams, + TransfersCancelResponse, +} from "../models"; + +/// +/** Interface representing a Transfers. */ +export interface Transfers { + /** + * Lists the transfer requests for an invoice section. The operation is supported only for billing + * accounts with agreement type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param options The options parameters. + */ + list( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + options?: TransfersListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a transfer request by ID. The operation is supported only for billing accounts with agreement + * type Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + get( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + transferName: string, + options?: TransfersGetOptionalParams, + ): Promise; + /** + * Sends a request to a user in another billing account to transfer billing ownership of their + * subscriptions. The operation is supported only for billing accounts with agreement type Microsoft + * Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param transferName The ID that uniquely identifies a transfer request. + * @param parameters Request parameters that are provided to the initiate transfer operation. + * @param options The options parameters. + */ + initiate( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + transferName: string, + parameters: InitiateTransferRequest, + options?: TransfersInitiateOptionalParams, + ): Promise; + /** + * Cancels a transfer request. The operation is supported only for billing accounts with agreement type + * Microsoft Customer Agreement. + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. + * @param transferName The ID that uniquely identifies a transfer request. + * @param options The options parameters. + */ + cancel( + billingAccountName: string, + billingProfileName: string, + invoiceSectionName: string, + transferName: string, + options?: TransfersCancelOptionalParams, + ): Promise; +} diff --git a/sdk/billing/arm-billing/src/pagingHelper.ts b/sdk/billing/arm-billing/src/pagingHelper.ts index d85fc13bce1e..205cccc26592 100644 --- a/sdk/billing/arm-billing/src/pagingHelper.ts +++ b/sdk/billing/arm-billing/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/billing/arm-billing/test/billing_operations_test.spec.ts b/sdk/billing/arm-billing/test/billing_operations_test.spec.ts new file mode 100644 index 000000000000..8eab0d30dd91 --- /dev/null +++ b/sdk/billing/arm-billing/test/billing_operations_test.spec.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + Recorder, + RecorderStartOptions, + delay, + isPlaybackMode, +} from "@azure-tools/test-recorder"; +import { createTestCredential } from "@azure-tools/test-credential"; +import { assert } from "chai"; +import { Context } from "mocha"; +import { BillingManagementClient } from "../src/billingManagementClient"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, + removeCentralSanitizers: [ + "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section + "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section + ], +}; + +export const testPollingOptions = { + updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +}; + +describe("Billing test", () => { + let recorder: Recorder; + let subscriptionId: string; + let client: BillingManagementClient; + let location: string; + let resourceGroup: string; + let resourcename: string; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + subscriptionId = env.SUBSCRIPTION_ID || ''; + // This is an example of how the environment variables are used + const credential = createTestCredential(); + client = new BillingManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); + location = "eastus"; + resourceGroup = "myjstest"; + resourcename = "resourcetest"; + + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("operations list test", async function () { + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + assert.notEqual(resArray.length, 0); + }); + +}) diff --git a/sdk/billing/arm-billing/test/sampleTest.ts b/sdk/billing/arm-billing/test/sampleTest.ts deleted file mode 100644 index 25aeb3ebcc36..000000000000 --- a/sdk/billing/arm-billing/test/sampleTest.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - Recorder, - RecorderStartOptions, - env -} from "@azure-tools/test-recorder"; -import { assert } from "chai"; -import { Context } from "mocha"; - -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(this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - }); - - afterEach(async function() { - await recorder.stop(); - }); - - it("sample test", async function() { - console.log("Hi, I'm a test!"); - }); -});