From 5a63e6ff38dda53814616ab49392734c2b4a8aa3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 16 Mar 2023 23:24:18 +0000 Subject: [PATCH] CodeGen from PR 22538 in Azure/azure-rest-api-specs Merge 70a68ded51458a5a511d12f9fc5bb9e7da4af5e1 into a430111207931ae86c58cf1b6a46fbb46fc0fa7a --- .../CHANGELOG.md | 4 +- .../azure-resourcemanager-billing/README.md | 4 +- .../azure-resourcemanager-billing/SAMPLE.md | 1154 +++++++++----- .../azure-resourcemanager-billing/pom.xml | 10 +- .../billing/BillingManager.java | 299 ++-- .../fluent/AssociatedTenantsClient.java | 206 +++ .../fluent/BillingManagementClient.java | 137 +- .../billing/fluent/BillingPeriodsClient.java | 74 - .../fluent/BillingPermissionsClient.java | 38 +- .../billing/fluent/BillingProfilesClient.java | 33 +- .../fluent/BillingPropertiesClient.java | 14 +- .../billing/fluent/BillingRequestsClient.java | 173 +++ .../fluent/BillingRoleAssignmentsClient.java | 220 +-- .../fluent/BillingRoleDefinitionsClient.java | 158 +- .../fluent/BillingSubscriptionsClient.java | 152 +- .../fluent/EnrollmentAccountsClient.java | 62 - .../billing/fluent/InvoicesClient.java | 243 +-- .../billing/fluent/PaymentMethodsClient.java | 209 +++ .../billing/fluent/ProductsClient.java | 80 +- .../billing/fluent/ReservationsClient.java | 26 +- .../billing/fluent/models/AgreementInner.java | 40 +- .../fluent/models/AgreementProperties.java | 58 +- .../fluent/models/AssociatedTenantInner.java | 155 ++ .../models/AssociatedTenantProperties.java | 56 + .../fluent/models/AvailableBalanceInner.java | 6 +- .../fluent/models/BillingAccountInner.java | 138 +- .../models/BillingAccountProperties.java | 182 +-- .../fluent/models/BillingPeriodInner.java | 72 - .../models/BillingPeriodProperties.java | 71 - ... => BillingProfileAutoGeneratedInner.java} | 240 +-- .../models/BillingProfileProperties.java | 278 ++-- ...BillingProfilePropertiesAutoGenerated.java | 393 +++++ .../fluent/models/BillingPropertyInner.java | 70 +- .../models/BillingPropertyProperties.java | 112 +- .../fluent/models/BillingRequestInner.java | 420 +++++ .../models/BillingRequestProperties.java | 79 + .../models/BillingRoleAssignmentInner.java | 30 +- .../BillingRoleAssignmentProperties.java | 42 +- .../models/BillingRoleDefinitionInner.java | 6 +- .../models/BillingSubscriptionInner.java | 160 +- .../models/BillingSubscriptionProperties.java | 234 +-- .../billing/fluent/models/CustomerInner.java | 22 +- .../fluent/models/CustomerPolicyInner.java | 6 +- .../fluent/models/CustomerProperties.java | 28 +- .../fluent/models/DepartmentProperties.java | 74 +- .../models/EnrollmentAccountProperties.java | 122 +- .../models/EnrollmentAccountSummaryInner.java | 52 - .../EnrollmentAccountSummaryProperties.java | 39 - .../fluent/models/InstructionInner.java | 38 +- .../fluent/models/InstructionProperties.java | 52 +- .../billing/fluent/models/InvoiceInner.java | 200 +-- .../fluent/models/InvoiceProperties.java | 362 ++--- .../fluent/models/InvoiceSectionInner.java | 6 +- ...ceSectionWithCreateSubPermissionInner.java | 114 +- .../billing/fluent/models/OperationInner.java | 48 +- .../fluent/models/PaymentMethodInner.java | 165 ++ .../fluent/models/PaymentMethodLinkInner.java | 69 + .../models/PaymentMethodLinkProperties.java | 54 + .../models/PaymentMethodProperties.java | 188 +++ .../billing/fluent/models/PolicyInner.java | 6 +- .../billing/fluent/models/ProductInner.java | 210 +-- .../fluent/models/ProductProperties.java | 322 ++-- .../fluent/models/ReservationInner.java | 152 +- .../fluent/models/ReservationProperty.java | 154 +- .../fluent/models/TransactionInner.java | 332 ++-- .../fluent/models/TransactionProperties.java | 526 +++---- ...ProductTransferEligibilityResultInner.java | 30 +- ...riptionTransferEligibilityResultInner.java | 30 +- .../billing/fluent/models/package-info.java | 5 +- .../billing/fluent/package-info.java | 5 +- .../implementation/AddressClientImpl.java | 8 +- .../billing/implementation/AgreementImpl.java | 17 +- .../implementation/AgreementsClientImpl.java | 25 +- .../implementation/AssociatedTenantImpl.java | 67 + .../AssociatedTenantsClientImpl.java | 1177 ++++++++++++++ .../implementation/AssociatedTenantsImpl.java | 112 ++ .../implementation/AvailableBalanceImpl.java | 5 + .../AvailableBalancesClientImpl.java | 15 +- .../implementation/BillingAccountImpl.java | 33 +- .../BillingAccountsClientImpl.java | 54 +- .../BillingManagementClientBuilder.java | 23 +- .../BillingManagementClientImpl.java | 302 ++-- .../implementation/BillingPeriodImpl.java | 59 - .../BillingPeriodsClientImpl.java | 520 ------- .../implementation/BillingPeriodsImpl.java | 69 - .../BillingPermissionsClientImpl.java | 300 ++-- .../BillingPermissionsImpl.java | 32 +- ...a => BillingProfileAutoGeneratedImpl.java} | 87 +- .../BillingProfilesClientImpl.java | 139 +- .../implementation/BillingProfilesImpl.java | 48 +- .../BillingPropertiesClientImpl.java | 89 +- .../implementation/BillingPropertiesImpl.java | 18 +- .../implementation/BillingPropertyImpl.java | 37 +- .../implementation/BillingRequestImpl.java | 180 +++ .../BillingRequestsClientImpl.java | 1163 ++++++++++++++ .../implementation/BillingRequestsImpl.java | 110 ++ .../BillingRoleAssignmentImpl.java | 17 +- .../BillingRoleAssignmentsClientImpl.java | 1076 +++++++------ .../BillingRoleAssignmentsImpl.java | 150 +- .../BillingRoleDefinitionImpl.java | 5 + .../BillingRoleDefinitionsClientImpl.java | 886 ++++++----- .../BillingRoleDefinitionsImpl.java | 106 +- .../BillingSubscriptionImpl.java | 57 +- .../BillingSubscriptionsClientImpl.java | 952 ++++++------ .../BillingSubscriptionsImpl.java | 90 +- .../billing/implementation/CustomerImpl.java | 9 +- .../implementation/CustomerPolicyImpl.java | 5 + .../implementation/CustomersClientImpl.java | 40 +- .../EnrollmentAccountSummaryImpl.java | 44 - .../EnrollmentAccountsClientImpl.java | 382 ----- .../EnrollmentAccountsImpl.java | 69 - .../implementation/InstructionImpl.java | 13 +- .../InstructionsClientImpl.java | 32 +- .../billing/implementation/InvoiceImpl.java | 103 +- .../implementation/InvoiceSectionImpl.java | 5 + ...iceSectionWithCreateSubPermissionImpl.java | 32 +- .../InvoiceSectionsClientImpl.java | 32 +- .../implementation/InvoicesClientImpl.java | 1159 +++++++------- .../billing/implementation/InvoicesImpl.java | 113 +- .../billing/implementation/OperationImpl.java | 8 +- .../implementation/OperationsClientImpl.java | 7 +- .../implementation/PaymentMethodImpl.java | 86 ++ .../implementation/PaymentMethodLinkImpl.java | 50 + .../PaymentMethodsClientImpl.java | 1348 +++++++++++++++++ .../implementation/PaymentMethodsImpl.java | 155 ++ .../implementation/PoliciesClientImpl.java | 58 +- .../billing/implementation/PolicyImpl.java | 5 + .../billing/implementation/ProductImpl.java | 89 +- .../implementation/ProductsClientImpl.java | 686 +++++---- .../billing/implementation/ProductsImpl.java | 52 +- .../implementation/ReservationImpl.java | 60 +- .../ReservationsClientImpl.java | 243 ++- .../implementation/ReservationsImpl.java | 22 +- .../implementation/TransactionImpl.java | 129 +- .../TransactionsClientImpl.java | 17 +- ...eProductTransferEligibilityResultImpl.java | 8 +- ...criptionTransferEligibilityResultImpl.java | 8 +- .../billing/implementation/package-info.java | 5 +- .../billing/models/AddressDetails.java | 290 ++-- .../billing/models/Agreement.java | 31 +- .../billing/models/AgreementListResult.java | 28 +- .../billing/models/Amount.java | 6 +- .../billing/models/ArmResource.java | 87 ++ .../billing/models/AssociatedTenant.java | 86 ++ ...t.java => AssociatedTenantListResult.java} | 38 +- ...sociatedTenantPropertiesAutoGenerated.java | 154 ++ .../billing/models/AssociatedTenants.java | 136 ++ .../billing/models/AvailableBalance.java | 13 +- .../billing/models/AzurePlan.java | 28 +- .../billing/models/BillingAccount.java | 61 +- .../models/BillingAccountListResult.java | 28 +- .../models/BillingAccountUpdateRequest.java | 132 +- .../models/BillingManagementTenantState.java | 56 + .../billing/models/BillingPeriod.java | 61 - .../billing/models/BillingPeriods.java | 67 - .../billing/models/BillingPermissions.java | 38 +- .../models/BillingPermissionsListResult.java | 28 +- .../billing/models/BillingProfile.java | 272 +++- .../models/BillingProfileAutoGenerated.java | 174 +++ .../models/BillingProfileListResult.java | 30 +- .../billing/models/BillingProfiles.java | 21 +- .../models/BillingProfilesOnExpand.java | 7 +- .../billing/models/BillingProperties.java | 14 +- .../billing/models/BillingProperty.java | 61 +- .../billing/models/BillingRequest.java | 261 ++++ ...ult.java => BillingRequestListResult.java} | 40 +- ...BillingRequestPropertiesAutoGenerated.java | 559 +++++++ .../billing/models/BillingRequestStatus.java | 62 + .../billing/models/BillingRequestType.java | 56 + .../billing/models/BillingRequests.java | 134 ++ .../billing/models/BillingRoleAssignment.java | 31 +- .../BillingRoleAssignmentListResult.java | 28 +- .../models/BillingRoleAssignments.java | 202 +-- .../billing/models/BillingRoleDefinition.java | 13 +- .../BillingRoleDefinitionListResult.java | 28 +- .../models/BillingRoleDefinitions.java | 144 +- .../billing/models/BillingSubscription.java | 99 +- .../billing/models/BillingSubscriptions.java | 135 +- .../BillingSubscriptionsListResult.java | 28 +- .../billing/models/Customer.java | 19 +- .../billing/models/CustomerListResult.java | 28 +- .../billing/models/CustomerPolicy.java | 13 +- .../billing/models/Department.java | 67 +- .../billing/models/Document.java | 28 +- .../billing/models/Enrollment.java | 128 +- .../billing/models/EnrollmentAccount.java | 103 +- .../models/EnrollmentAccountSummary.java | 45 - .../billing/models/EnrollmentAccounts.java | 55 - .../billing/models/Instruction.java | 25 +- .../billing/models/InstructionListResult.java | 28 +- .../billing/models/Invoice.java | 161 +- .../billing/models/InvoiceListResult.java | 30 +- .../billing/models/InvoiceSection.java | 13 +- .../models/InvoiceSectionListResult.java | 28 +- ...tionListWithCreateSubPermissionResult.java | 30 +- ...InvoiceSectionWithCreateSubPermission.java | 54 +- .../InvoiceSectionsOnExpandAutoGenerated.java | 76 + .../billing/models/Invoices.java | 151 +- .../billing/models/Operation.java | 12 +- .../billing/models/OperationDisplay.java | 56 +- .../billing/models/OperationListResult.java | 28 +- .../billing/models/PaymentMethod.java | 106 ++ .../billing/models/PaymentMethodFamily.java | 3 + .../billing/models/PaymentMethodLink.java | 54 + .../models/PaymentMethodLinksListResult.java | 59 + .../billing/models/PaymentMethodLogo.java | 54 + .../PaymentMethodProjectionProperties.java | 200 +++ .../billing/models/PaymentMethodStatus.java | 50 + .../billing/models/PaymentMethods.java | 191 +++ .../models/PaymentMethodsListResult.java | 59 + .../billing/models/PaymentProperties.java | 30 +- .../billing/models/Policy.java | 13 +- .../billing/models/Product.java | 143 +- .../billing/models/Products.java | 80 +- .../billing/models/ProductsListResult.java | 28 +- .../models/ProvisioningTenantState.java | 65 + .../billing/models/Reseller.java | 28 +- .../billing/models/Reservation.java | 94 +- .../ReservationPropertyUtilization.java | 30 +- .../billing/models/ReservationSummary.java | 56 +- .../billing/models/Reservations.java | 26 +- .../models/ReservationsListResult.java | 36 +- .../billing/models/Transaction.java | 225 +-- .../billing/models/TransactionListResult.java | 28 +- ...lidateProductTransferEligibilityError.java | 44 +- ...idateProductTransferEligibilityResult.java | 12 +- ...eSubscriptionTransferEligibilityError.java | 44 +- ...SubscriptionTransferEligibilityResult.java | 12 +- .../billing/models/package-info.java | 5 +- .../resourcemanager/billing/package-info.java | 5 +- .../generated/AddressValidateSamples.java | 24 +- .../generated/AgreementsGetSamples.java | 6 +- ...AgreementsListByBillingAccountSamples.java | 4 +- ...ssociatedTenantsCreateOrUpdateSamples.java | 26 + .../AssociatedTenantsDeleteSamples.java | 25 + .../AssociatedTenantsGetSamples.java | 26 + ...tedTenantsListByBillingAccountSamples.java | 31 + .../AvailableBalancesGetSamples.java | 6 +- .../generated/BillingAccountsGetSamples.java | 23 +- ...ByCreateSubscriptionPermissionSamples.java | 7 +- .../generated/BillingAccountsListSamples.java | 26 +- .../BillingAccountsUpdateSamples.java | 18 +- .../generated/BillingPeriodsGetSamples.java | 20 - .../generated/BillingPeriodsListSamples.java | 20 - ...ermissionsListByBillingAccountSamples.java | 7 +- ...ermissionsListByBillingProfileSamples.java | 7 +- ...llingPermissionsListByCustomerSamples.java | 6 +- ...rmissionsListByInvoiceSectionsSamples.java | 7 +- .../BillingProfilesCreateOrUpdateSamples.java | 25 +- .../generated/BillingProfilesGetSamples.java | 18 +- ...ngProfilesListByBillingAccountSamples.java | 11 +- .../generated/BillingPropertyGetSamples.java | 8 +- .../BillingPropertyUpdateSamples.java | 11 +- .../BillingRequestsCreateOrUpdateSamples.java | 22 + .../generated/BillingRequestsGetSamples.java | 22 + ...ngRequestsListByBillingAccountSamples.java | 74 + .../BillingRequestsListByUserSamples.java | 35 + ...ignmentsDeleteByBillingAccountSamples.java | 7 +- ...ignmentsDeleteByBillingProfileSamples.java | 7 +- ...ignmentsDeleteByInvoiceSectionSamples.java | 7 +- ...AssignmentsGetByBillingAccountSamples.java | 7 +- ...AssignmentsGetByBillingProfileSamples.java | 7 +- ...AssignmentsGetByInvoiceSectionSamples.java | 7 +- ...ssignmentsListByBillingAccountSamples.java | 7 +- ...ssignmentsListByBillingProfileSamples.java | 7 +- ...ssignmentsListByInvoiceSectionSamples.java | 7 +- ...DefinitionsGetByBillingAccountSamples.java | 7 +- ...DefinitionsGetByBillingProfileSamples.java | 7 +- ...DefinitionsGetByInvoiceSectionSamples.java | 7 +- ...efinitionsListByBillingAccountSamples.java | 7 +- ...efinitionsListByBillingProfileSamples.java | 7 +- ...efinitionsListByInvoiceSectionSamples.java | 7 +- .../BillingSubscriptionsGetSamples.java | 10 +- ...scriptionsListByBillingAccountSamples.java | 4 +- ...scriptionsListByBillingProfileSamples.java | 4 +- ...ingSubscriptionsListByCustomerSamples.java | 4 +- ...scriptionsListByInvoiceSectionSamples.java | 4 +- .../BillingSubscriptionsMoveSamples.java | 7 +- .../BillingSubscriptionsUpdateSamples.java | 7 +- ...llingSubscriptionsValidateMoveSamples.java | 16 +- .../generated/CustomersGetSamples.java | 12 +- .../CustomersListByBillingAccountSamples.java | 4 +- .../CustomersListByBillingProfileSamples.java | 4 +- .../EnrollmentAccountsGetSamples.java | 22 - .../EnrollmentAccountsListSamples.java | 20 - .../generated/InstructionsGetSamples.java | 6 +- ...structionsListByBillingProfileSamples.java | 4 +- .../generated/InstructionsPutSamples.java | 10 +- .../InvoiceSectionsCreateOrUpdateSamples.java | 6 +- .../generated/InvoiceSectionsGetSamples.java | 6 +- ...ceSectionsListByBillingProfileSamples.java | 4 +- ...loadBillingSubscriptionInvoiceSamples.java | 9 +- .../InvoicesDownloadInvoiceSamples.java | 6 +- ...MultipleBillingProfileInvoicesSamples.java | 12 +- ...pleBillingSubscriptionInvoicesSamples.java | 14 +- .../generated/InvoicesGetByIdSamples.java | 6 +- ...sGetBySubscriptionAndInvoiceIdSamples.java | 12 +- .../billing/generated/InvoicesGetSamples.java | 24 +- .../InvoicesListByBillingAccountSamples.java | 12 +- .../InvoicesListByBillingProfileSamples.java | 8 +- ...oicesListByBillingSubscriptionSamples.java | 12 +- .../generated/OperationsListSamples.java | 6 +- .../PaymentMethodsDeleteByUserSamples.java | 20 + ...mentMethodsGetByBillingAccountSamples.java | 25 + ...mentMethodsGetByBillingProfileSamples.java | 26 + .../PaymentMethodsGetByUserSamples.java | 20 + ...entMethodsListByBillingAccountSamples.java | 24 + ...entMethodsListByBillingProfileSamples.java | 25 + .../PaymentMethodsListByUserSamples.java | 20 + .../PoliciesGetByBillingProfileSamples.java | 6 +- .../PoliciesGetByCustomerSamples.java | 6 +- .../PoliciesUpdateCustomerSamples.java | 6 +- .../generated/PoliciesUpdateSamples.java | 6 +- .../billing/generated/ProductsGetSamples.java | 6 +- .../ProductsListByBillingAccountSamples.java | 4 +- .../ProductsListByBillingProfileSamples.java | 4 +- .../ProductsListByCustomerSamples.java | 6 +- .../ProductsListByInvoiceSectionSamples.java | 4 +- .../generated/ProductsMoveSamples.java | 6 +- .../generated/ProductsUpdateSamples.java | 6 +- .../ProductsValidateMoveSamples.java | 12 +- ...servationsListByBillingAccountSamples.java | 4 +- ...servationsListByBillingProfileSamples.java | 4 +- .../TransactionsListByInvoiceSamples.java | 4 +- .../generated/AgreementInnerTests.java | 27 - .../generated/AgreementListResultTests.java | 25 - .../generated/AgreementPropertiesTests.java | 30 - .../AgreementsGetWithResponseMockTests.java | 64 - ...reementsListByBillingAccountMockTests.java | 65 - .../billing/generated/AmountTests.java | 24 - .../generated/AvailableBalanceInnerTests.java | 25 - .../AvailableBalancePropertiesTests.java | 24 - ...lableBalancesGetWithResponseMockTests.java | 64 - .../billing/generated/AzurePlanTests.java | 25 - .../BillingAccountListResultTests.java | 25 - .../generated/BillingPeriodInnerTests.java | 25 - .../BillingPeriodPropertiesTests.java | 24 - ...illingPeriodsGetWithResponseMockTests.java | 64 - .../BillingPeriodsListMockTests.java | 65 - .../BillingPeriodsListResultTests.java | 25 - ...missionsListByBillingAccountMockTests.java | 65 - ...missionsListByBillingProfileMockTests.java | 65 - ...ingPermissionsListByCustomerMockTests.java | 65 - ...issionsListByInvoiceSectionsMockTests.java | 67 - .../BillingPermissionsListResultTests.java | 25 - ...illingPermissionsPropertiesInnerTests.java | 24 - .../generated/BillingProfileInfoTests.java | 36 - .../BillingRoleAssignmentInnerTests.java | 42 - .../BillingRoleAssignmentListResultTests.java | 25 - .../BillingRoleAssignmentPropertiesTests.java | 42 - ...ByBillingAccountWithResponseMockTests.java | 74 - ...ByBillingProfileWithResponseMockTests.java | 75 - ...ByInvoiceSectionWithResponseMockTests.java | 75 - ...ByBillingAccountWithResponseMockTests.java | 74 - ...ByBillingProfileWithResponseMockTests.java | 74 - ...ByInvoiceSectionWithResponseMockTests.java | 74 - ...ignmentsListByBillingAccountMockTests.java | 72 - ...ignmentsListByBillingProfileMockTests.java | 72 - ...ignmentsListByInvoiceSectionMockTests.java | 74 - .../BillingRoleDefinitionInnerTests.java | 34 - .../BillingRoleDefinitionListResultTests.java | 25 - .../BillingRoleDefinitionPropertiesTests.java | 30 - ...ByBillingAccountWithResponseMockTests.java | 67 - ...ByBillingProfileWithResponseMockTests.java | 68 - ...ByInvoiceSectionWithResponseMockTests.java | 68 - ...initionsListByBillingAccountMockTests.java | 65 - ...initionsListByBillingProfileMockTests.java | 67 - ...initionsListByInvoiceSectionMockTests.java | 67 - .../BillingSubscriptionInnerTests.java | 37 - .../BillingSubscriptionPropertiesTests.java | 37 - ...SubscriptionsGetWithResponseMockTests.java | 70 - ...riptionsListByBillingAccountMockTests.java | 73 - ...riptionsListByBillingProfileMockTests.java | 73 - ...gSubscriptionsListByCustomerMockTests.java | 72 - ...riptionsListByInvoiceSectionMockTests.java | 75 - .../BillingSubscriptionsListResultTests.java | 25 - .../BillingSubscriptionsMoveMockTests.java | 77 - ...scriptionsUpdateWithResponseMockTests.java | 80 - .../billing/generated/CustomerInnerTests.java | 37 - .../generated/CustomerListResultTests.java | 25 - .../generated/CustomerPolicyInnerTests.java | 29 - .../CustomerPolicyPropertiesTests.java | 26 - .../generated/CustomerPropertiesTests.java | 37 - .../CustomersGetWithResponseMockTests.java | 70 - ...ustomersListByBillingAccountMockTests.java | 70 - ...ustomersListByBillingProfileMockTests.java | 70 - .../generated/DepartmentPropertiesTests.java | 92 -- .../billing/generated/DepartmentTests.java | 39 - .../billing/generated/DocumentTests.java | 24 - .../generated/DownloadUrlInnerTests.java | 24 - .../EnrollmentAccountListResultTests.java | 25 - .../EnrollmentAccountPropertiesTests.java | 63 - .../EnrollmentAccountSummaryInnerTests.java | 25 - ...rollmentAccountSummaryPropertiesTests.java | 24 - .../generated/EnrollmentAccountTests.java | 51 - ...lmentAccountsGetWithResponseMockTests.java | 64 - .../EnrollmentAccountsListMockTests.java | 65 - .../generated/EnrollmentPoliciesTests.java | 25 - .../IndirectRelationshipInfoTests.java | 36 - .../generated/InstructionInnerTests.java | 40 - .../generated/InstructionListResultTests.java | 25 - .../generated/InstructionPropertiesTests.java | 40 - .../InstructionsGetWithResponseMockTests.java | 73 - ...ructionsListByBillingProfileMockTests.java | 74 - .../InstructionsPutWithResponseMockTests.java | 83 - .../billing/generated/InvoiceInnerTests.java | 25 - .../generated/InvoiceListResultTests.java | 25 - .../generated/InvoicePropertiesTests.java | 25 - .../generated/InvoiceSectionInnerTests.java | 49 - .../InvoiceSectionListResultTests.java | 25 - .../InvoiceSectionPropertiesTests.java | 58 - ...nvoiceSectionsCreateOrUpdateMockTests.java | 111 -- ...voiceSectionsGetWithResponseMockTests.java | 72 - ...SectionsListByBillingProfileMockTests.java | 72 - .../InvoiceSectionsOnExpandTests.java | 60 - ...adBillingSubscriptionInvoiceMockTests.java | 65 - .../InvoicesDownloadInvoiceMockTests.java | 63 - ...ltipleBillingProfileInvoicesMockTests.java | 67 - ...eBillingSubscriptionInvoicesMockTests.java | 67 - .../InvoicesGetByIdWithResponseMockTests.java | 64 - ...tionAndInvoiceIdWithResponseMockTests.java | 67 - .../InvoicesGetWithResponseMockTests.java | 67 - ...InvoicesListByBillingAccountMockTests.java | 68 - ...InvoicesListByBillingProfileMockTests.java | 68 - ...cesListByBillingSubscriptionMockTests.java | 65 - .../generated/OperationDisplayTests.java | 25 - .../generated/OperationInnerTests.java | 26 - .../generated/OperationListResultTests.java | 25 - .../generated/OperationsListMockTests.java | 64 - .../billing/generated/ParticipantsTests.java | 24 - .../generated/PaymentPropertiesTests.java | 29 - ...ByBillingProfileWithResponseMockTests.java | 75 - ...iesGetByCustomerWithResponseMockTests.java | 71 - ...esUpdateCustomerWithResponseMockTests.java | 76 - .../PoliciesUpdateWithResponseMockTests.java | 83 - .../billing/generated/PolicyInnerTests.java | 39 - .../generated/PolicyPropertiesTests.java | 39 - .../billing/generated/ProductInnerTests.java | 39 - .../generated/ProductPropertiesTests.java | 39 - .../ProductsGetWithResponseMockTests.java | 75 - ...ProductsListByBillingAccountMockTests.java | 73 - ...ProductsListByBillingProfileMockTests.java | 73 - .../ProductsListByCustomerMockTests.java | 73 - ...ProductsListByInvoiceSectionMockTests.java | 75 - .../generated/ProductsListResultTests.java | 25 - .../ProductsMoveWithResponseMockTests.java | 80 - .../ProductsUpdateWithResponseMockTests.java | 83 - .../billing/generated/RebillDetailsTests.java | 25 - .../billing/generated/ResellerTests.java | 24 - .../generated/ReservationInnerTests.java | 33 - .../generated/ReservationPropertyTests.java | 30 - .../ReservationPropertyUtilizationTests.java | 28 - .../ReservationSkuPropertyTests.java | 21 - .../generated/ReservationSummaryTests.java | 25 - ...ReservationUtilizationAggregatesTests.java | 24 - ...rvationsListByBillingAccountMockTests.java | 76 - ...rvationsListByBillingProfileMockTests.java | 77 - .../ReservationsListResultTests.java | 26 - .../generated/TransactionInnerTests.java | 36 - .../generated/TransactionListResultTests.java | 26 - .../generated/TransactionPropertiesTests.java | 36 - .../TransactionsListByInvoiceMockTests.java | 71 - ...ingSubscriptionRequestPropertiesTests.java | 28 - ...TransferProductRequestPropertiesTests.java | 28 - 464 files changed, 19775 insertions(+), 17835 deletions(-) create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AssociatedTenantsClient.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPeriodsClient.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRequestsClient.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/EnrollmentAccountsClient.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/PaymentMethodsClient.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AssociatedTenantInner.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AssociatedTenantProperties.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodInner.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodProperties.java rename sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/{BillingProfileInner.java => BillingProfileAutoGeneratedInner.java} (80%) create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfilePropertiesAutoGenerated.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRequestInner.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRequestProperties.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryInner.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryProperties.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodInner.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodLinkInner.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodLinkProperties.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodProperties.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantImpl.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantsClientImpl.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantsImpl.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodImpl.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsClientImpl.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsImpl.java rename sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/{BillingProfileImpl.java => BillingProfileAutoGeneratedImpl.java} (84%) create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestImpl.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestsClientImpl.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestsImpl.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountSummaryImpl.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsClientImpl.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsImpl.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodImpl.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodLinkImpl.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodsClientImpl.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodsImpl.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ArmResource.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenant.java rename sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/{EnrollmentAccountListResult.java => AssociatedTenantListResult.java} (69%) create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenantPropertiesAutoGenerated.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenants.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingManagementTenantState.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriod.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriods.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileAutoGenerated.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequest.java rename sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/{BillingPeriodsListResult.java => BillingRequestListResult.java} (68%) create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestPropertiesAutoGenerated.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestStatus.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestType.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountSummary.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccounts.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsOnExpandAutoGenerated.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethod.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodLink.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodLinksListResult.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodLogo.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodProjectionProperties.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodStatus.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethods.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodsListResult.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProvisioningTenantState.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsCreateOrUpdateSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsDeleteSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsGetSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsListByBillingAccountSamples.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetSamples.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsCreateOrUpdateSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsGetSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsListByBillingAccountSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsListByUserSamples.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetSamples.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsDeleteByUserSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByBillingAccountSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByBillingProfileSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByUserSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByBillingAccountSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByBillingProfileSamples.java create mode 100644 sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByUserSamples.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java diff --git a/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md b/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md index d0e836269e15e..1bdcbe0c5862c 100644 --- a/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md +++ b/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2023-03-16) + +- Azure Resource Manager Billing client library for Java. This package contains Microsoft Azure SDK for Billing Management SDK. Billing Client. Package tag package-2023-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/billing/azure-resourcemanager-billing/README.md b/sdk/billing/azure-resourcemanager-billing/README.md index 61768884439ce..221d120a53e27 100644 --- a/sdk/billing/azure-resourcemanager-billing/README.md +++ b/sdk/billing/azure-resourcemanager-billing/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Billing client library for Java. -This package contains Microsoft Azure SDK for Billing Management SDK. Billing client provides access to billing resources for Azure subscriptions. Package tag package-2020-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Billing Management SDK. Billing Client. Package tag package-2023-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-billing - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/billing/azure-resourcemanager-billing/SAMPLE.md b/sdk/billing/azure-resourcemanager-billing/SAMPLE.md index 5fb5423696ed3..4db6aca4c2e16 100644 --- a/sdk/billing/azure-resourcemanager-billing/SAMPLE.md +++ b/sdk/billing/azure-resourcemanager-billing/SAMPLE.md @@ -10,6 +10,13 @@ - [Get](#agreements_get) - [ListByBillingAccount](#agreements_listbybillingaccount) +## AssociatedTenants + +- [CreateOrUpdate](#associatedtenants_createorupdate) +- [Delete](#associatedtenants_delete) +- [Get](#associatedtenants_get) +- [ListByBillingAccount](#associatedtenants_listbybillingaccount) + ## AvailableBalances - [Get](#availablebalances_get) @@ -21,11 +28,6 @@ - [ListInvoiceSectionsByCreateSubscriptionPermission](#billingaccounts_listinvoicesectionsbycreatesubscriptionpermission) - [Update](#billingaccounts_update) -## BillingPeriods - -- [Get](#billingperiods_get) -- [List](#billingperiods_list) - ## BillingPermissions - [ListByBillingAccount](#billingpermissions_listbybillingaccount) @@ -44,6 +46,13 @@ - [Get](#billingproperty_get) - [Update](#billingproperty_update) +## BillingRequests + +- [CreateOrUpdate](#billingrequests_createorupdate) +- [Get](#billingrequests_get) +- [ListByBillingAccount](#billingrequests_listbybillingaccount) +- [ListByUser](#billingrequests_listbyuser) + ## BillingRoleAssignments - [DeleteByBillingAccount](#billingroleassignments_deletebybillingaccount) @@ -82,11 +91,6 @@ - [ListByBillingAccount](#customers_listbybillingaccount) - [ListByBillingProfile](#customers_listbybillingprofile) -## EnrollmentAccounts - -- [Get](#enrollmentaccounts_get) -- [List](#enrollmentaccounts_list) - ## Instructions - [Get](#instructions_get) @@ -116,6 +120,16 @@ - [List](#operations_list) +## PaymentMethods + +- [DeleteByUser](#paymentmethods_deletebyuser) +- [GetByBillingAccount](#paymentmethods_getbybillingaccount) +- [GetByBillingProfile](#paymentmethods_getbybillingprofile) +- [GetByUser](#paymentmethods_getbyuser) +- [ListByBillingAccount](#paymentmethods_listbybillingaccount) +- [ListByBillingProfile](#paymentmethods_listbybillingprofile) +- [ListByUser](#paymentmethods_listbyuser) + ## Policies - [GetByBillingProfile](#policies_getbybillingprofile) @@ -150,44 +164,44 @@ import com.azure.resourcemanager.billing.models.AddressDetails; /** Samples for Address Validate. */ public final class AddressValidateSamples { /* - * 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/2023-04-01/examples/addressValidateValid.json */ /** - * Sample code: AddressInvalid. + * Sample code: addressValidateValid. * * @param manager Entry point to BillingManager. */ - public static void addressInvalid(com.azure.resourcemanager.billing.BillingManager manager) { + public static void addressValidateValid(com.azure.resourcemanager.billing.BillingManager manager) { manager .address() .validateWithResponse( new AddressDetails() - .withAddressLine1("1 Test") + .withAddressLine1("1 Test Address") .withCity("bellevue") - .withRegion("wa") .withCountry("us") - .withPostalCode("fakeTokenPlaceholder"), + .withPostalCode("fakeTokenPlaceholder") + .withRegion("wa"), com.azure.core.util.Context.NONE); } /* - * 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/2023-04-01/examples/addressValidateInvalid.json */ /** - * Sample code: AddressValid. + * Sample code: addressValidateInvalid. * * @param manager Entry point to BillingManager. */ - public static void addressValid(com.azure.resourcemanager.billing.BillingManager manager) { + public static void addressValidateInvalid(com.azure.resourcemanager.billing.BillingManager manager) { manager .address() .validateWithResponse( new AddressDetails() - .withAddressLine1("1 Test Address") + .withAddressLine1("1 Test") .withCity("bellevue") - .withRegion("wa") .withCountry("us") - .withPostalCode("fakeTokenPlaceholder"), + .withPostalCode("fakeTokenPlaceholder") + .withRegion("wa"), com.azure.core.util.Context.NONE); } } @@ -199,14 +213,14 @@ public final class AddressValidateSamples { /** Samples for Agreements Get. */ public final class AgreementsGetSamples { /* - * 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/2023-04-01/examples/agreementsGet.json */ /** - * Sample code: AgreementByName. + * Sample code: agreementsGet. * * @param manager Entry point to BillingManager. */ - public static void agreementByName(com.azure.resourcemanager.billing.BillingManager manager) { + public static void agreementsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .agreements() .getWithResponse("{billingAccountName}", "{agreementName}", null, com.azure.core.util.Context.NONE); @@ -220,10 +234,10 @@ public final class AgreementsGetSamples { /** Samples for Agreements ListByBillingAccount. */ public final class AgreementsListByBillingAccountSamples { /* - * 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/2023-04-01/examples/agreementsListByBillingAccount.json */ /** - * Sample code: AgreementsListByBillingAccount. + * Sample code: agreementsListByBillingAccount. * * @param manager Entry point to BillingManager. */ @@ -233,20 +247,124 @@ public final class AgreementsListByBillingAccountSamples { } ``` +### AssociatedTenants_CreateOrUpdate + +```java +/** Samples for AssociatedTenants CreateOrUpdate. */ +public final class AssociatedTenantsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/associatedTenantsCreateOrUpdate.json + */ + /** + * Sample code: AssociatedTenantsCreateOrUpdate. + * + * @param manager Entry point to BillingManager. + */ + public static void associatedTenantsCreateOrUpdate(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .associatedTenants() + .createOrUpdate( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "11111111-1111-1111-1111-111111111111", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### AssociatedTenants_Delete + +```java +/** Samples for AssociatedTenants Delete. */ +public final class AssociatedTenantsDeleteSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/associatedTenantsDelete.json + */ + /** + * Sample code: AssociatedTenantsDelete. + * + * @param manager Entry point to BillingManager. + */ + public static void associatedTenantsDelete(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .associatedTenants() + .delete( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "11111111-1111-1111-1111-111111111111", + com.azure.core.util.Context.NONE); + } +} +``` + +### AssociatedTenants_Get + +```java +/** Samples for AssociatedTenants Get. */ +public final class AssociatedTenantsGetSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/associatedTenantsGet.json + */ + /** + * Sample code: AssociatedTenantsGet. + * + * @param manager Entry point to BillingManager. + */ + public static void associatedTenantsGet(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .associatedTenants() + .getWithResponse( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "11111111-1111-1111-1111-111111111111", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### AssociatedTenants_ListByBillingAccount + +```java +/** Samples for AssociatedTenants ListByBillingAccount. */ +public final class AssociatedTenantsListByBillingAccountSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/associatedTenantsListByBillingAccount.json + */ + /** + * Sample code: AssociatedTenantsListByBillingAccount. + * + * @param manager Entry point to BillingManager. + */ + public static void associatedTenantsListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .associatedTenants() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + null, + null, + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + ### AvailableBalances_Get ```java /** Samples for AvailableBalances Get. */ public final class AvailableBalancesGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/availableBalancesGetByBillingProfile.json */ /** - * Sample code: AvailableBalanceByBillingProfile. + * Sample code: availableBalancesGetByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void availableBalanceByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + public static void availableBalancesGetByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { manager .availableBalances() .getWithResponse("{billingAccountName}", "{billingProfileName}", com.azure.core.util.Context.NONE); @@ -260,32 +378,37 @@ public final class AvailableBalancesGetSamples { /** Samples for BillingAccounts Get. */ public final class BillingAccountsGetSamples { /* - * 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/2023-04-01/examples/billingAccountsGet.json */ /** - * Sample code: BillingAccountWithExpand. + * Sample code: billingAccountsGet. * * @param manager Entry point to BillingManager. */ - public static void billingAccountWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingAccountsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingAccounts() .getWithResponse( - "{billingAccountName}", - "soldTo,billingProfiles,billingProfiles/invoiceSections", + "00000000-0000-0000-0000-000000000000:11111111-1111-1111-1111-111111111111_2019-05-31", + null, com.azure.core.util.Context.NONE); } /* - * 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/2023-04-01/examples/billingAccountsGetWithExpand.json */ /** - * Sample code: BillingAccounts. + * Sample code: billingAccountsGetWithExpand. * * @param manager Entry point to BillingManager. */ - public static void billingAccounts(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingAccounts().getWithResponse("{billingAccountName}", null, com.azure.core.util.Context.NONE); + public static void billingAccountsGetWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingAccounts() + .getWithResponse( + "00000000-0000-0000-0000-000000000000:11111111-1111-1111-1111-111111111111_2019-05-31", + "soldTo,billingProfiles,billingProfiles/invoiceSections", + com.azure.core.util.Context.NONE); } } ``` @@ -296,37 +419,37 @@ public final class BillingAccountsGetSamples { /** Samples for BillingAccounts List. */ public final class BillingAccountsListSamples { /* - * 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/2023-04-01/examples/billingAccountsListWithExpandForEnrollmentDetails.json */ /** - * Sample code: BillingAccountsList. + * Sample code: billingAccountsListWithExpandForEnrollmentDetails. * * @param manager Entry point to BillingManager. */ - public static void billingAccountsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingAccounts().list(null, com.azure.core.util.Context.NONE); + public static void billingAccountsListWithExpandForEnrollmentDetails( + com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingAccounts() + .list("enrollmentDetails,departments,enrollmentAccounts", com.azure.core.util.Context.NONE); } /* - * 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/2023-04-01/examples/billingAccountsList.json */ /** - * Sample code: BillingAccountsListWithExpandForEnrollmentDetails. + * Sample code: billingAccountsList. * * @param manager Entry point to BillingManager. */ - public static void billingAccountsListWithExpandForEnrollmentDetails( - com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingAccounts() - .list("enrollmentDetails,departments,enrollmentAccounts", com.azure.core.util.Context.NONE); + public static void billingAccountsList(com.azure.resourcemanager.billing.BillingManager manager) { + manager.billingAccounts().list(null, com.azure.core.util.Context.NONE); } /* - * 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/2023-04-01/examples/billingAccountsListWithExpand.json */ /** - * Sample code: BillingAccountsListWithExpand. + * Sample code: billingAccountsListWithExpand. * * @param manager Entry point to BillingManager. */ @@ -344,10 +467,10 @@ public final class BillingAccountsListSamples { /** Samples for BillingAccounts ListInvoiceSectionsByCreateSubscriptionPermission. */ public final class BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples { /* - * 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/2023-04-01/examples/invoiceSectionsListWithCreateSubPermission.json */ /** - * Sample code: InvoiceSectionsListWithCreateSubPermission. + * Sample code: invoiceSectionsListWithCreateSubPermission. * * @param manager Entry point to BillingManager. */ @@ -356,7 +479,8 @@ public final class BillingAccountsListInvoiceSectionsByCreateSubscriptionPermiss manager .billingAccounts() .listInvoiceSectionsByCreateSubscriptionPermission( - "{billingAccountName}", com.azure.core.util.Context.NONE); + "00000000-0000-0000-0000-000000000000:11111111-1111-1111-1111-111111111111_2019-05-31", + com.azure.core.util.Context.NONE); } } ``` @@ -370,87 +494,50 @@ import com.azure.resourcemanager.billing.models.BillingAccountUpdateRequest; /** Samples for BillingAccounts Update. */ public final class BillingAccountsUpdateSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingAccountsPatch.json */ /** - * Sample code: UpdateBillingAccount. + * Sample code: billingAccountsPatch. * * @param manager Entry point to BillingManager. */ - public static void updateBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingAccountsPatch(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingAccounts() .update( - "{billingAccountName}", + "00000000-0000-0000-0000-000000000000:11111111-1111-1111-1111-111111111111_2019-05-31", new BillingAccountUpdateRequest() .withDisplayName("Test Account") .withSoldTo( new AddressDetails() - .withFirstName("Test") - .withLastName("User") - .withCompanyName("Contoso") .withAddressLine1("Test Address 1") .withCity("Redmond") - .withRegion("WA") + .withCompanyName("Contoso") .withCountry("US") - .withPostalCode("fakeTokenPlaceholder")), + .withFirstName("Test") + .withLastName("User") + .withPostalCode("fakeTokenPlaceholder") + .withRegion("WA")), com.azure.core.util.Context.NONE); } } ``` -### BillingPeriods_Get - -```java -/** Samples for BillingPeriods Get. */ -public final class BillingPeriodsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json - */ - /** - * Sample code: BillingPeriodsGet. - * - * @param manager Entry point to BillingManager. - */ - public static void billingPeriodsGet(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingPeriods().getWithResponse("201702-1", com.azure.core.util.Context.NONE); - } -} -``` - -### BillingPeriods_List - -```java -/** Samples for BillingPeriods List. */ -public final class BillingPeriodsListSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json - */ - /** - * Sample code: BillingPeriodsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingPeriodsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingPeriods().list(null, null, null, com.azure.core.util.Context.NONE); - } -} -``` - ### BillingPermissions_ListByBillingAccount ```java /** Samples for BillingPermissions ListByBillingAccount. */ public final class BillingPermissionsListByBillingAccountSamples { /* - * 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/2023-04-01/examples/billingPermissionsListByBillingAccount.json */ /** - * Sample code: BillingAccountPermissionsList. + * Sample code: billingPermissionsListByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountPermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPermissionsListByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager.billingPermissions().listByBillingAccount("{billingAccountName}", com.azure.core.util.Context.NONE); } } @@ -462,14 +549,15 @@ public final class BillingPermissionsListByBillingAccountSamples { /** Samples for BillingPermissions ListByBillingProfile. */ public final class BillingPermissionsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/billingPermissionsListByBillingProfile.json */ /** - * Sample code: BillingProfilePermissionsList. + * Sample code: billingPermissionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfilePermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPermissionsListByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingPermissions() .listByBillingProfile("{billingAccountName}", "{billingProfileName}", com.azure.core.util.Context.NONE); @@ -483,14 +571,14 @@ public final class BillingPermissionsListByBillingProfileSamples { /** Samples for BillingPermissions ListByCustomer. */ public final class BillingPermissionsListByCustomerSamples { /* - * 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/2023-04-01/examples/billingPermissionsListByCustomer.json */ /** - * Sample code: BillingProfilePermissionsList. + * Sample code: billingPermissionsListByCustomer. * * @param manager Entry point to BillingManager. */ - public static void billingProfilePermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPermissionsListByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingPermissions() .listByCustomer("{billingAccountName}", "{customerName}", com.azure.core.util.Context.NONE); @@ -504,14 +592,15 @@ public final class BillingPermissionsListByCustomerSamples { /** Samples for BillingPermissions ListByInvoiceSections. */ public final class BillingPermissionsListByInvoiceSectionsSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingPermissionsListByInvoiceSection.json */ /** - * Sample code: InvoiceSectionPermissionsList. + * Sample code: billingPermissionsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionPermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPermissionsListByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingPermissions() .listByInvoiceSections( @@ -526,7 +615,7 @@ public final class BillingPermissionsListByInvoiceSectionsSamples { ### BillingProfiles_CreateOrUpdate ```java -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner; import com.azure.resourcemanager.billing.models.AddressDetails; import com.azure.resourcemanager.billing.models.AzurePlan; import java.util.Arrays; @@ -534,34 +623,33 @@ import java.util.Arrays; /** Samples for BillingProfiles CreateOrUpdate. */ public final class BillingProfilesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesPut.json */ /** - * Sample code: CreateBillingProfile. + * Sample code: billingProfilesPut. * * @param manager Entry point to BillingManager. */ - public static void createBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingProfilesPut(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProfiles() .createOrUpdate( "{billingAccountName}", "{billingProfileName}", - new BillingProfileInner() - .withDisplayName("Finance") - .withPoNumber("ABC12345") + new BillingProfileAutoGeneratedInner() .withBillTo( new AddressDetails() - .withFirstName("Test") - .withLastName("User") .withAddressLine1("Test Address 1") .withCity("Redmond") - .withRegion("WA") .withCountry("US") - .withPostalCode("fakeTokenPlaceholder")) + .withFirstName("Test") + .withLastName("User") + .withPostalCode("fakeTokenPlaceholder") + .withRegion("WA")) + .withDisplayName("Finance") + .withEnabledAzurePlans(Arrays.asList(new AzurePlan(), new AzurePlan())) .withInvoiceEmailOptIn(true) - .withEnabledAzurePlans( - Arrays.asList(new AzurePlan().withSkuId("0001"), new AzurePlan().withSkuId("0002"))), + .withPoNumber("ABC12345"), com.azure.core.util.Context.NONE); } } @@ -573,32 +661,32 @@ public final class BillingProfilesCreateOrUpdateSamples { /** Samples for BillingProfiles Get. */ public final class BillingProfilesGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileWithExpand.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesGet.json */ /** - * Sample code: BillingProfileWithExpand. + * Sample code: billingProfilesGet. * * @param manager Entry point to BillingManager. */ - public static void billingProfileWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingProfilesGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProfiles() - .getWithResponse( - "{billingAccountName}", "{billingProfileName}", "invoiceSections", com.azure.core.util.Context.NONE); + .getWithResponse("{billingAccountName}", "{billingProfileName}", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesGetWithExpand.json */ /** - * Sample code: BillingProfile. + * Sample code: billingProfilesGetWithExpand. * * @param manager Entry point to BillingManager. */ - public static void billingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingProfilesGetWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProfiles() - .getWithResponse("{billingAccountName}", "{billingProfileName}", null, com.azure.core.util.Context.NONE); + .getWithResponse( + "{billingAccountName}", "{billingProfileName}", "invoiceSections", com.azure.core.util.Context.NONE); } } ``` @@ -609,24 +697,25 @@ public final class BillingProfilesGetSamples { /** Samples for BillingProfiles ListByBillingAccount. */ public final class BillingProfilesListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListWithExpand.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesListByBillingAccountWithExpand.json */ /** - * Sample code: BillingProfilesListWithExpand. + * Sample code: billingProfilesListByBillingAccountWithExpand. * * @param manager Entry point to BillingManager. */ - public static void billingProfilesListWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingProfilesListByBillingAccountWithExpand( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProfiles() .listByBillingAccount("{billingAccountName}", "invoiceSections", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesListByBillingAccount.json */ /** - * Sample code: BillingProfilesListByBillingAccount. + * Sample code: billingProfilesListByBillingAccount. * * @param manager Entry point to BillingManager. */ @@ -642,15 +731,15 @@ public final class BillingProfilesListByBillingAccountSamples { /** Samples for BillingProperty Get. */ public final class BillingPropertyGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingPropertiesGet.json */ /** - * Sample code: BillingProperty. + * Sample code: billingPropertiesGet. * * @param manager Entry point to BillingManager. */ - public static void billingProperty(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingProperties().getWithResponse(com.azure.core.util.Context.NONE); + public static void billingPropertiesGet(com.azure.resourcemanager.billing.BillingManager manager) { + manager.billingProperties().getWithResponse("{subscriptionId}", com.azure.core.util.Context.NONE); } } ``` @@ -663,17 +752,169 @@ import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; /** Samples for BillingProperty Update. */ public final class BillingPropertyUpdateSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingPropertiesPatch.json */ /** - * Sample code: UpdateBillingProperty. + * Sample code: billingPropertiesPatch. * * @param manager Entry point to BillingManager. */ - public static void updateBillingProperty(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPropertiesPatch(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProperties() - .updateWithResponse(new BillingPropertyInner().withCostCenter("1010"), com.azure.core.util.Context.NONE); + .updateWithResponse( + "{subscriptionId}", + new BillingPropertyInner().withCostCenter("1010"), + com.azure.core.util.Context.NONE); + } +} +``` + +### BillingRequests_CreateOrUpdate + +```java +/** Samples for BillingRequests CreateOrUpdate. */ +public final class BillingRequestsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsCreateOrUpdate.json + */ + /** + * Sample code: BillingRequestsCreateOrUpdate. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsCreateOrUpdate(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .createOrUpdate("00000000-0000-0000-0000-000000000000", null, com.azure.core.util.Context.NONE); + } +} +``` + +### BillingRequests_Get + +```java +/** Samples for BillingRequests Get. */ +public final class BillingRequestsGetSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsGet.json + */ + /** + * Sample code: BillingRequestsGet. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsGet(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .getWithResponse("00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} +``` + +### BillingRequests_ListByBillingAccount + +```java +/** Samples for BillingRequests ListByBillingAccount. */ +public final class BillingRequestsListByBillingAccountSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByInvoiceSection.json + */ + /** + * Sample code: BillingRequestsListByInvoiceSection. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByInvoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "properties/invoiceSectionName eq 'xxxx-xxxx-xxx-xxx'", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByBillingAccount.json + */ + /** + * Sample code: BillingRequestsListByBillingAccount. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + null, + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByBillingProfile.json + */ + /** + * Sample code: BillingRequestsListByBillingProfile. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "properties/billingProfileName eq 'xxxx-xxxx-xxx-xxx'", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### BillingRequests_ListByUser + +```java +/** Samples for BillingRequests ListByUser. */ +public final class BillingRequestsListByUserSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByUser.json + */ + /** + * Sample code: BillingRequestsListByUser. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByUser(com.azure.resourcemanager.billing.BillingManager manager) { + manager.billingRequests().listByUser(null, null, null, null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByUserWithFilter.json + */ + /** + * Sample code: BillingRequestsListByUserWithFilter. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByUserWithFilter(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .listByUser( + "properties/status eq 'Approved'", null, null, null, null, null, com.azure.core.util.Context.NONE); } } ``` @@ -684,14 +925,15 @@ public final class BillingPropertyUpdateSamples { /** Samples for BillingRoleAssignments DeleteByBillingAccount. */ public final class BillingRoleAssignmentsDeleteByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsDeleteByBillingAccount.json */ /** - * Sample code: BillingAccountRoleAssignmentDelete. + * Sample code: billingRoleAssignmentsDeleteByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleAssignmentDelete(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsDeleteByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .deleteByBillingAccountWithResponse( @@ -706,14 +948,15 @@ public final class BillingRoleAssignmentsDeleteByBillingAccountSamples { /** Samples for BillingRoleAssignments DeleteByBillingProfile. */ public final class BillingRoleAssignmentsDeleteByBillingProfileSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsDeleteByBillingProfile.json */ /** - * Sample code: BillingProfileRoleAssignmentDelete. + * Sample code: billingRoleAssignmentsDeleteByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleAssignmentDelete(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsDeleteByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .deleteByBillingProfileWithResponse( @@ -731,14 +974,15 @@ public final class BillingRoleAssignmentsDeleteByBillingProfileSamples { /** Samples for BillingRoleAssignments DeleteByInvoiceSection. */ public final class BillingRoleAssignmentsDeleteByInvoiceSectionSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsDeleteByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleAssignmentDelete. + * Sample code: billingRoleAssignmentsDeleteByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleAssignmentDelete(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsDeleteByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .deleteByInvoiceSectionWithResponse( @@ -757,14 +1001,15 @@ public final class BillingRoleAssignmentsDeleteByInvoiceSectionSamples { /** Samples for BillingRoleAssignments GetByBillingAccount. */ public final class BillingRoleAssignmentsGetByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsGetByBillingAccount.json */ /** - * Sample code: BillingAccountRoleAssignment. + * Sample code: billingRoleAssignmentsGetByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleAssignment(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsGetByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .getByBillingAccountWithResponse( @@ -779,14 +1024,15 @@ public final class BillingRoleAssignmentsGetByBillingAccountSamples { /** Samples for BillingRoleAssignments GetByBillingProfile. */ public final class BillingRoleAssignmentsGetByBillingProfileSamples { /* - * 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/2023-04-01/examples/billingRoleAssignmentsGetByBillingProfile.json */ /** - * Sample code: BillingProfileRoleAssignment. + * Sample code: billingRoleAssignmentsGetByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleAssignment(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsGetByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .getByBillingProfileWithResponse( @@ -804,14 +1050,15 @@ public final class BillingRoleAssignmentsGetByBillingProfileSamples { /** Samples for BillingRoleAssignments GetByInvoiceSection. */ public final class BillingRoleAssignmentsGetByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingRoleAssignmentsGetByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleAssignment. + * Sample code: billingRoleAssignmentsGetByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleAssignment(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsGetByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .getByInvoiceSectionWithResponse( @@ -830,14 +1077,15 @@ public final class BillingRoleAssignmentsGetByInvoiceSectionSamples { /** Samples for BillingRoleAssignments ListByBillingAccount. */ public final class BillingRoleAssignmentsListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsListByBillingAccount.json */ /** - * Sample code: BillingAccountRoleAssignmentList. + * Sample code: billingRoleAssignmentsListByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleAssignmentList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsListByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager.billingRoleAssignments().listByBillingAccount("{billingAccountName}", com.azure.core.util.Context.NONE); } } @@ -849,14 +1097,15 @@ public final class BillingRoleAssignmentsListByBillingAccountSamples { /** Samples for BillingRoleAssignments ListByBillingProfile. */ public final class BillingRoleAssignmentsListByBillingProfileSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsListByBillingProfile.json */ /** - * Sample code: BillingProfileRoleAssignmentList. + * Sample code: billingRoleAssignmentsListByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleAssignmentList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsListByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .listByBillingProfile("{billingAccountName}", "{billingProfileName}", com.azure.core.util.Context.NONE); @@ -870,14 +1119,15 @@ public final class BillingRoleAssignmentsListByBillingProfileSamples { /** Samples for BillingRoleAssignments ListByInvoiceSection. */ public final class BillingRoleAssignmentsListByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingRoleAssignmentsListByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleAssignmentList. + * Sample code: billingRoleAssignmentsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleAssignmentList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsListByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .listByInvoiceSection( @@ -895,14 +1145,15 @@ public final class BillingRoleAssignmentsListByInvoiceSectionSamples { /** Samples for BillingRoleDefinitions GetByBillingAccount. */ public final class BillingRoleDefinitionsGetByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleDefinitionsGetByBillingAccount.json */ /** - * Sample code: BillingAccountRoleDefinition. + * Sample code: billingRoleDefinitionsGetByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleDefinition(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsGetByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .getByBillingAccountWithResponse( @@ -917,14 +1168,15 @@ public final class BillingRoleDefinitionsGetByBillingAccountSamples { /** Samples for BillingRoleDefinitions GetByBillingProfile. */ public final class BillingRoleDefinitionsGetByBillingProfileSamples { /* - * 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/2023-04-01/examples/billingRoleDefinitionsGetByBillingProfile.json */ /** - * Sample code: BillingProfileRoleDefinition. + * Sample code: billingRoleDefinitionsGetByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleDefinition(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsGetByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .getByBillingProfileWithResponse( @@ -942,14 +1194,15 @@ public final class BillingRoleDefinitionsGetByBillingProfileSamples { /** Samples for BillingRoleDefinitions GetByInvoiceSection. */ public final class BillingRoleDefinitionsGetByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingRoleDefinitionsGetByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleDefinition. + * Sample code: billingRoleDefinitionsGetByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleDefinition(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsGetByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .getByInvoiceSectionWithResponse( @@ -968,14 +1221,15 @@ public final class BillingRoleDefinitionsGetByInvoiceSectionSamples { /** Samples for BillingRoleDefinitions ListByBillingAccount. */ public final class BillingRoleDefinitionsListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleDefinitionsListByBillingAccount.json */ /** - * Sample code: BillingAccountRoleDefinitionsList. + * Sample code: billingRoleDefinitionsListByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleDefinitionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsListByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager.billingRoleDefinitions().listByBillingAccount("{billingAccountName}", com.azure.core.util.Context.NONE); } } @@ -987,14 +1241,15 @@ public final class BillingRoleDefinitionsListByBillingAccountSamples { /** Samples for BillingRoleDefinitions ListByBillingProfile. */ public final class BillingRoleDefinitionsListByBillingProfileSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleDefinitionsListByBillingProfile.json */ /** - * Sample code: BillingProfileRoleDefinitionsList. + * Sample code: billingRoleDefinitionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleDefinitionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsListByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .listByBillingProfile("{billingAccountName}", "{billingProfileName}", com.azure.core.util.Context.NONE); @@ -1008,14 +1263,15 @@ public final class BillingRoleDefinitionsListByBillingProfileSamples { /** Samples for BillingRoleDefinitions ListByInvoiceSection. */ public final class BillingRoleDefinitionsListByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingRoleDefinitionsListByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleDefinitionsList. + * Sample code: billingRoleDefinitionsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleDefinitionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsListByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .listByInvoiceSection( @@ -1033,15 +1289,17 @@ public final class BillingRoleDefinitionsListByInvoiceSectionSamples { /** Samples for BillingSubscriptions Get. */ public final class BillingSubscriptionsGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsGet.json */ /** - * Sample code: BillingSubscription. + * Sample code: billingSubscriptionsGet. * * @param manager Entry point to BillingManager. */ - public static void billingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingSubscriptions().getWithResponse("{billingAccountName}", com.azure.core.util.Context.NONE); + public static void billingSubscriptionsGet(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingSubscriptions() + .getWithResponse("{billingAccountName}", "{subscriptionId}", com.azure.core.util.Context.NONE); } } ``` @@ -1052,10 +1310,10 @@ public final class BillingSubscriptionsGetSamples { /** Samples for BillingSubscriptions ListByBillingAccount. */ public final class BillingSubscriptionsListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsListByBillingAccount.json */ /** - * Sample code: BillingSubscriptionsListByBillingAccount. + * Sample code: billingSubscriptionsListByBillingAccount. * * @param manager Entry point to BillingManager. */ @@ -1072,10 +1330,10 @@ public final class BillingSubscriptionsListByBillingAccountSamples { /** Samples for BillingSubscriptions ListByBillingProfile. */ public final class BillingSubscriptionsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/billingSubscriptionsListByBillingProfile.json */ /** - * Sample code: BillingSubscriptionsListByBillingProfile. + * Sample code: billingSubscriptionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ @@ -1094,10 +1352,10 @@ public final class BillingSubscriptionsListByBillingProfileSamples { /** Samples for BillingSubscriptions ListByCustomer. */ public final class BillingSubscriptionsListByCustomerSamples { /* - * 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/2023-04-01/examples/billingSubscriptionsListByCustomer.json */ /** - * Sample code: BillingSubscriptionsListByCustomer. + * Sample code: billingSubscriptionsListByCustomer. * * @param manager Entry point to BillingManager. */ @@ -1115,10 +1373,10 @@ public final class BillingSubscriptionsListByCustomerSamples { /** Samples for BillingSubscriptions ListByInvoiceSection. */ public final class BillingSubscriptionsListByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingSubscriptionsListByInvoiceSection.json */ /** - * Sample code: BillingSubscriptionsListByInvoiceSection. + * Sample code: billingSubscriptionsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ @@ -1143,18 +1401,19 @@ import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionReque /** Samples for BillingSubscriptions Move. */ public final class BillingSubscriptionsMoveSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsMove.json */ /** - * Sample code: MoveBillingSubscription. + * Sample code: billingSubscriptionsMove. * * @param manager Entry point to BillingManager. */ - public static void moveBillingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingSubscriptionsMove(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingSubscriptions() .move( "{billingAccountName}", + "{subscriptionId}", new TransferBillingSubscriptionRequestProperties() .withDestinationInvoiceSectionId( "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), @@ -1171,18 +1430,19 @@ import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; /** Samples for BillingSubscriptions Update. */ public final class BillingSubscriptionsUpdateSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsPatch.json */ /** - * Sample code: UpdateBillingProperty. + * Sample code: billingSubscriptionsPatch. * * @param manager Entry point to BillingManager. */ - public static void updateBillingProperty(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingSubscriptionsPatch(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingSubscriptions() .updateWithResponse( "{billingAccountName}", + "{subscriptionId}", new BillingSubscriptionInner().withCostCenter("ABC1234"), com.azure.core.util.Context.NONE); } @@ -1197,18 +1457,20 @@ import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionReque /** Samples for BillingSubscriptions ValidateMove. */ public final class BillingSubscriptionsValidateMoveSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsValidateMoveFailure.json */ /** - * Sample code: SubscriptionMoveValidateFailure. + * Sample code: billingSubscriptionsValidateMoveFailure. * * @param manager Entry point to BillingManager. */ - public static void subscriptionMoveValidateFailure(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingSubscriptionsValidateMoveFailure( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingSubscriptions() .validateMoveWithResponse( "{billingAccountName}", + "{subscriptionId}", new TransferBillingSubscriptionRequestProperties() .withDestinationInvoiceSectionId( "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), @@ -1216,18 +1478,20 @@ public final class BillingSubscriptionsValidateMoveSamples { } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveSuccess.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsValidateMoveSuccess.json */ /** - * Sample code: SubscriptionMoveValidateSuccess. + * Sample code: billingSubscriptionsValidateMoveSuccess. * * @param manager Entry point to BillingManager. */ - public static void subscriptionMoveValidateSuccess(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingSubscriptionsValidateMoveSuccess( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingSubscriptions() .validateMoveWithResponse( "{billingAccountName}", + "{subscriptionId}", new TransferBillingSubscriptionRequestProperties() .withDestinationInvoiceSectionId( "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), @@ -1242,14 +1506,14 @@ public final class BillingSubscriptionsValidateMoveSamples { /** Samples for Customers Get. */ public final class CustomersGetSamples { /* - * 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/2023-04-01/examples/customersGetWithExpand.json */ /** - * Sample code: CustomerWithExpand. + * Sample code: customersGetWithExpand. * * @param manager Entry point to BillingManager. */ - public static void customerWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + public static void customersGetWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { manager .customers() .getWithResponse( @@ -1260,14 +1524,14 @@ public final class CustomersGetSamples { } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/customersGet.json */ /** - * Sample code: Customer. + * Sample code: customersGet. * * @param manager Entry point to BillingManager. */ - public static void customer(com.azure.resourcemanager.billing.BillingManager manager) { + public static void customersGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .customers() .getWithResponse("{billingAccountName}", "{customerName}", null, com.azure.core.util.Context.NONE); @@ -1281,10 +1545,10 @@ public final class CustomersGetSamples { /** Samples for Customers ListByBillingAccount. */ public final class CustomersListByBillingAccountSamples { /* - * 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/2023-04-01/examples/customersListByBillingAccount.json */ /** - * Sample code: CustomersListByBillingAccount. + * Sample code: customersListByBillingAccount. * * @param manager Entry point to BillingManager. */ @@ -1300,10 +1564,10 @@ public final class CustomersListByBillingAccountSamples { /** Samples for Customers ListByBillingProfile. */ public final class CustomersListByBillingProfileSamples { /* - * 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/2023-04-01/examples/customersListByBillingProfile.json */ /** - * Sample code: CustomersListByBillingProfile. + * Sample code: customersListByBillingProfile. * * @param manager Entry point to BillingManager. */ @@ -1316,60 +1580,20 @@ public final class CustomersListByBillingProfileSamples { } ``` -### EnrollmentAccounts_Get - -```java -/** Samples for EnrollmentAccounts Get. */ -public final class EnrollmentAccountsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json - */ - /** - * Sample code: EnrollmentAccountsGet. - * - * @param manager Entry point to BillingManager. - */ - public static void enrollmentAccountsGet(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .enrollmentAccounts() - .getWithResponse("e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556", com.azure.core.util.Context.NONE); - } -} -``` - -### EnrollmentAccounts_List - -```java -/** Samples for EnrollmentAccounts List. */ -public final class EnrollmentAccountsListSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json - */ - /** - * Sample code: EnrollmentAccountsList. - * - * @param manager Entry point to BillingManager. - */ - public static void enrollmentAccountsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.enrollmentAccounts().list(com.azure.core.util.Context.NONE); - } -} -``` - ### Instructions_Get ```java /** Samples for Instructions Get. */ public final class InstructionsGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/instructionsGet.json */ /** - * Sample code: Instruction. + * Sample code: instructionsGet. * * @param manager Entry point to BillingManager. */ - public static void instruction(com.azure.resourcemanager.billing.BillingManager manager) { + public static void instructionsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .instructions() .getWithResponse( @@ -1384,10 +1608,10 @@ public final class InstructionsGetSamples { /** Samples for Instructions ListByBillingProfile. */ public final class InstructionsListByBillingProfileSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/instructionsListByBillingProfile.json */ /** - * Sample code: InstructionsListByBillingProfile. + * Sample code: instructionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ @@ -1408,14 +1632,14 @@ import java.time.OffsetDateTime; /** Samples for Instructions Put. */ public final class InstructionsPutSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/instructionsPut.json */ /** - * Sample code: PutInstruction. + * Sample code: instructionsPut. * * @param manager Entry point to BillingManager. */ - public static void putInstruction(com.azure.resourcemanager.billing.BillingManager manager) { + public static void instructionsPut(com.azure.resourcemanager.billing.BillingManager manager) { manager .instructions() .putWithResponse( @@ -1424,8 +1648,8 @@ public final class InstructionsPutSamples { "{instructionName}", new InstructionInner() .withAmount(5000f) - .withStartDate(OffsetDateTime.parse("2019-12-30T21:26:47.997Z")) - .withEndDate(OffsetDateTime.parse("2020-12-30T21:26:47.997Z")), + .withEndDate(OffsetDateTime.parse("2020-12-30T21:26:47.997Z")) + .withStartDate(OffsetDateTime.parse("2019-12-30T21:26:47.997Z")), com.azure.core.util.Context.NONE); } } @@ -1441,14 +1665,14 @@ import java.util.Map; /** Samples for InvoiceSections CreateOrUpdate. */ public final class InvoiceSectionsCreateOrUpdateSamples { /* - * 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/2023-04-01/examples/invoiceSectionsPut.json */ /** - * Sample code: PutInvoiceSection. + * Sample code: invoiceSectionsPut. * * @param manager Entry point to BillingManager. */ - public static void putInvoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoiceSectionsPut(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoiceSections() .createOrUpdate( @@ -1480,14 +1704,14 @@ public final class InvoiceSectionsCreateOrUpdateSamples { /** Samples for InvoiceSections Get. */ public final class InvoiceSectionsGetSamples { /* - * 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/2023-04-01/examples/invoiceSectionsGet.json */ /** - * Sample code: InvoiceSection. + * Sample code: invoiceSectionsGet. * * @param manager Entry point to BillingManager. */ - public static void invoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoiceSectionsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoiceSections() .getWithResponse( @@ -1505,10 +1729,10 @@ public final class InvoiceSectionsGetSamples { /** Samples for InvoiceSections ListByBillingProfile. */ public final class InvoiceSectionsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/invoiceSectionsListByBillingProfile.json */ /** - * Sample code: InvoiceSectionsListByBillingProfile. + * Sample code: invoiceSectionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ @@ -1526,17 +1750,18 @@ public final class InvoiceSectionsListByBillingProfileSamples { /** Samples for Invoices DownloadBillingSubscriptionInvoice. */ public final class InvoicesDownloadBillingSubscriptionInvoiceSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesDownloadByBillingSubscription.json */ /** - * Sample code: BillingSubscriptionInvoiceDownload. + * Sample code: invoicesDownloadByBillingSubscription. * * @param manager Entry point to BillingManager. */ - public static void billingSubscriptionInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesDownloadByBillingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() - .downloadBillingSubscriptionInvoice("{invoiceName}", "DRS_12345", com.azure.core.util.Context.NONE); + .downloadBillingSubscriptionInvoice( + "{subscriptionId}", "{invoiceName}", "DRS_12345", com.azure.core.util.Context.NONE); } } ``` @@ -1547,14 +1772,14 @@ public final class InvoicesDownloadBillingSubscriptionInvoiceSamples { /** Samples for Invoices DownloadInvoice. */ public final class InvoicesDownloadInvoiceSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesDownloadByBillingAccount.json */ /** - * Sample code: InvoiceDownload. + * Sample code: invoicesDownloadByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void invoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesDownloadByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() .downloadInvoice("{billingAccountName}", "{invoiceName}", "DRS_12345", com.azure.core.util.Context.NONE); @@ -1570,23 +1795,23 @@ import java.util.Arrays; /** Samples for Invoices DownloadMultipleBillingProfileInvoices. */ public final class InvoicesDownloadMultipleBillingProfileInvoicesSamples { /* - * 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/2023-04-01/examples/invoicesDownloadBatchByBillingAccount.json */ /** - * Sample code: BillingProfileInvoiceDownload. + * Sample code: invoicesDownloadBatchByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingProfileInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesDownloadBatchByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() .downloadMultipleBillingProfileInvoices( "{billingAccountName}", Arrays .asList( - "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"), + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01", + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01", + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01"), com.azure.core.util.Context.NONE); } } @@ -1600,22 +1825,24 @@ import java.util.Arrays; /** Samples for Invoices DownloadMultipleBillingSubscriptionInvoices. */ public final class InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesDownloadBatchByBillingSubscription.json */ /** - * Sample code: BillingSubscriptionInvoiceDownload. + * Sample code: invoicesDownloadBatchByBillingSubscription. * * @param manager Entry point to BillingManager. */ - public static void billingSubscriptionInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesDownloadBatchByBillingSubscription( + com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() .downloadMultipleBillingSubscriptionInvoices( + "{subscriptionId}", Arrays .asList( - "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"), + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01", + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01", + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01"), com.azure.core.util.Context.NONE); } } @@ -1627,50 +1854,50 @@ public final class InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples { /** Samples for Invoices Get. */ public final class InvoicesGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Invoice.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetByBillingAccount.json */ /** - * Sample code: Invoice. + * Sample code: invoicesGetByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void invoice(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGetByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetVoid.json */ /** - * Sample code: CreditNote. + * Sample code: invoicesGetVoid. * * @param manager Entry point to BillingManager. */ - public static void creditNote(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGetVoid(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/VoidInvoice.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetCreditNote.json */ /** - * Sample code: VoidInvoice. + * Sample code: invoicesGetCreditNote. * * @param manager Entry point to BillingManager. */ - public static void voidInvoice(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGetCreditNote(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceWithRebillDetails.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetWithRebillDetails.json */ /** - * Sample code: InvoiceWithRebillDetails. + * Sample code: invoicesGetWithRebillDetails. * * @param manager Entry point to BillingManager. */ - public static void invoiceWithRebillDetails(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGetWithRebillDetails(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", com.azure.core.util.Context.NONE); } } @@ -1682,14 +1909,14 @@ public final class InvoicesGetSamples { /** Samples for Invoices GetById. */ public final class InvoicesGetByIdSamples { /* - * 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/2023-04-01/examples/invoicesGet.json */ /** - * Sample code: Invoice. + * Sample code: invoicesGet. * * @param manager Entry point to BillingManager. */ - public static void invoice(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGet(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getByIdWithResponse("{invoiceName}", com.azure.core.util.Context.NONE); } } @@ -1701,16 +1928,18 @@ public final class InvoicesGetByIdSamples { /** Samples for Invoices GetBySubscriptionAndInvoiceId. */ public final class InvoicesGetBySubscriptionAndInvoiceIdSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetByBillingSubscription.json */ /** - * Sample code: BillingSubscriptionsListByBillingAccount. + * Sample code: invoicesGetByBillingSubscription. * * @param manager Entry point to BillingManager. */ - public static void billingSubscriptionsListByBillingAccount( - com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().getBySubscriptionAndInvoiceIdWithResponse("{invoiceName}", com.azure.core.util.Context.NONE); + public static void invoicesGetByBillingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .invoices() + .getBySubscriptionAndInvoiceIdWithResponse( + "{subscriptionId}", "{invoiceName}", com.azure.core.util.Context.NONE); } } ``` @@ -1721,28 +1950,28 @@ public final class InvoicesGetBySubscriptionAndInvoiceIdSamples { /** Samples for Invoices ListByBillingAccount. */ public final class InvoicesListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesListByBillingAccount.json */ /** - * Sample code: BillingAccountInvoicesList. + * Sample code: invoicesListByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountInvoicesList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() .listByBillingAccount("{billingAccountName}", "2018-01-01", "2018-06-30", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesListWithRebillDetails.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesListByBillingAccountWithRebillDetails.json */ /** - * Sample code: BillingAccountInvoicesListWithRebillDetails. + * Sample code: invoicesListByBillingAccountWithRebillDetails. * * @param manager Entry point to BillingManager. */ - public static void billingAccountInvoicesListWithRebillDetails( + public static void invoicesListByBillingAccountWithRebillDetails( com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() @@ -1757,10 +1986,10 @@ public final class InvoicesListByBillingAccountSamples { /** Samples for Invoices ListByBillingProfile. */ public final class InvoicesListByBillingProfileSamples { /* - * 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/2023-04-01/examples/invoicesListByBillingProfile.json */ /** - * Sample code: InvoicesListByBillingProfile. + * Sample code: invoicesListByBillingProfile. * * @param manager Entry point to BillingManager. */ @@ -1776,10 +2005,10 @@ public final class InvoicesListByBillingProfileSamples { } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfileWithRebillDetails.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesListByBillingProfileWithRebillDetails.json */ /** - * Sample code: InvoicesListByBillingProfileWithRebillDetails. + * Sample code: invoicesListByBillingProfileWithRebillDetails. * * @param manager Entry point to BillingManager. */ @@ -1803,16 +2032,18 @@ public final class InvoicesListByBillingProfileSamples { /** Samples for Invoices ListByBillingSubscription. */ public final class InvoicesListByBillingSubscriptionSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesListByBillingSubscription.json */ /** - * Sample code: BillingSubscriptionsListByBillingAccount. + * Sample code: invoicesListByBillingSubscription. * * @param manager Entry point to BillingManager. */ - public static void billingSubscriptionsListByBillingAccount( - com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().listByBillingSubscription("2022-01-01", "2022-06-30", com.azure.core.util.Context.NONE); + public static void invoicesListByBillingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .invoices() + .listByBillingSubscription( + "{subscriptionId}", "2022-01-01", "2022-06-30", com.azure.core.util.Context.NONE); } } ``` @@ -1823,33 +2054,186 @@ public final class InvoicesListByBillingSubscriptionSamples { /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/GetOperations.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/operationsGet.json */ /** - * Sample code: BillingAccountPermissionsList. + * Sample code: operationsGet. * * @param manager Entry point to BillingManager. */ - public static void billingAccountPermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void operationsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } ``` +### PaymentMethods_DeleteByUser + +```java +/** Samples for PaymentMethods DeleteByUser. */ +public final class PaymentMethodsDeleteByUserSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodOwnedByUser_Delete.json + */ + /** + * Sample code: DeletePaymentMethodOwnedByUser. + * + * @param manager Entry point to BillingManager. + */ + public static void deletePaymentMethodOwnedByUser(com.azure.resourcemanager.billing.BillingManager manager) { + manager.paymentMethods().deleteByUserWithResponse("ABCDABCDABC0", com.azure.core.util.Context.NONE); + } +} +``` + +### PaymentMethods_GetByBillingAccount + +```java +/** Samples for PaymentMethods GetByBillingAccount. */ +public final class PaymentMethodsGetByBillingAccountSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodAtBillingAccount_Get.json + */ + /** + * Sample code: PaymentMethodGetAtBillingProfile. + * + * @param manager Entry point to BillingManager. + */ + public static void paymentMethodGetAtBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .paymentMethods() + .getByBillingAccountWithResponse( + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", + "21dd9edc-af71-4d62-80ce-37151d475326", + com.azure.core.util.Context.NONE); + } +} +``` + +### PaymentMethods_GetByBillingProfile + +```java +/** Samples for PaymentMethods GetByBillingProfile. */ +public final class PaymentMethodsGetByBillingProfileSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodAtBillingProfile_Get.json + */ + /** + * Sample code: PaymentMethodsGetByBillingProfile. + * + * @param manager Entry point to BillingManager. + */ + public static void paymentMethodsGetByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .paymentMethods() + .getByBillingProfileWithResponse( + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", + "ABC1-A1CD-AB1-BP1", + "ABCDABCDABC0", + com.azure.core.util.Context.NONE); + } +} +``` + +### PaymentMethods_GetByUser + +```java +/** Samples for PaymentMethods GetByUser. */ +public final class PaymentMethodsGetByUserSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodOwnedByUser_Get.json + */ + /** + * Sample code: GetPaymentMethodOwnedByUser. + * + * @param manager Entry point to BillingManager. + */ + public static void getPaymentMethodOwnedByUser(com.azure.resourcemanager.billing.BillingManager manager) { + manager.paymentMethods().getByUserWithResponse("ABCDABCDABC0", com.azure.core.util.Context.NONE); + } +} +``` + +### PaymentMethods_ListByBillingAccount + +```java +/** Samples for PaymentMethods ListByBillingAccount. */ +public final class PaymentMethodsListByBillingAccountSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodAtBillingAccount_List.json + */ + /** + * Sample code: PaymentMethodsListByBillingAccount. + * + * @param manager Entry point to BillingManager. + */ + public static void paymentMethodsListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .paymentMethods() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", + com.azure.core.util.Context.NONE); + } +} +``` + +### PaymentMethods_ListByBillingProfile + +```java +/** Samples for PaymentMethods ListByBillingProfile. */ +public final class PaymentMethodsListByBillingProfileSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodAtBillingProfile_List.json + */ + /** + * Sample code: PaymentMethodsListByBillingProfile. + * + * @param manager Entry point to BillingManager. + */ + public static void paymentMethodsListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .paymentMethods() + .listByBillingProfile( + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", + "ABC1-A1CD-AB1-BP1", + com.azure.core.util.Context.NONE); + } +} +``` + +### PaymentMethods_ListByUser + +```java +/** Samples for PaymentMethods ListByUser. */ +public final class PaymentMethodsListByUserSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodOwnedByUser_List.json + */ + /** + * Sample code: ListPaymentMethodOwnedByUser. + * + * @param manager Entry point to BillingManager. + */ + public static void listPaymentMethodOwnedByUser(com.azure.resourcemanager.billing.BillingManager manager) { + manager.paymentMethods().listByUser(com.azure.core.util.Context.NONE); + } +} +``` + ### Policies_GetByBillingProfile ```java /** Samples for Policies GetByBillingProfile. */ public final class PoliciesGetByBillingProfileSamples { /* - * 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/2023-04-01/examples/policiesGetByBillingProfile.json */ /** - * Sample code: PolicyByBillingProfile. + * Sample code: policiesGetByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void policyByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + public static void policiesGetByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { manager .policies() .getByBillingProfileWithResponse( @@ -1864,14 +2248,14 @@ public final class PoliciesGetByBillingProfileSamples { /** Samples for Policies GetByCustomer. */ public final class PoliciesGetByCustomerSamples { /* - * 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/2023-04-01/examples/policiesGetByCustomer.json */ /** - * Sample code: PolicyByCustomer. + * Sample code: policiesGetByCustomer. * * @param manager Entry point to BillingManager. */ - public static void policyByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { + public static void policiesGetByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { manager .policies() .getByCustomerWithResponse("{billingAccountName}", "{customerName}", com.azure.core.util.Context.NONE); @@ -1890,14 +2274,14 @@ import com.azure.resourcemanager.billing.models.ViewChargesPolicy; /** Samples for Policies Update. */ public final class PoliciesUpdateSamples { /* - * 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/2023-04-01/examples/policiesPutByBillingProfile.json */ /** - * Sample code: UpdatePolicy. + * Sample code: policiesPutByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void updatePolicy(com.azure.resourcemanager.billing.BillingManager manager) { + public static void policiesPutByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { manager .policies() .updateWithResponse( @@ -1921,14 +2305,14 @@ import com.azure.resourcemanager.billing.models.ViewCharges; /** Samples for Policies UpdateCustomer. */ public final class PoliciesUpdateCustomerSamples { /* - * 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/2023-04-01/examples/policiesPutByCustomer.json */ /** - * Sample code: UpdateCustomer. + * Sample code: policiesPutByCustomer. * * @param manager Entry point to BillingManager. */ - public static void updateCustomer(com.azure.resourcemanager.billing.BillingManager manager) { + public static void policiesPutByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { manager .policies() .updateCustomerWithResponse( @@ -1946,14 +2330,14 @@ public final class PoliciesUpdateCustomerSamples { /** Samples for Products Get. */ public final class ProductsGetSamples { /* - * 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/2023-04-01/examples/productsGet.json */ /** - * Sample code: Product. + * Sample code: productsGet. * * @param manager Entry point to BillingManager. */ - public static void product(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager.products().getWithResponse("{billingAccountName}", "{productName}", com.azure.core.util.Context.NONE); } } @@ -1965,10 +2349,10 @@ public final class ProductsGetSamples { /** Samples for Products ListByBillingAccount. */ public final class ProductsListByBillingAccountSamples { /* - * 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/2023-04-01/examples/productsListByBillingAccount.json */ /** - * Sample code: ProductsListByBillingAccount. + * Sample code: productsListByBillingAccount. * * @param manager Entry point to BillingManager. */ @@ -1984,10 +2368,10 @@ public final class ProductsListByBillingAccountSamples { /** Samples for Products ListByBillingProfile. */ public final class ProductsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/productsListByBillingProfile.json */ /** - * Sample code: ProductsListByBillingProfile. + * Sample code: productsListByBillingProfile. * * @param manager Entry point to BillingManager. */ @@ -2006,14 +2390,14 @@ public final class ProductsListByBillingProfileSamples { /** Samples for Products ListByCustomer. */ public final class ProductsListByCustomerSamples { /* - * 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/2023-04-01/examples/productsListByCustomer.json */ /** - * Sample code: ProductsListByInvoiceSection. + * Sample code: productsListByCustomer. * * @param manager Entry point to BillingManager. */ - public static void productsListByInvoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsListByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { manager.products().listByCustomer("{billingAccountName}", "{customerName}", com.azure.core.util.Context.NONE); } } @@ -2025,10 +2409,10 @@ public final class ProductsListByCustomerSamples { /** Samples for Products ListByInvoiceSection. */ public final class ProductsListByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/productsListByInvoiceSection.json */ /** - * Sample code: ProductsListByInvoiceSection. + * Sample code: productsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ @@ -2053,14 +2437,14 @@ import com.azure.resourcemanager.billing.models.TransferProductRequestProperties /** Samples for Products Move. */ public final class ProductsMoveSamples { /* - * 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/2023-04-01/examples/productsMove.json */ /** - * Sample code: MoveProduct. + * Sample code: productsMove. * * @param manager Entry point to BillingManager. */ - public static void moveProduct(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsMove(com.azure.resourcemanager.billing.BillingManager manager) { manager .products() .moveWithResponse( @@ -2083,14 +2467,14 @@ import com.azure.resourcemanager.billing.models.AutoRenew; /** Samples for Products Update. */ public final class ProductsUpdateSamples { /* - * 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/2023-04-01/examples/productsPatch.json */ /** - * Sample code: UpdateBillingProperty. + * Sample code: productsPatch. * * @param manager Entry point to BillingManager. */ - public static void updateBillingProperty(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsPatch(com.azure.resourcemanager.billing.BillingManager manager) { manager .products() .updateWithResponse( @@ -2110,14 +2494,14 @@ import com.azure.resourcemanager.billing.models.TransferProductRequestProperties /** Samples for Products ValidateMove. */ public final class ProductsValidateMoveSamples { /* - * 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/2023-04-01/examples/productsValidateMoveFailure.json */ /** - * Sample code: SubscriptionMoveValidateFailure. + * Sample code: productsValidateMoveFailure. * * @param manager Entry point to BillingManager. */ - public static void subscriptionMoveValidateFailure(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsValidateMoveFailure(com.azure.resourcemanager.billing.BillingManager manager) { manager .products() .validateMoveWithResponse( @@ -2130,14 +2514,14 @@ public final class ProductsValidateMoveSamples { } /* - * 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/2023-04-01/examples/productsValidateMoveSuccess.json */ /** - * Sample code: SubscriptionMoveValidateSuccess. + * Sample code: productsValidateMoveSuccess. * * @param manager Entry point to BillingManager. */ - public static void subscriptionMoveValidateSuccess(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsValidateMoveSuccess(com.azure.resourcemanager.billing.BillingManager manager) { manager .products() .validateMoveWithResponse( @@ -2157,10 +2541,10 @@ public final class ProductsValidateMoveSamples { /** Samples for Reservations ListByBillingAccount. */ public final class ReservationsListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/reservationsListByBillingAccount.json */ /** - * Sample code: ReservationsListByBillingAccount. + * Sample code: reservationsListByBillingAccount. * * @param manager Entry point to BillingManager. */ @@ -2184,10 +2568,10 @@ public final class ReservationsListByBillingAccountSamples { /** Samples for Reservations ListByBillingProfile. */ public final class ReservationsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/reservationsListByBillingProfile.json */ /** - * Sample code: ReservationsListByBillingProfile. + * Sample code: reservationsListByBillingProfile. * * @param manager Entry point to BillingManager. */ @@ -2212,10 +2596,10 @@ public final class ReservationsListByBillingProfileSamples { /** Samples for Transactions ListByInvoice. */ public final class TransactionsListByInvoiceSamples { /* - * 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/2023-04-01/examples/transactionsListByInvoice.json */ /** - * Sample code: TransactionsListByInvoice. + * Sample code: transactionsListByInvoice. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/pom.xml b/sdk/billing/azure-resourcemanager-billing/pom.xml index b1bd3df72b341..594956e89c922 100644 --- a/sdk/billing/azure-resourcemanager-billing/pom.xml +++ b/sdk/billing/azure-resourcemanager-billing/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for Billing Management - This package contains Microsoft Azure SDK for Billing Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Billing client provides access to billing resources for Azure subscriptions. Package tag package-2020-05. + This package contains Microsoft Azure SDK for Billing Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Billing Client. Package tag package-2023-04. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java index 759e6a82c9cf2..3ce7a0c813327 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java @@ -26,43 +26,45 @@ import com.azure.resourcemanager.billing.fluent.BillingManagementClient; import com.azure.resourcemanager.billing.implementation.AddressImpl; import com.azure.resourcemanager.billing.implementation.AgreementsImpl; +import com.azure.resourcemanager.billing.implementation.AssociatedTenantsImpl; import com.azure.resourcemanager.billing.implementation.AvailableBalancesImpl; import com.azure.resourcemanager.billing.implementation.BillingAccountsImpl; import com.azure.resourcemanager.billing.implementation.BillingManagementClientBuilder; -import com.azure.resourcemanager.billing.implementation.BillingPeriodsImpl; import com.azure.resourcemanager.billing.implementation.BillingPermissionsImpl; import com.azure.resourcemanager.billing.implementation.BillingProfilesImpl; import com.azure.resourcemanager.billing.implementation.BillingPropertiesImpl; +import com.azure.resourcemanager.billing.implementation.BillingRequestsImpl; import com.azure.resourcemanager.billing.implementation.BillingRoleAssignmentsImpl; import com.azure.resourcemanager.billing.implementation.BillingRoleDefinitionsImpl; import com.azure.resourcemanager.billing.implementation.BillingSubscriptionsImpl; import com.azure.resourcemanager.billing.implementation.CustomersImpl; -import com.azure.resourcemanager.billing.implementation.EnrollmentAccountsImpl; import com.azure.resourcemanager.billing.implementation.InstructionsImpl; import com.azure.resourcemanager.billing.implementation.InvoiceSectionsImpl; import com.azure.resourcemanager.billing.implementation.InvoicesImpl; import com.azure.resourcemanager.billing.implementation.OperationsImpl; +import com.azure.resourcemanager.billing.implementation.PaymentMethodsImpl; import com.azure.resourcemanager.billing.implementation.PoliciesImpl; import com.azure.resourcemanager.billing.implementation.ProductsImpl; import com.azure.resourcemanager.billing.implementation.ReservationsImpl; import com.azure.resourcemanager.billing.implementation.TransactionsImpl; import com.azure.resourcemanager.billing.models.Address; import com.azure.resourcemanager.billing.models.Agreements; +import com.azure.resourcemanager.billing.models.AssociatedTenants; import com.azure.resourcemanager.billing.models.AvailableBalances; import com.azure.resourcemanager.billing.models.BillingAccounts; -import com.azure.resourcemanager.billing.models.BillingPeriods; import com.azure.resourcemanager.billing.models.BillingPermissions; import com.azure.resourcemanager.billing.models.BillingProfiles; import com.azure.resourcemanager.billing.models.BillingProperties; +import com.azure.resourcemanager.billing.models.BillingRequests; import com.azure.resourcemanager.billing.models.BillingRoleAssignments; import com.azure.resourcemanager.billing.models.BillingRoleDefinitions; import com.azure.resourcemanager.billing.models.BillingSubscriptions; import com.azure.resourcemanager.billing.models.Customers; -import com.azure.resourcemanager.billing.models.EnrollmentAccounts; import com.azure.resourcemanager.billing.models.Instructions; import com.azure.resourcemanager.billing.models.InvoiceSections; import com.azure.resourcemanager.billing.models.Invoices; import com.azure.resourcemanager.billing.models.Operations; +import com.azure.resourcemanager.billing.models.PaymentMethods; import com.azure.resourcemanager.billing.models.Policies; import com.azure.resourcemanager.billing.models.Products; import com.azure.resourcemanager.billing.models.Reservations; @@ -74,49 +76,51 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to BillingManager. Billing client provides access to billing resources for Azure subscriptions. */ +/** Entry point to BillingManager. Billing Client. */ public final class BillingManager { - private BillingAccounts billingAccounts; + private Agreements agreements; - private Address address; + private AssociatedTenants associatedTenants; private AvailableBalances availableBalances; - private Instructions instructions; + private BillingAccounts billingAccounts; + + private Address address; + + private BillingPermissions billingPermissions; private BillingProfiles billingProfiles; - private Customers customers; + private BillingProperties billingProperties; - private InvoiceSections invoiceSections; + private BillingRequests billingRequests; - private BillingPermissions billingPermissions; + private BillingRoleAssignments billingRoleAssignments; + + private BillingRoleDefinitions billingRoleDefinitions; private BillingSubscriptions billingSubscriptions; - private Products products; + private Customers customers; - private Invoices invoices; + private Instructions instructions; - private Transactions transactions; + private Invoices invoices; - private Policies policies; + private InvoiceSections invoiceSections; - private BillingProperties billingProperties; + private Operations operations; - private BillingRoleDefinitions billingRoleDefinitions; + private PaymentMethods paymentMethods; - private BillingRoleAssignments billingRoleAssignments; + private Policies policies; - private Agreements agreements; + private Products products; private Reservations reservations; - private EnrollmentAccounts enrollmentAccounts; - - private BillingPeriods billingPeriods; - - private Operations operations; + private Transactions transactions; private final BillingManagementClient clientObject; @@ -127,7 +131,6 @@ private BillingManager(HttpPipeline httpPipeline, AzureProfile profile, Duration new BillingManagementClientBuilder() .pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); } @@ -283,7 +286,7 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof .append("-") .append("com.azure.resourcemanager.billing") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -341,27 +344,27 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof } /** - * Gets the resource collection API of BillingAccounts. + * Gets the resource collection API of Agreements. * - * @return Resource collection API of BillingAccounts. + * @return Resource collection API of Agreements. */ - public BillingAccounts billingAccounts() { - if (this.billingAccounts == null) { - this.billingAccounts = new BillingAccountsImpl(clientObject.getBillingAccounts(), this); + public Agreements agreements() { + if (this.agreements == null) { + this.agreements = new AgreementsImpl(clientObject.getAgreements(), this); } - return billingAccounts; + return agreements; } /** - * Gets the resource collection API of Address. + * Gets the resource collection API of AssociatedTenants. * - * @return Resource collection API of Address. + * @return Resource collection API of AssociatedTenants. */ - public Address address() { - if (this.address == null) { - this.address = new AddressImpl(clientObject.getAddress(), this); + public AssociatedTenants associatedTenants() { + if (this.associatedTenants == null) { + this.associatedTenants = new AssociatedTenantsImpl(clientObject.getAssociatedTenants(), this); } - return address; + return associatedTenants; } /** @@ -377,15 +380,39 @@ public AvailableBalances availableBalances() { } /** - * Gets the resource collection API of Instructions. + * Gets the resource collection API of BillingAccounts. * - * @return Resource collection API of Instructions. + * @return Resource collection API of BillingAccounts. */ - public Instructions instructions() { - if (this.instructions == null) { - this.instructions = new InstructionsImpl(clientObject.getInstructions(), this); + public BillingAccounts billingAccounts() { + if (this.billingAccounts == null) { + this.billingAccounts = new BillingAccountsImpl(clientObject.getBillingAccounts(), this); } - return instructions; + return billingAccounts; + } + + /** + * Gets the resource collection API of Address. + * + * @return Resource collection API of Address. + */ + public Address address() { + if (this.address == null) { + this.address = new AddressImpl(clientObject.getAddress(), this); + } + return address; + } + + /** + * Gets the resource collection API of BillingPermissions. + * + * @return Resource collection API of BillingPermissions. + */ + public BillingPermissions billingPermissions() { + if (this.billingPermissions == null) { + this.billingPermissions = new BillingPermissionsImpl(clientObject.getBillingPermissions(), this); + } + return billingPermissions; } /** @@ -401,39 +428,53 @@ public BillingProfiles billingProfiles() { } /** - * Gets the resource collection API of Customers. + * Gets the resource collection API of BillingProperties. * - * @return Resource collection API of Customers. + * @return Resource collection API of BillingProperties. */ - public Customers customers() { - if (this.customers == null) { - this.customers = new CustomersImpl(clientObject.getCustomers(), this); + public BillingProperties billingProperties() { + if (this.billingProperties == null) { + this.billingProperties = new BillingPropertiesImpl(clientObject.getBillingProperties(), this); } - return customers; + return billingProperties; } /** - * Gets the resource collection API of InvoiceSections. + * Gets the resource collection API of BillingRequests. * - * @return Resource collection API of InvoiceSections. + * @return Resource collection API of BillingRequests. */ - public InvoiceSections invoiceSections() { - if (this.invoiceSections == null) { - this.invoiceSections = new InvoiceSectionsImpl(clientObject.getInvoiceSections(), this); + public BillingRequests billingRequests() { + if (this.billingRequests == null) { + this.billingRequests = new BillingRequestsImpl(clientObject.getBillingRequests(), this); } - return invoiceSections; + return billingRequests; } /** - * Gets the resource collection API of BillingPermissions. + * Gets the resource collection API of BillingRoleAssignments. * - * @return Resource collection API of BillingPermissions. + * @return Resource collection API of BillingRoleAssignments. */ - public BillingPermissions billingPermissions() { - if (this.billingPermissions == null) { - this.billingPermissions = new BillingPermissionsImpl(clientObject.getBillingPermissions(), this); + public BillingRoleAssignments billingRoleAssignments() { + if (this.billingRoleAssignments == null) { + this.billingRoleAssignments = + new BillingRoleAssignmentsImpl(clientObject.getBillingRoleAssignments(), this); } - return billingPermissions; + return billingRoleAssignments; + } + + /** + * Gets the resource collection API of BillingRoleDefinitions. + * + * @return Resource collection API of BillingRoleDefinitions. + */ + public BillingRoleDefinitions billingRoleDefinitions() { + if (this.billingRoleDefinitions == null) { + this.billingRoleDefinitions = + new BillingRoleDefinitionsImpl(clientObject.getBillingRoleDefinitions(), this); + } + return billingRoleDefinitions; } /** @@ -449,101 +490,99 @@ public BillingSubscriptions billingSubscriptions() { } /** - * Gets the resource collection API of Products. + * Gets the resource collection API of Customers. * - * @return Resource collection API of Products. + * @return Resource collection API of Customers. */ - public Products products() { - if (this.products == null) { - this.products = new ProductsImpl(clientObject.getProducts(), this); + public Customers customers() { + if (this.customers == null) { + this.customers = new CustomersImpl(clientObject.getCustomers(), this); } - return products; + return customers; } /** - * Gets the resource collection API of Invoices. + * Gets the resource collection API of Instructions. * - * @return Resource collection API of Invoices. + * @return Resource collection API of Instructions. */ - public Invoices invoices() { - if (this.invoices == null) { - this.invoices = new InvoicesImpl(clientObject.getInvoices(), this); + public Instructions instructions() { + if (this.instructions == null) { + this.instructions = new InstructionsImpl(clientObject.getInstructions(), this); } - return invoices; + return instructions; } /** - * Gets the resource collection API of Transactions. + * Gets the resource collection API of Invoices. * - * @return Resource collection API of Transactions. + * @return Resource collection API of Invoices. */ - public Transactions transactions() { - if (this.transactions == null) { - this.transactions = new TransactionsImpl(clientObject.getTransactions(), this); + public Invoices invoices() { + if (this.invoices == null) { + this.invoices = new InvoicesImpl(clientObject.getInvoices(), this); } - return transactions; + return invoices; } /** - * Gets the resource collection API of Policies. + * Gets the resource collection API of InvoiceSections. * - * @return Resource collection API of Policies. + * @return Resource collection API of InvoiceSections. */ - public Policies policies() { - if (this.policies == null) { - this.policies = new PoliciesImpl(clientObject.getPolicies(), this); + public InvoiceSections invoiceSections() { + if (this.invoiceSections == null) { + this.invoiceSections = new InvoiceSectionsImpl(clientObject.getInvoiceSections(), this); } - return policies; + return invoiceSections; } /** - * Gets the resource collection API of BillingProperties. + * Gets the resource collection API of Operations. * - * @return Resource collection API of BillingProperties. + * @return Resource collection API of Operations. */ - public BillingProperties billingProperties() { - if (this.billingProperties == null) { - this.billingProperties = new BillingPropertiesImpl(clientObject.getBillingProperties(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return billingProperties; + return operations; } /** - * Gets the resource collection API of BillingRoleDefinitions. + * Gets the resource collection API of PaymentMethods. * - * @return Resource collection API of BillingRoleDefinitions. + * @return Resource collection API of PaymentMethods. */ - public BillingRoleDefinitions billingRoleDefinitions() { - if (this.billingRoleDefinitions == null) { - this.billingRoleDefinitions = - new BillingRoleDefinitionsImpl(clientObject.getBillingRoleDefinitions(), this); + public PaymentMethods paymentMethods() { + if (this.paymentMethods == null) { + this.paymentMethods = new PaymentMethodsImpl(clientObject.getPaymentMethods(), this); } - return billingRoleDefinitions; + return paymentMethods; } /** - * Gets the resource collection API of BillingRoleAssignments. + * Gets the resource collection API of Policies. * - * @return Resource collection API of BillingRoleAssignments. + * @return Resource collection API of Policies. */ - public BillingRoleAssignments billingRoleAssignments() { - if (this.billingRoleAssignments == null) { - this.billingRoleAssignments = - new BillingRoleAssignmentsImpl(clientObject.getBillingRoleAssignments(), this); + public Policies policies() { + if (this.policies == null) { + this.policies = new PoliciesImpl(clientObject.getPolicies(), this); } - return billingRoleAssignments; + return policies; } /** - * Gets the resource collection API of Agreements. + * Gets the resource collection API of Products. * - * @return Resource collection API of Agreements. + * @return Resource collection API of Products. */ - public Agreements agreements() { - if (this.agreements == null) { - this.agreements = new AgreementsImpl(clientObject.getAgreements(), this); + public Products products() { + if (this.products == null) { + this.products = new ProductsImpl(clientObject.getProducts(), this); } - return agreements; + return products; } /** @@ -559,39 +598,15 @@ public Reservations reservations() { } /** - * Gets the resource collection API of EnrollmentAccounts. - * - * @return Resource collection API of EnrollmentAccounts. - */ - public EnrollmentAccounts enrollmentAccounts() { - if (this.enrollmentAccounts == null) { - this.enrollmentAccounts = new EnrollmentAccountsImpl(clientObject.getEnrollmentAccounts(), this); - } - return enrollmentAccounts; - } - - /** - * Gets the resource collection API of BillingPeriods. - * - * @return Resource collection API of BillingPeriods. - */ - public BillingPeriods billingPeriods() { - if (this.billingPeriods == null) { - this.billingPeriods = new BillingPeriodsImpl(clientObject.getBillingPeriods(), this); - } - return billingPeriods; - } - - /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of Transactions. * - * @return Resource collection API of Operations. + * @return Resource collection API of Transactions. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public Transactions transactions() { + if (this.transactions == null) { + this.transactions = new TransactionsImpl(clientObject.getTransactions(), this); } - return operations; + return transactions; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AssociatedTenantsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AssociatedTenantsClient.java new file mode 100644 index 0000000000000..685da4878620a --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AssociatedTenantsClient.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.billing.fluent.models.AssociatedTenantInner; + +/** An instance of this class provides access to all the operations defined in AssociatedTenantsClient. */ +public interface AssociatedTenantsClient { + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountName); + + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param includeRevoked Can be used to get revoked associated tenants. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount( + String billingAccountName, + Boolean includeRevoked, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context); + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String billingAccountName, String associatedTenantName); + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String billingAccountName, String associatedTenantName, Context context); + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String billingAccountName, String associatedTenantName); + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String billingAccountName, String associatedTenantName, Context context); + + /** + * 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 includeRevoked Can be used to get revoked associated tenants. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String billingAccountName, String associatedTenantName, Boolean includeRevoked, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssociatedTenantInner get(String billingAccountName, String associatedTenantName); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an associated tenant. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AssociatedTenantInner> beginCreateOrUpdate( + String billingAccountName, String associatedTenantName); + + /** + * 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 body An associated tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an associated tenant. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AssociatedTenantInner> beginCreateOrUpdate( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssociatedTenantInner createOrUpdate(String billingAccountName, String associatedTenantName); + + /** + * 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 body An associated tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssociatedTenantInner createOrUpdate( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body, Context context); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingManagementClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingManagementClient.java index 3f98daa9f4f35..283da86be0a0c 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingManagementClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingManagementClient.java @@ -10,18 +10,18 @@ /** The interface for BillingManagementClient class. */ public interface BillingManagementClient { /** - * Gets The ID that uniquely identifies an Azure subscription. + * Gets server parameter. * - * @return the subscriptionId value. + * @return the endpoint value. */ - String getSubscriptionId(); + String getEndpoint(); /** - * Gets server parameter. + * Gets Api Version. * - * @return the endpoint value. + * @return the apiVersion value. */ - String getEndpoint(); + String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. @@ -38,18 +38,18 @@ public interface BillingManagementClient { Duration getDefaultPollInterval(); /** - * Gets the BillingAccountsClient object to access its operations. + * Gets the AgreementsClient object to access its operations. * - * @return the BillingAccountsClient object. + * @return the AgreementsClient object. */ - BillingAccountsClient getBillingAccounts(); + AgreementsClient getAgreements(); /** - * Gets the AddressClient object to access its operations. + * Gets the AssociatedTenantsClient object to access its operations. * - * @return the AddressClient object. + * @return the AssociatedTenantsClient object. */ - AddressClient getAddress(); + AssociatedTenantsClient getAssociatedTenants(); /** * Gets the AvailableBalancesClient object to access its operations. @@ -59,11 +59,25 @@ public interface BillingManagementClient { AvailableBalancesClient getAvailableBalances(); /** - * Gets the InstructionsClient object to access its operations. + * Gets the BillingAccountsClient object to access its operations. * - * @return the InstructionsClient object. + * @return the BillingAccountsClient object. */ - InstructionsClient getInstructions(); + BillingAccountsClient getBillingAccounts(); + + /** + * Gets the AddressClient object to access its operations. + * + * @return the AddressClient object. + */ + AddressClient getAddress(); + + /** + * Gets the BillingPermissionsClient object to access its operations. + * + * @return the BillingPermissionsClient object. + */ + BillingPermissionsClient getBillingPermissions(); /** * Gets the BillingProfilesClient object to access its operations. @@ -73,25 +87,32 @@ public interface BillingManagementClient { BillingProfilesClient getBillingProfiles(); /** - * Gets the CustomersClient object to access its operations. + * Gets the BillingPropertiesClient object to access its operations. * - * @return the CustomersClient object. + * @return the BillingPropertiesClient object. */ - CustomersClient getCustomers(); + BillingPropertiesClient getBillingProperties(); /** - * Gets the InvoiceSectionsClient object to access its operations. + * Gets the BillingRequestsClient object to access its operations. * - * @return the InvoiceSectionsClient object. + * @return the BillingRequestsClient object. */ - InvoiceSectionsClient getInvoiceSections(); + BillingRequestsClient getBillingRequests(); /** - * Gets the BillingPermissionsClient object to access its operations. + * Gets the BillingRoleAssignmentsClient object to access its operations. * - * @return the BillingPermissionsClient object. + * @return the BillingRoleAssignmentsClient object. */ - BillingPermissionsClient getBillingPermissions(); + BillingRoleAssignmentsClient getBillingRoleAssignments(); + + /** + * Gets the BillingRoleDefinitionsClient object to access its operations. + * + * @return the BillingRoleDefinitionsClient object. + */ + BillingRoleDefinitionsClient getBillingRoleDefinitions(); /** * Gets the BillingSubscriptionsClient object to access its operations. @@ -101,60 +122,60 @@ public interface BillingManagementClient { BillingSubscriptionsClient getBillingSubscriptions(); /** - * Gets the ProductsClient object to access its operations. + * Gets the CustomersClient object to access its operations. * - * @return the ProductsClient object. + * @return the CustomersClient object. */ - ProductsClient getProducts(); + CustomersClient getCustomers(); /** - * Gets the InvoicesClient object to access its operations. + * Gets the InstructionsClient object to access its operations. * - * @return the InvoicesClient object. + * @return the InstructionsClient object. */ - InvoicesClient getInvoices(); + InstructionsClient getInstructions(); /** - * Gets the TransactionsClient object to access its operations. + * Gets the InvoicesClient object to access its operations. * - * @return the TransactionsClient object. + * @return the InvoicesClient object. */ - TransactionsClient getTransactions(); + InvoicesClient getInvoices(); /** - * Gets the PoliciesClient object to access its operations. + * Gets the InvoiceSectionsClient object to access its operations. * - * @return the PoliciesClient object. + * @return the InvoiceSectionsClient object. */ - PoliciesClient getPolicies(); + InvoiceSectionsClient getInvoiceSections(); /** - * Gets the BillingPropertiesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the BillingPropertiesClient object. + * @return the OperationsClient object. */ - BillingPropertiesClient getBillingProperties(); + OperationsClient getOperations(); /** - * Gets the BillingRoleDefinitionsClient object to access its operations. + * Gets the PaymentMethodsClient object to access its operations. * - * @return the BillingRoleDefinitionsClient object. + * @return the PaymentMethodsClient object. */ - BillingRoleDefinitionsClient getBillingRoleDefinitions(); + PaymentMethodsClient getPaymentMethods(); /** - * Gets the BillingRoleAssignmentsClient object to access its operations. + * Gets the PoliciesClient object to access its operations. * - * @return the BillingRoleAssignmentsClient object. + * @return the PoliciesClient object. */ - BillingRoleAssignmentsClient getBillingRoleAssignments(); + PoliciesClient getPolicies(); /** - * Gets the AgreementsClient object to access its operations. + * Gets the ProductsClient object to access its operations. * - * @return the AgreementsClient object. + * @return the ProductsClient object. */ - AgreementsClient getAgreements(); + ProductsClient getProducts(); /** * Gets the ReservationsClient object to access its operations. @@ -164,23 +185,9 @@ public interface BillingManagementClient { ReservationsClient getReservations(); /** - * Gets the EnrollmentAccountsClient object to access its operations. - * - * @return the EnrollmentAccountsClient object. - */ - EnrollmentAccountsClient getEnrollmentAccounts(); - - /** - * Gets the BillingPeriodsClient object to access its operations. - * - * @return the BillingPeriodsClient object. - */ - BillingPeriodsClient getBillingPeriods(); - - /** - * Gets the OperationsClient object to access its operations. + * Gets the TransactionsClient object to access its operations. * - * @return the OperationsClient object. + * @return the TransactionsClient object. */ - OperationsClient getOperations(); + TransactionsClient getTransactions(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPeriodsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPeriodsClient.java deleted file mode 100644 index 29b0f172ec4ba..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPeriodsClient.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; - -/** An instance of this class provides access to all the operations defined in BillingPeriodsClient. */ -public interface BillingPeriodsClient { - /** - * 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. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * 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 filter 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'. - * @param skiptoken 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. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, String skiptoken, Integer top, Context context); - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingPeriodName, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingPeriodInner get(String billingPeriodName); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPermissionsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPermissionsClient.java index 0cad08a5895b8..347a919dec522 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPermissionsClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPermissionsClient.java @@ -13,10 +13,9 @@ /** An instance of this class provides access to all the operations defined in BillingPermissionsClient. */ public interface BillingPermissionsClient { /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -24,13 +23,12 @@ public interface BillingPermissionsClient { * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer(String billingAccountName, String customerName); + PagedIterable listByBillingAccount(String billingAccountName); /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -39,13 +37,13 @@ public interface BillingPermissionsClient { * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context); + PagedIterable listByBillingAccount(String billingAccountName, Context context); /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -53,12 +51,14 @@ PagedIterable listByCustomer( * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName); /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -67,7 +67,8 @@ PagedIterable listByCustomer( * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, Context context); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context); /** * Lists the billing permissions the caller has on an invoice section. @@ -103,10 +104,10 @@ PagedIterable listByInvoiceSections( String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); /** - * Lists the billing permissions the caller has on a billing profile. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -114,14 +115,13 @@ PagedIterable listByInvoiceSections( * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName); + PagedIterable listByCustomer(String billingAccountName, String customerName); /** - * Lists the billing permissions the caller has on a billing profile. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -130,6 +130,6 @@ PagedIterable listByBillingProfile( * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); + PagedIterable listByCustomer( + String billingAccountName, String customerName, Context context); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingProfilesClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingProfilesClient.java index ad55bc8a26165..ad792dc303983 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingProfilesClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingProfilesClient.java @@ -11,7 +11,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner; /** An instance of this class provides access to all the operations defined in BillingProfilesClient. */ public interface BillingProfilesClient { @@ -26,7 +26,7 @@ public interface BillingProfilesClient { * @return the list of billing profiles as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByBillingAccount(String billingAccountName); /** * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with @@ -41,7 +41,8 @@ public interface BillingProfilesClient { * @return the list of billing profiles as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, String expand, Context context); + PagedIterable listByBillingAccount( + String billingAccountName, String expand, Context context); /** * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft @@ -57,7 +58,7 @@ public interface BillingProfilesClient { * @return a billing profile by its ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( + Response getWithResponse( String billingAccountName, String billingProfileName, String expand, Context context); /** @@ -72,7 +73,7 @@ Response getWithResponse( * @return a billing profile by its ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingProfileInner get(String billingAccountName, String billingProfileName); + BillingProfileAutoGeneratedInner get(String billingAccountName, String billingProfileName); /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type @@ -87,8 +88,8 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of a billing profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters); + SyncPoller, BillingProfileAutoGeneratedInner> beginCreateOrUpdate( + String billingAccountName, String billingProfileName, BillingProfileAutoGeneratedInner parameters); /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type @@ -104,8 +105,11 @@ SyncPoller, BillingProfileInner> beginCreateOrUp * @return the {@link SyncPoller} for polling of a billing profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context); + SyncPoller, BillingProfileAutoGeneratedInner> beginCreateOrUpdate( + String billingAccountName, + String billingProfileName, + BillingProfileAutoGeneratedInner parameters, + Context context); /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type @@ -120,8 +124,8 @@ SyncPoller, BillingProfileInner> beginCreateOrUp * @return a billing profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingProfileInner createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters); + BillingProfileAutoGeneratedInner createOrUpdate( + String billingAccountName, String billingProfileName, BillingProfileAutoGeneratedInner parameters); /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type @@ -137,6 +141,9 @@ BillingProfileInner createOrUpdate( * @return a billing profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingProfileInner createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context); + BillingProfileAutoGeneratedInner createOrUpdate( + String billingAccountName, + String billingProfileName, + BillingProfileAutoGeneratedInner parameters, + Context context); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPropertiesClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPropertiesClient.java index 70dcb91077fe7..4526eb0f3be43 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPropertiesClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPropertiesClient.java @@ -16,6 +16,7 @@ public interface BillingPropertiesClient { * Get the billing properties for a subscription. This operation is not supported for billing accounts with * agreement type Enterprise Agreement. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -23,23 +24,26 @@ public interface BillingPropertiesClient { * @return the billing properties for a subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); + Response getWithResponse(String subscriptionId, Context context); /** * Get the billing properties for a subscription. This operation is not supported for billing accounts with * agreement type Enterprise Agreement. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the billing properties for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingPropertyInner get(); + BillingPropertyInner get(String subscriptionId); /** * 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing property operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -48,12 +52,14 @@ public interface BillingPropertiesClient { * @return a billing property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(BillingPropertyInner parameters, Context context); + Response updateWithResponse( + String subscriptionId, BillingPropertyInner parameters, Context context); /** * 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing property operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -61,5 +67,5 @@ public interface BillingPropertiesClient { * @return a billing property. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingPropertyInner update(BillingPropertyInner parameters); + BillingPropertyInner update(String subscriptionId, BillingPropertyInner parameters); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRequestsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRequestsClient.java new file mode 100644 index 0000000000000..b7bc8426dcffc --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRequestsClient.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.billing.fluent.models.BillingRequestInner; + +/** An instance of this class provides access to all the operations defined in BillingRequestsClient. */ +public interface BillingRequestsClient { + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountName); + + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount( + String billingAccountName, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context); + + /** + * The list of billing requests submitted by a user. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByUser(); + + /** + * The list of billing requests submitted by a user. + * + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByUser( + String filter, String orderBy, Long top, Long skip, Boolean count, String search, Context context); + + /** + * Gets a billing request by its ID. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request by its ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String billingRequestName, Context context); + + /** + * Gets a billing request by its ID. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request by its ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BillingRequestInner get(String billingRequestName); + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a billing request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BillingRequestInner> beginCreateOrUpdate(String billingRequestName); + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a billing request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BillingRequestInner> beginCreateOrUpdate( + String billingRequestName, BillingRequestInner body, Context context); + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BillingRequestInner createOrUpdate(String billingRequestName); + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BillingRequestInner createOrUpdate(String billingRequestName, BillingRequestInner body, Context context); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleAssignmentsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleAssignmentsClient.java index 52f89a0a81f6f..3b24d879bc3b1 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleAssignmentsClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleAssignmentsClient.java @@ -14,40 +14,42 @@ /** An instance of this class provides access to all the operations defined in BillingRoleAssignmentsClient. */ public interface BillingRoleAssignmentsClient { /** - * 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 billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account along with {@link Response}. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName); /** - * 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 billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner getByBillingAccount(String billingAccountName, String billingRoleAssignmentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context); /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts + * 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. * * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -56,14 +58,15 @@ Response getByBillingAccountWithResponse( * @return the role assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context); + Response deleteByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -71,157 +74,158 @@ Response deleteByBillingAccountWithResponse( * @return the role assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName); + BillingRoleAssignmentInner deleteByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName); /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section along with {@link Response}. + * @return a role assignment for the caller on a billing profile along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context); + Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. + * @return a role assignment for the caller on a billing profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName); + BillingRoleAssignmentInner getByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName); /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response}. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName); /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner deleteByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); /** - * 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. + * Deletes 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile along with {@link Response}. + * @return the role assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); + Response deleteByInvoiceSectionWithResponse( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName, + Context context); /** - * 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. + * Deletes 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. + * @return the role assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName); + BillingRoleAssignmentInner deleteByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName); /** - * 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. + * 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response}. + * @return a role assignment for the caller on an invoice section along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); + Response getByInvoiceSectionWithResponse( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName, + Context context); /** - * 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. + * 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. + * @return a role assignment for the caller on an invoice section. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner deleteByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName); + BillingRoleAssignmentInner getByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName); /** * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts @@ -251,66 +255,62 @@ BillingRoleAssignmentInner deleteByBillingProfile( PagedIterable listByBillingAccount(String billingAccountName, Context context); /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return the role assignment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteByBillingAccountWithResponse( + String billingAccountName, String billingRoleAssignmentName, Context context); /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return the role assignment. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + BillingRoleAssignmentInner deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName); /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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. * * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return a role assignment for the caller on a billing account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByBillingAccountWithResponse( + String billingAccountName, String billingRoleAssignmentName, Context context); /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return a role assignment for the caller on a billing account. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + BillingRoleAssignmentInner getByBillingAccount(String billingAccountName, String billingRoleAssignmentName); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleDefinitionsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleDefinitionsClient.java index 6d961616bd0d1..539fdf28f8a66 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleDefinitionsClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleDefinitionsClient.java @@ -14,76 +14,35 @@ /** An instance of this class provides access to all the operations defined in BillingRoleDefinitionsClient. */ public interface BillingRoleDefinitionsClient { /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleDefinitionInner getByBillingAccount(String billingAccountName, String billingRoleDefinitionName); - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section along with {@link Response}. + * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName); /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. + * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleDefinitionInner getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context); /** * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with @@ -119,23 +78,28 @@ BillingRoleDefinitionInner getByBillingProfile( String billingAccountName, String billingProfileName, String billingRoleDefinitionName); /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of role definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName); /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -143,62 +107,69 @@ BillingRoleDefinitionInner getByBillingProfile( * @return the list of role definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, Context context); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); /** - * 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. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedIterable}. + * @return the definition for a role on an invoice section along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByInvoiceSectionWithResponse( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleDefinitionName, + Context context); /** - * 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. + * 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 context The context to associate with this operation. + * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedIterable}. + * @return the definition for a role on an invoice section. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + BillingRoleDefinitionInner getByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleDefinitionName); /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of role definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName); + PagedIterable listByBillingAccount(String billingAccountName); /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -206,6 +177,35 @@ PagedIterable listByBillingProfile( * @return the list of role definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); + PagedIterable listByBillingAccount(String billingAccountName, Context context); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the definition for a role on a billing account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByBillingAccountWithResponse( + String billingAccountName, String billingRoleDefinitionName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the definition for a role on a billing account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BillingRoleDefinitionInner getByBillingAccount(String billingAccountName, String billingRoleDefinitionName); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingSubscriptionsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingSubscriptionsClient.java index 6eb1ae8e6cc40..1cdf65b037579 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingSubscriptionsClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingSubscriptionsClient.java @@ -18,53 +18,25 @@ /** An instance of this class provides access to all the operations defined in BillingSubscriptionsClient. */ public interface BillingSubscriptionsClient { /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer(String billingAccountName, String customerName); - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context); - - /** - * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); /** - * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -72,28 +44,32 @@ PagedIterable listByCustomer( * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, Context context); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context); /** - * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName); /** - * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -101,32 +77,27 @@ PagedIterable listByCustomer( * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); /** - * 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 billing account. 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); + PagedIterable listByBillingAccount(String billingAccountName); /** - * 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 billing account. 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -134,14 +105,14 @@ PagedIterable listByInvoiceSection( * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); + PagedIterable listByBillingAccount(String billingAccountName, Context context); /** * Gets a subscription by its ID. 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -149,26 +120,29 @@ PagedIterable listByInvoiceSection( * @return a subscription by its ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountName, Context context); + Response getWithResponse( + String billingAccountName, String subscriptionId, Context context); /** * Gets a subscription by its ID. 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 subscriptionId The ID that uniquely identifies a billing subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a subscription by its ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingSubscriptionInner get(String billingAccountName); + BillingSubscriptionInner get(String billingAccountName, String subscriptionId); /** * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -178,13 +152,14 @@ PagedIterable listByInvoiceSection( */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, Context context); + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters, Context context); /** * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -192,7 +167,8 @@ Response updateWithResponse( * @return a billing subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingSubscriptionInner update(String billingAccountName, BillingSubscriptionInner parameters); + BillingSubscriptionInner update( + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters); /** * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing @@ -200,6 +176,7 @@ Response updateWithResponse( * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -208,7 +185,7 @@ Response updateWithResponse( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters); /** * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing @@ -216,6 +193,7 @@ SyncPoller, BillingSubscriptionInner> begin * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -225,7 +203,10 @@ SyncPoller, BillingSubscriptionInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context); /** * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing @@ -233,6 +214,7 @@ SyncPoller, BillingSubscriptionInner> begin * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -240,7 +222,8 @@ SyncPoller, BillingSubscriptionInner> begin * @return a billing subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - BillingSubscriptionInner move(String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); + BillingSubscriptionInner move( + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters); /** * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing @@ -248,6 +231,7 @@ SyncPoller, BillingSubscriptionInner> begin * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -257,13 +241,17 @@ SyncPoller, BillingSubscriptionInner> begin */ @ServiceMethod(returns = ReturnType.SINGLE) BillingSubscriptionInner move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context); /** * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the validate move eligibility operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -273,13 +261,17 @@ BillingSubscriptionInner move( */ @ServiceMethod(returns = ReturnType.SINGLE) Response validateMoveWithResponse( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context); /** * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the validate move eligibility operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -288,5 +280,35 @@ Response validateMoveWithRes */ @ServiceMethod(returns = ReturnType.SINGLE) ValidateSubscriptionTransferEligibilityResultInner validateMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCustomer(String billingAccountName, String customerName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCustomer( + String billingAccountName, String customerName, Context context); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/EnrollmentAccountsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/EnrollmentAccountsClient.java deleted file mode 100644 index 85926cd3b8cbb..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/EnrollmentAccountsClient.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; - -/** An instance of this class provides access to all the operations defined in EnrollmentAccountsClient. */ -public interface EnrollmentAccountsClient { - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String name, Context context); - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EnrollmentAccountSummaryInner get(String name); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoicesClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoicesClient.java index 5cff0be560ef1..c130ce91a7b44 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoicesClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoicesClient.java @@ -18,10 +18,11 @@ /** An instance of this class provides access to all the operations defined in InvoicesClient. */ public interface InvoicesClient { /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,14 +31,15 @@ public interface InvoicesClient { * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate); /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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 context The context to associate with this operation. @@ -47,15 +49,85 @@ PagedIterable listByBillingAccount( * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate, Context context); + PagedIterable listByBillingProfile( + String billingAccountName, + String billingProfileName, + String periodStartDate, + String periodEndDate, + Context context); /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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 downloadUrls An array of download urls for individual documents. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a URL to download multiple invoice documents (invoice pdf, tax + * receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( + String billingAccountName, List downloadUrls); + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a URL to download multiple invoice documents (invoice pdf, tax + * receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( + String billingAccountName, List downloadUrls, Context context); + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadMultipleBillingProfileInvoices(String billingAccountName, List downloadUrls); + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadMultipleBillingProfileInvoices( + String billingAccountName, List downloadUrls, Context context); + + /** + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -64,15 +136,14 @@ PagedIterable listByBillingAccount( * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate); + PagedIterable listByBillingAccount( + String billingAccountName, String periodStartDate, String periodEndDate); /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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. * * @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 context The context to associate with this operation. @@ -82,12 +153,8 @@ PagedIterable listByBillingProfile( * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context); + PagedIterable listByBillingAccount( + String billingAccountName, String periodStartDate, String periodEndDate, Context context); /** * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement @@ -118,33 +185,6 @@ PagedIterable listByBillingProfile( @ServiceMethod(returns = ReturnType.SINGLE) InvoiceInner get(String billingAccountName, String invoiceName); - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByIdWithResponse(String invoiceName, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InvoiceInner getById(String invoiceName); - /** * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft * Partner Agreement or Microsoft Customer Agreement. @@ -211,11 +251,9 @@ DownloadUrlInner downloadInvoice( String billingAccountName, String invoiceName, String downloadToken, Context context); /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -224,15 +262,13 @@ DownloadUrlInner downloadInvoice( * receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls); + SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( + String subscriptionId, List downloadUrls); /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -242,15 +278,13 @@ SyncPoller, DownloadUrlInner> beginDownloadMultiple * receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context); + SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( + String subscriptionId, List downloadUrls, Context context); /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -258,14 +292,12 @@ SyncPoller, DownloadUrlInner> beginDownloadMultiple * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadMultipleBillingProfileInvoices(String billingAccountName, List downloadUrls); + DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(String subscriptionId, List downloadUrls); /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -274,12 +306,13 @@ SyncPoller, DownloadUrlInner> beginDownloadMultiple * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context); + DownloadUrlInner downloadMultipleBillingSubscriptionInvoices( + String subscriptionId, List downloadUrls, Context context); /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -288,11 +321,13 @@ DownloadUrlInner downloadMultipleBillingProfileInvoices( * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate); + PagedIterable listByBillingSubscription( + String subscriptionId, String periodStartDate, String periodEndDate); /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @param context The context to associate with this operation. @@ -303,11 +338,12 @@ DownloadUrlInner downloadMultipleBillingProfileInvoices( */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingSubscription( - String periodStartDate, String periodEndDate, Context context); + String subscriptionId, String periodStartDate, String periodEndDate, Context context); /** * Gets an invoice by subscription ID and invoice ID. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -316,11 +352,13 @@ PagedIterable listByBillingSubscription( * @return an invoice by subscription ID and invoice ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, Context context); + Response getBySubscriptionAndInvoiceIdWithResponse( + String subscriptionId, String invoiceName, Context context); /** * Gets an invoice by subscription ID and invoice ID. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -328,11 +366,12 @@ PagedIterable listByBillingSubscription( * @return an invoice by subscription ID and invoice ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - InvoiceInner getBySubscriptionAndInvoiceId(String invoiceName); + InvoiceInner getBySubscriptionAndInvoiceId(String subscriptionId, String invoiceName); /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -342,11 +381,12 @@ PagedIterable listByBillingSubscription( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken); + String subscriptionId, String invoiceName, String downloadToken); /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @param context The context to associate with this operation. @@ -357,11 +397,12 @@ SyncPoller, DownloadUrlInner> beginDownloadBillingS */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken, Context context); + String subscriptionId, String invoiceName, String downloadToken, Context context); /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -370,11 +411,13 @@ SyncPoller, DownloadUrlInner> beginDownloadBillingS * @return a URL to download an invoice. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken); + DownloadUrlInner downloadBillingSubscriptionInvoice( + String subscriptionId, String invoiceName, String downloadToken); /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @param context The context to associate with this operation. @@ -384,59 +427,33 @@ SyncPoller, DownloadUrlInner> beginDownloadBillingS * @return a URL to download an invoice. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken, Context context); + DownloadUrlInner downloadBillingSubscriptionInvoice( + String subscriptionId, String invoiceName, String downloadToken, Context context); /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a URL to download multiple invoice documents (invoice pdf, tax - * receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( - List downloadUrls); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * - * @param downloadUrls An array of download urls for individual documents. + * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a URL to download multiple invoice documents (invoice pdf, tax - * receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( - List downloadUrls, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * @return an invoice by ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(List downloadUrls); + Response getByIdWithResponse(String invoiceName, Context context); /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. + * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * @return an invoice by ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(List downloadUrls, Context context); + InvoiceInner getById(String invoiceName); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/PaymentMethodsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/PaymentMethodsClient.java new file mode 100644 index 0000000000000..ff55a6edbedf0 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/PaymentMethodsClient.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodInner; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodLinkInner; + +/** An instance of this class provides access to all the operations defined in PaymentMethodsClient. */ +public interface PaymentMethodsClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method linked with a billing profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String paymentMethodName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method linked with a billing profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PaymentMethodLinkInner getByBillingProfile( + String billingAccountName, String billingProfileName, String paymentMethodName); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountName, Context context); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method available for a billing account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByBillingAccountWithResponse( + String billingAccountName, String paymentMethodName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method available for a billing account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PaymentMethodInner getByBillingAccount(String billingAccountName, String paymentMethodName); + + /** + * Lists the payment methods owned by the caller. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByUser(); + + /** + * Lists the payment methods owned by the caller. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByUser(Context context); + + /** + * Deletes a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteByUserWithResponse(String paymentMethodName, Context context); + + /** + * Deletes a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteByUser(String paymentMethodName); + + /** + * Gets a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method owned by the caller along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByUserWithResponse(String paymentMethodName, Context context); + + /** + * Gets a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method owned by the caller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PaymentMethodInner getByUser(String paymentMethodName); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ProductsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ProductsClient.java index 65148493ed64d..fee7fbb3665f2 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ProductsClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ProductsClient.java @@ -17,25 +17,31 @@ /** An instance of this class provides access to all the operations defined in ProductsClient. */ public interface ProductsClient { /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer(String billingAccountName, String customerName); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName); /** - * 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 filter 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 (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -43,26 +49,33 @@ public interface ProductsClient { * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer(String billingAccountName, String customerName, Context context); + PagedIterable listByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String filter, + Context context); /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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 filter 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 (:). @@ -73,31 +86,29 @@ public interface ProductsClient { * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, String filter, Context context); /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); + PagedIterable listByCustomer(String billingAccountName, String customerName); /** - * 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 filter 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 (:). + * @param customerName The ID that uniquely identifies a customer. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -105,32 +116,26 @@ public interface ProductsClient { * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String filter, Context context); + PagedIterable listByCustomer(String billingAccountName, String customerName, Context context); /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); + PagedIterable listByBillingAccount(String billingAccountName); /** - * 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 filter 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 (:). @@ -141,12 +146,7 @@ PagedIterable listByInvoiceSection( * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context); + PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context); /** * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ReservationsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ReservationsClient.java index c6c8707457dd5..3e72c3a97d586 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ReservationsClient.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ReservationsClient.java @@ -13,9 +13,10 @@ /** An instance of this class provides access to all the operations defined in ReservationsClient. */ public interface ReservationsClient { /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -23,17 +24,18 @@ public interface ReservationsClient { * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. + * state. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -43,8 +45,9 @@ public interface ReservationsClient { * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount( + PagedIterable listByBillingProfile( String billingAccountName, + String billingProfileName, String filter, String orderby, String refreshSummary, @@ -52,10 +55,9 @@ PagedIterable listByBillingAccount( Context context); /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -63,18 +65,17 @@ PagedIterable listByBillingAccount( * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); + PagedIterable listByBillingAccount(String billingAccountName); /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. + * states. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -84,9 +85,8 @@ PagedIterable listByBillingAccount( * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( + PagedIterable listByBillingAccount( String billingAccountName, - String billingProfileName, String filter, String orderby, String refreshSummary, diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementInner.java index 9c5337fc4a921..9232c2b446cf0 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.models.AcceptanceMode; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.BillingProfileInfo; import com.azure.resourcemanager.billing.models.Category; import com.azure.resourcemanager.billing.models.Participants; @@ -16,7 +16,7 @@ /** An agreement. */ @Fluent -public final class AgreementInner extends ProxyResource { +public final class AgreementInner extends ArmResource { /* * The properties of an agreement. */ @@ -37,30 +37,21 @@ private AgreementProperties innerProperties() { } /** - * Get the agreementLink property: The URL to download the agreement. - * - * @return the agreementLink value. - */ - public String agreementLink() { - return this.innerProperties() == null ? null : this.innerProperties().agreementLink(); - } - - /** - * Get the category property: The category of the agreement signed by a customer. + * Get the acceptanceMode property: The mode of acceptance for an agreement. * - * @return the category value. + * @return the acceptanceMode value. */ - public Category category() { - return this.innerProperties() == null ? null : this.innerProperties().category(); + public AcceptanceMode acceptanceMode() { + return this.innerProperties() == null ? null : this.innerProperties().acceptanceMode(); } /** - * Get the acceptanceMode property: The mode of acceptance for an agreement. + * Get the agreementLink property: The URL to download the agreement. * - * @return the acceptanceMode value. + * @return the agreementLink value. */ - public AcceptanceMode acceptanceMode() { - return this.innerProperties() == null ? null : this.innerProperties().acceptanceMode(); + public String agreementLink() { + return this.innerProperties() == null ? null : this.innerProperties().agreementLink(); } /** @@ -73,6 +64,15 @@ public BillingProfileInfo billingProfileInfo() { return this.innerProperties() == null ? null : this.innerProperties().billingProfileInfo(); } + /** + * Get the category property: The category of the agreement signed by a customer. + * + * @return the category value. + */ + public Category category() { + return this.innerProperties() == null ? null : this.innerProperties().category(); + } + /** * Get the effectiveDate property: The date from which the agreement is effective. * @@ -128,7 +128,9 @@ public String status() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementProperties.java index 4b7f36d5a52df..6d3af41fd102a 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementProperties.java @@ -16,30 +16,30 @@ /** The properties of an agreement. */ @Fluent public final class AgreementProperties { - /* - * The URL to download the agreement. - */ - @JsonProperty(value = "agreementLink", access = JsonProperty.Access.WRITE_ONLY) - private String agreementLink; - - /* - * The category of the agreement signed by a customer. - */ - @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) - private Category category; - /* * The mode of acceptance for an agreement. */ @JsonProperty(value = "acceptanceMode", access = JsonProperty.Access.WRITE_ONLY) private AcceptanceMode acceptanceMode; + /* + * The URL to download the agreement. + */ + @JsonProperty(value = "agreementLink", access = JsonProperty.Access.WRITE_ONLY) + private String agreementLink; + /* * The list of billing profiles associated with agreement and present only for specific agreements. */ @JsonProperty(value = "billingProfileInfo", access = JsonProperty.Access.WRITE_ONLY) private BillingProfileInfo billingProfileInfo; + /* + * The category of the agreement signed by a customer. + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private Category category; + /* * The date from which the agreement is effective. */ @@ -69,30 +69,21 @@ public AgreementProperties() { } /** - * Get the agreementLink property: The URL to download the agreement. - * - * @return the agreementLink value. - */ - public String agreementLink() { - return this.agreementLink; - } - - /** - * Get the category property: The category of the agreement signed by a customer. + * Get the acceptanceMode property: The mode of acceptance for an agreement. * - * @return the category value. + * @return the acceptanceMode value. */ - public Category category() { - return this.category; + public AcceptanceMode acceptanceMode() { + return this.acceptanceMode; } /** - * Get the acceptanceMode property: The mode of acceptance for an agreement. + * Get the agreementLink property: The URL to download the agreement. * - * @return the acceptanceMode value. + * @return the agreementLink value. */ - public AcceptanceMode acceptanceMode() { - return this.acceptanceMode; + public String agreementLink() { + return this.agreementLink; } /** @@ -105,6 +96,15 @@ public BillingProfileInfo billingProfileInfo() { return this.billingProfileInfo; } + /** + * Get the category property: The category of the agreement signed by a customer. + * + * @return the category value. + */ + public Category category() { + return this.category; + } + /** * Get the effectiveDate property: The date from which the agreement is effective. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AssociatedTenantInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AssociatedTenantInner.java new file mode 100644 index 0000000000000..300e87c840cd9 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AssociatedTenantInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.models.ArmResource; +import com.azure.resourcemanager.billing.models.BillingManagementTenantState; +import com.azure.resourcemanager.billing.models.ProvisioningTenantState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An associated tenant. */ +@Fluent +public final class AssociatedTenantInner extends ArmResource { + /* + * The properties of a(n) AssociatedTenant + */ + @JsonProperty(value = "properties") + private AssociatedTenantProperties innerProperties; + + /** Creates an instance of AssociatedTenantInner class. */ + public AssociatedTenantInner() { + } + + /** + * Get the innerProperties property: The properties of a(n) AssociatedTenant. + * + * @return the innerProperties value. + */ + private AssociatedTenantProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the friendlyName property: The friendly name assigned to the associated tenant. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: The friendly name assigned to the associated tenant. + * + * @param friendlyName the friendlyName value to set. + * @return the AssociatedTenantInner object itself. + */ + public AssociatedTenantInner withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new AssociatedTenantProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the tenantId property: The ID that uniquely identifies a tenant. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: The ID that uniquely identifies a tenant. + * + * @param tenantId the tenantId value to set. + * @return the AssociatedTenantInner object itself. + */ + public AssociatedTenantInner withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new AssociatedTenantProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Get the billingManagementState property: 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. + * + * @return the billingManagementState value. + */ + public BillingManagementTenantState billingManagementState() { + return this.innerProperties() == null ? null : this.innerProperties().billingManagementState(); + } + + /** + * Set the billingManagementState property: 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. + * + * @param billingManagementState the billingManagementState value to set. + * @return the AssociatedTenantInner object itself. + */ + public AssociatedTenantInner withBillingManagementState(BillingManagementTenantState billingManagementState) { + if (this.innerProperties() == null) { + this.innerProperties = new AssociatedTenantProperties(); + } + this.innerProperties().withBillingManagementState(billingManagementState); + return this; + } + + /** + * Get the provisioningState property: The state determines whether subscriptions and licenses can be provisioned in + * the associated tenant. It can be set as 'Pending' from null, null from 'Pending', or null from 'Active'. + * + * @return the provisioningState value. + */ + public ProvisioningTenantState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The state determines whether subscriptions and licenses can be provisioned in + * the associated tenant. It can be set as 'Pending' from null, null from 'Pending', or null from 'Active'. + * + * @param provisioningState the provisioningState value to set. + * @return the AssociatedTenantInner object itself. + */ + public AssociatedTenantInner withProvisioningState(ProvisioningTenantState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new AssociatedTenantProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the provisioningBillingRequestId property: The unique identifier for the billing request that is created when + * enabling provisioning for an associated tenant. + * + * @return the provisioningBillingRequestId value. + */ + public String provisioningBillingRequestId() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningBillingRequestId(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AssociatedTenantProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AssociatedTenantProperties.java new file mode 100644 index 0000000000000..faa2223e0a265 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AssociatedTenantProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.models.AssociatedTenantPropertiesAutoGenerated; +import com.azure.resourcemanager.billing.models.BillingManagementTenantState; +import com.azure.resourcemanager.billing.models.ProvisioningTenantState; + +/** The properties of a(n) AssociatedTenant. */ +@Fluent +public final class AssociatedTenantProperties extends AssociatedTenantPropertiesAutoGenerated { + /** Creates an instance of AssociatedTenantProperties class. */ + public AssociatedTenantProperties() { + } + + /** {@inheritDoc} */ + @Override + public AssociatedTenantProperties withFriendlyName(String friendlyName) { + super.withFriendlyName(friendlyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AssociatedTenantProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AssociatedTenantProperties withBillingManagementState(BillingManagementTenantState billingManagementState) { + super.withBillingManagementState(billingManagementState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AssociatedTenantProperties withProvisioningState(ProvisioningTenantState provisioningState) { + super.withProvisioningState(provisioningState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceInner.java index 9347e9d2c5a5c..a5861d731f277 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceInner.java @@ -5,13 +5,13 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.models.Amount; +import com.azure.resourcemanager.billing.models.ArmResource; import com.fasterxml.jackson.annotation.JsonProperty; /** The latest Azure credit balance. This is the balance available for pay now. */ @Immutable -public final class AvailableBalanceInner extends ProxyResource { +public final class AvailableBalanceInner extends ArmResource { /* * The properties of available balance. */ @@ -45,7 +45,9 @@ public Amount amount() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountInner.java index 9286c56cddee5..ea1a75bd9bdad 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountInner.java @@ -5,11 +5,11 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.models.AccountStatus; import com.azure.resourcemanager.billing.models.AccountType; import com.azure.resourcemanager.billing.models.AddressDetails; import com.azure.resourcemanager.billing.models.AgreementType; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.BillingProfilesOnExpand; import com.azure.resourcemanager.billing.models.Department; import com.azure.resourcemanager.billing.models.Enrollment; @@ -19,7 +19,7 @@ /** A billing account. */ @Fluent -public final class BillingAccountInner extends ProxyResource { +public final class BillingAccountInner extends ArmResource { /* * The properties of the billing account. */ @@ -40,60 +40,12 @@ private BillingAccountProperties innerProperties() { } /** - * Get the displayName property: The billing account name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The billing account name. - * - * @param displayName the displayName value to set. - * @return the BillingAccountInner object itself. - */ - public BillingAccountInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @return the soldTo value. - */ - public AddressDetails soldTo() { - return this.innerProperties() == null ? null : this.innerProperties().soldTo(); - } - - /** - * Set the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @param soldTo the soldTo value to set. - * @return the BillingAccountInner object itself. - */ - public BillingAccountInner withSoldTo(AddressDetails soldTo) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withSoldTo(soldTo); - return this; - } - - /** - * Get the agreementType property: The type of agreement. + * Get the accountStatus property: The current status of the billing account. * - * @return the agreementType value. + * @return the accountStatus value. */ - public AgreementType agreementType() { - return this.innerProperties() == null ? null : this.innerProperties().agreementType(); + public AccountStatus accountStatus() { + return this.innerProperties() == null ? null : this.innerProperties().accountStatus(); } /** @@ -106,12 +58,12 @@ public AccountType accountType() { } /** - * Get the accountStatus property: The current status of the billing account. + * Get the agreementType property: The type of agreement. * - * @return the accountStatus value. + * @return the agreementType value. */ - public AccountStatus accountStatus() { - return this.innerProperties() == null ? null : this.innerProperties().accountStatus(); + public AgreementType agreementType() { + return this.innerProperties() == null ? null : this.innerProperties().agreementType(); } /** @@ -139,16 +91,6 @@ public BillingAccountInner withBillingProfiles(BillingProfilesOnExpand billingPr return this; } - /** - * Get the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not - * populated, unless it's specified in $expand. - * - * @return the enrollmentDetails value. - */ - public Enrollment enrollmentDetails() { - return this.innerProperties() == null ? null : this.innerProperties().enrollmentDetails(); - } - /** * Get the departments property: The departments associated to the enrollment. * @@ -172,6 +114,29 @@ public BillingAccountInner withDepartments(List departments) { return this; } + /** + * Get the displayName property: The billing account name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The billing account name. + * + * @param displayName the displayName value to set. + * @return the BillingAccountInner object itself. + */ + public BillingAccountInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingAccountProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + /** * Get the enrollmentAccounts property: The accounts associated to the enrollment. * @@ -195,6 +160,16 @@ public BillingAccountInner withEnrollmentAccounts(List enroll return this; } + /** + * Get the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not + * populated, unless it's specified in $expand. + * + * @return the enrollmentDetails value. + */ + public Enrollment enrollmentDetails() { + return this.innerProperties() == null ? null : this.innerProperties().enrollmentDetails(); + } + /** * Get the hasReadAccess property: Indicates whether user has read access to the billing account. * @@ -227,12 +202,39 @@ public BillingAccountInner withNotificationEmailAddress(String notificationEmail return this; } + /** + * Get the soldTo property: The address of the individual or organization that is responsible for the billing + * account. + * + * @return the soldTo value. + */ + public AddressDetails soldTo() { + return this.innerProperties() == null ? null : this.innerProperties().soldTo(); + } + + /** + * Set the soldTo property: The address of the individual or organization that is responsible for the billing + * account. + * + * @param soldTo the soldTo value to set. + * @return the BillingAccountInner object itself. + */ + public BillingAccountInner withSoldTo(AddressDetails soldTo) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingAccountProperties(); + } + this.innerProperties().withSoldTo(soldTo); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountProperties.java index 22015daa5cb42..6942457ce9b90 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountProperties.java @@ -20,22 +20,10 @@ @Fluent public final class BillingAccountProperties { /* - * The billing account name. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The address of the individual or organization that is responsible for the billing account. - */ - @JsonProperty(value = "soldTo") - private AddressDetails soldTo; - - /* - * The type of agreement. + * The current status of the billing account. */ - @JsonProperty(value = "agreementType", access = JsonProperty.Access.WRITE_ONLY) - private AgreementType agreementType; + @JsonProperty(value = "accountStatus", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus accountStatus; /* * The type of customer. @@ -44,10 +32,10 @@ public final class BillingAccountProperties { private AccountType accountType; /* - * The current status of the billing account. + * The type of agreement. */ - @JsonProperty(value = "accountStatus", access = JsonProperty.Access.WRITE_ONLY) - private AccountStatus accountStatus; + @JsonProperty(value = "agreementType", access = JsonProperty.Access.WRITE_ONLY) + private AgreementType agreementType; /* * The billing profiles associated with the billing account. By default this is not populated, unless it's @@ -56,25 +44,31 @@ public final class BillingAccountProperties { @JsonProperty(value = "billingProfiles") private BillingProfilesOnExpand billingProfiles; - /* - * The details about the associated legacy enrollment. By default this is not populated, unless it's specified in - * $expand. - */ - @JsonProperty(value = "enrollmentDetails", access = JsonProperty.Access.WRITE_ONLY) - private Enrollment enrollmentDetails; - /* * The departments associated to the enrollment. */ @JsonProperty(value = "departments") private List departments; + /* + * The billing account name. + */ + @JsonProperty(value = "displayName") + private String displayName; + /* * The accounts associated to the enrollment. */ @JsonProperty(value = "enrollmentAccounts") private List enrollmentAccounts; + /* + * The details about the associated legacy enrollment. By default this is not populated, unless it's specified in + * $expand. + */ + @JsonProperty(value = "enrollmentDetails", access = JsonProperty.Access.WRITE_ONLY) + private Enrollment enrollmentDetails; + /* * Indicates whether user has read access to the billing account. */ @@ -87,59 +81,23 @@ public final class BillingAccountProperties { @JsonProperty(value = "notificationEmailAddress") private String notificationEmailAddress; - /** Creates an instance of BillingAccountProperties class. */ - public BillingAccountProperties() { - } - - /** - * Get the displayName property: The billing account name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The billing account name. - * - * @param displayName the displayName value to set. - * @return the BillingAccountProperties object itself. - */ - public BillingAccountProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @return the soldTo value. + /* + * The address of the individual or organization that is responsible for the billing account. */ - public AddressDetails soldTo() { - return this.soldTo; - } + @JsonProperty(value = "soldTo") + private AddressDetails soldTo; - /** - * Set the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @param soldTo the soldTo value to set. - * @return the BillingAccountProperties object itself. - */ - public BillingAccountProperties withSoldTo(AddressDetails soldTo) { - this.soldTo = soldTo; - return this; + /** Creates an instance of BillingAccountProperties class. */ + public BillingAccountProperties() { } /** - * Get the agreementType property: The type of agreement. + * Get the accountStatus property: The current status of the billing account. * - * @return the agreementType value. + * @return the accountStatus value. */ - public AgreementType agreementType() { - return this.agreementType; + public AccountStatus accountStatus() { + return this.accountStatus; } /** @@ -152,12 +110,12 @@ public AccountType accountType() { } /** - * Get the accountStatus property: The current status of the billing account. + * Get the agreementType property: The type of agreement. * - * @return the accountStatus value. + * @return the agreementType value. */ - public AccountStatus accountStatus() { - return this.accountStatus; + public AgreementType agreementType() { + return this.agreementType; } /** @@ -182,16 +140,6 @@ public BillingAccountProperties withBillingProfiles(BillingProfilesOnExpand bill return this; } - /** - * Get the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not - * populated, unless it's specified in $expand. - * - * @return the enrollmentDetails value. - */ - public Enrollment enrollmentDetails() { - return this.enrollmentDetails; - } - /** * Get the departments property: The departments associated to the enrollment. * @@ -212,6 +160,26 @@ public BillingAccountProperties withDepartments(List departments) { return this; } + /** + * Get the displayName property: The billing account name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The billing account name. + * + * @param displayName the displayName value to set. + * @return the BillingAccountProperties object itself. + */ + public BillingAccountProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + /** * Get the enrollmentAccounts property: The accounts associated to the enrollment. * @@ -232,6 +200,16 @@ public BillingAccountProperties withEnrollmentAccounts(List e return this; } + /** + * Get the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not + * populated, unless it's specified in $expand. + * + * @return the enrollmentDetails value. + */ + public Enrollment enrollmentDetails() { + return this.enrollmentDetails; + } + /** * Get the hasReadAccess property: Indicates whether user has read access to the billing account. * @@ -261,26 +239,48 @@ public BillingAccountProperties withNotificationEmailAddress(String notification return this; } + /** + * Get the soldTo property: The address of the individual or organization that is responsible for the billing + * account. + * + * @return the soldTo value. + */ + public AddressDetails soldTo() { + return this.soldTo; + } + + /** + * Set the soldTo property: The address of the individual or organization that is responsible for the billing + * account. + * + * @param soldTo the soldTo value to set. + * @return the BillingAccountProperties object itself. + */ + public BillingAccountProperties withSoldTo(AddressDetails soldTo) { + this.soldTo = soldTo; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (soldTo() != null) { - soldTo().validate(); - } if (billingProfiles() != null) { billingProfiles().validate(); } - if (enrollmentDetails() != null) { - enrollmentDetails().validate(); - } if (departments() != null) { departments().forEach(e -> e.validate()); } if (enrollmentAccounts() != null) { enrollmentAccounts().forEach(e -> e.validate()); } + if (enrollmentDetails() != null) { + enrollmentDetails().validate(); + } + if (soldTo() != null) { + soldTo().validate(); + } } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodInner.java deleted file mode 100644 index b1b0fc91723a8..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodInner.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.LocalDate; -import java.util.List; - -/** A billing period resource. */ -@Immutable -public final class BillingPeriodInner extends ProxyResource { - /* - * A billing period. - */ - @JsonProperty(value = "properties") - private BillingPeriodProperties innerProperties; - - /** Creates an instance of BillingPeriodInner class. */ - public BillingPeriodInner() { - } - - /** - * Get the innerProperties property: A billing period. - * - * @return the innerProperties value. - */ - private BillingPeriodProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the billingPeriodStartDate property: The start of the date range covered by the billing period. - * - * @return the billingPeriodStartDate value. - */ - public LocalDate billingPeriodStartDate() { - return this.innerProperties() == null ? null : this.innerProperties().billingPeriodStartDate(); - } - - /** - * Get the billingPeriodEndDate property: The end of the date range covered by the billing period. - * - * @return the billingPeriodEndDate value. - */ - public LocalDate billingPeriodEndDate() { - return this.innerProperties() == null ? null : this.innerProperties().billingPeriodEndDate(); - } - - /** - * Get the invoiceIds property: Array of invoice ids that associated with. - * - * @return the invoiceIds value. - */ - public List invoiceIds() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceIds(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodProperties.java deleted file mode 100644 index 01f2338ac0aa1..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodProperties.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.LocalDate; -import java.util.List; - -/** The properties of the billing period. */ -@Immutable -public final class BillingPeriodProperties { - /* - * The start of the date range covered by the billing period. - */ - @JsonProperty(value = "billingPeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) - private LocalDate billingPeriodStartDate; - - /* - * The end of the date range covered by the billing period. - */ - @JsonProperty(value = "billingPeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) - private LocalDate billingPeriodEndDate; - - /* - * Array of invoice ids that associated with. - */ - @JsonProperty(value = "invoiceIds", access = JsonProperty.Access.WRITE_ONLY) - private List invoiceIds; - - /** Creates an instance of BillingPeriodProperties class. */ - public BillingPeriodProperties() { - } - - /** - * Get the billingPeriodStartDate property: The start of the date range covered by the billing period. - * - * @return the billingPeriodStartDate value. - */ - public LocalDate billingPeriodStartDate() { - return this.billingPeriodStartDate; - } - - /** - * Get the billingPeriodEndDate property: The end of the date range covered by the billing period. - * - * @return the billingPeriodEndDate value. - */ - public LocalDate billingPeriodEndDate() { - return this.billingPeriodEndDate; - } - - /** - * Get the invoiceIds property: Array of invoice ids that associated with. - * - * @return the invoiceIds value. - */ - public List invoiceIds() { - return this.invoiceIds; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileAutoGeneratedInner.java similarity index 80% rename from sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileInner.java rename to sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileAutoGeneratedInner.java index fb7c22f890d4e..4da888347cdc3 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileAutoGeneratedInner.java @@ -5,13 +5,13 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.models.AddressDetails; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.AzurePlan; import com.azure.resourcemanager.billing.models.BillingProfileStatus; import com.azure.resourcemanager.billing.models.BillingRelationshipType; import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo; -import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpand; +import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpandAutoGenerated; import com.azure.resourcemanager.billing.models.SpendingLimit; import com.azure.resourcemanager.billing.models.StatusReasonCode; import com.azure.resourcemanager.billing.models.TargetCloud; @@ -21,15 +21,15 @@ /** A billing profile. */ @Fluent -public final class BillingProfileInner extends ProxyResource { +public final class BillingProfileAutoGeneratedInner extends ArmResource { /* * The properties of the billing profile. */ @JsonProperty(value = "properties") - private BillingProfileProperties innerProperties; + private BillingProfilePropertiesAutoGenerated innerProperties; - /** Creates an instance of BillingProfileInner class. */ - public BillingProfileInner() { + /** Creates an instance of BillingProfileAutoGeneratedInner class. */ + public BillingProfileAutoGeneratedInner() { } /** @@ -37,163 +37,147 @@ public BillingProfileInner() { * * @return the innerProperties value. */ - private BillingProfileProperties innerProperties() { + private BillingProfilePropertiesAutoGenerated innerProperties() { return this.innerProperties; } /** - * Get the displayName property: The name of the billing profile. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The name of the billing profile. + * Get the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. * - * @param displayName the displayName value to set. - * @return the BillingProfileInner object itself. + * @return the billingRelationshipType value. */ - public BillingProfileInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; + public BillingRelationshipType billingRelationshipType() { + return this.innerProperties() == null ? null : this.innerProperties().billingRelationshipType(); } /** - * Get the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. + * Get the billTo property: Billing address. * - * @return the poNumber value. + * @return the billTo value. */ - public String poNumber() { - return this.innerProperties() == null ? null : this.innerProperties().poNumber(); + public AddressDetails billTo() { + return this.innerProperties() == null ? null : this.innerProperties().billTo(); } /** - * Set the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. + * Set the billTo property: Billing address. * - * @param poNumber the poNumber value to set. - * @return the BillingProfileInner object itself. + * @param billTo the billTo value to set. + * @return the BillingProfileAutoGeneratedInner object itself. */ - public BillingProfileInner withPoNumber(String poNumber) { + public BillingProfileAutoGeneratedInner withBillTo(AddressDetails billTo) { if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); + this.innerProperties = new BillingProfilePropertiesAutoGenerated(); } - this.innerProperties().withPoNumber(poNumber); + this.innerProperties().withBillTo(billTo); return this; } /** - * Get the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. + * Get the currency property: The currency in which the charges for the billing profile are billed. * - * @return the billingRelationshipType value. + * @return the currency value. */ - public BillingRelationshipType billingRelationshipType() { - return this.innerProperties() == null ? null : this.innerProperties().billingRelationshipType(); + public String currency() { + return this.innerProperties() == null ? null : this.innerProperties().currency(); } /** - * Get the billTo property: Billing address. + * Get the displayName property: The name of the billing profile. * - * @return the billTo value. + * @return the displayName value. */ - public AddressDetails billTo() { - return this.innerProperties() == null ? null : this.innerProperties().billTo(); + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** - * Set the billTo property: Billing address. + * Set the displayName property: The name of the billing profile. * - * @param billTo the billTo value to set. - * @return the BillingProfileInner object itself. + * @param displayName the displayName value to set. + * @return the BillingProfileAutoGeneratedInner object itself. */ - public BillingProfileInner withBillTo(AddressDetails billTo) { + public BillingProfileAutoGeneratedInner withDisplayName(String displayName) { if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); + this.innerProperties = new BillingProfilePropertiesAutoGenerated(); } - this.innerProperties().withBillTo(billTo); + this.innerProperties().withDisplayName(displayName); return this; } /** - * Get the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing - * profile in indirect purchase motion. + * Get the enabledAzurePlans property: Information about the enabled azure plans. * - * @return the indirectRelationshipInfo value. + * @return the enabledAzurePlans value. */ - public IndirectRelationshipInfo indirectRelationshipInfo() { - return this.innerProperties() == null ? null : this.innerProperties().indirectRelationshipInfo(); + public List enabledAzurePlans() { + return this.innerProperties() == null ? null : this.innerProperties().enabledAzurePlans(); } /** - * Get the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent - * through email. + * Set the enabledAzurePlans property: Information about the enabled azure plans. * - * @return the invoiceEmailOptIn value. + * @param enabledAzurePlans the enabledAzurePlans value to set. + * @return the BillingProfileAutoGeneratedInner object itself. */ - public Boolean invoiceEmailOptIn() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceEmailOptIn(); + public BillingProfileAutoGeneratedInner withEnabledAzurePlans(List enabledAzurePlans) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingProfilePropertiesAutoGenerated(); + } + this.innerProperties().withEnabledAzurePlans(enabledAzurePlans); + return this; } /** - * Set the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent - * through email. + * Get the hasReadAccess property: Indicates whether user has read access to the billing profile. * - * @param invoiceEmailOptIn the invoiceEmailOptIn value to set. - * @return the BillingProfileInner object itself. + * @return the hasReadAccess value. */ - public BillingProfileInner withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); - } - this.innerProperties().withInvoiceEmailOptIn(invoiceEmailOptIn); - return this; + public Boolean hasReadAccess() { + return this.innerProperties() == null ? null : this.innerProperties().hasReadAccess(); } /** - * Get the invoiceDay property: The day of the month when the invoice for the billing profile is generated. + * Get the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing + * profile in indirect purchase motion. * - * @return the invoiceDay value. + * @return the indirectRelationshipInfo value. */ - public Integer invoiceDay() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceDay(); + public IndirectRelationshipInfo indirectRelationshipInfo() { + return this.innerProperties() == null ? null : this.innerProperties().indirectRelationshipInfo(); } /** - * Get the currency property: The currency in which the charges for the billing profile are billed. + * Get the invoiceDay property: The day of the month when the invoice for the billing profile is generated. * - * @return the currency value. + * @return the invoiceDay value. */ - public String currency() { - return this.innerProperties() == null ? null : this.innerProperties().currency(); + public Integer invoiceDay() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceDay(); } /** - * Get the enabledAzurePlans property: Information about the enabled azure plans. + * Get the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent + * through email. * - * @return the enabledAzurePlans value. + * @return the invoiceEmailOptIn value. */ - public List enabledAzurePlans() { - return this.innerProperties() == null ? null : this.innerProperties().enabledAzurePlans(); + public Boolean invoiceEmailOptIn() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceEmailOptIn(); } /** - * Set the enabledAzurePlans property: Information about the enabled azure plans. + * Set the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent + * through email. * - * @param enabledAzurePlans the enabledAzurePlans value to set. - * @return the BillingProfileInner object itself. + * @param invoiceEmailOptIn the invoiceEmailOptIn value to set. + * @return the BillingProfileAutoGeneratedInner object itself. */ - public BillingProfileInner withEnabledAzurePlans(List enabledAzurePlans) { + public BillingProfileAutoGeneratedInner withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); + this.innerProperties = new BillingProfilePropertiesAutoGenerated(); } - this.innerProperties().withEnabledAzurePlans(enabledAzurePlans); + this.innerProperties().withInvoiceEmailOptIn(invoiceEmailOptIn); return this; } @@ -203,7 +187,7 @@ public BillingProfileInner withEnabledAzurePlans(List enabledAzurePla * * @return the invoiceSections value. */ - public InvoiceSectionsOnExpand invoiceSections() { + public InvoiceSectionsOnExpandAutoGenerated invoiceSections() { return this.innerProperties() == null ? null : this.innerProperties().invoiceSections(); } @@ -212,32 +196,48 @@ public InvoiceSectionsOnExpand invoiceSections() { * populated, unless it's specified in $expand. * * @param invoiceSections the invoiceSections value to set. - * @return the BillingProfileInner object itself. + * @return the BillingProfileAutoGeneratedInner object itself. */ - public BillingProfileInner withInvoiceSections(InvoiceSectionsOnExpand invoiceSections) { + public BillingProfileAutoGeneratedInner withInvoiceSections(InvoiceSectionsOnExpandAutoGenerated invoiceSections) { if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); + this.innerProperties = new BillingProfilePropertiesAutoGenerated(); } this.innerProperties().withInvoiceSections(invoiceSections); return this; } /** - * Get the hasReadAccess property: Indicates whether user has read access to the billing profile. + * Get the poNumber property: The purchase order name that will appear on the invoices generated for the billing + * profile. * - * @return the hasReadAccess value. + * @return the poNumber value. */ - public Boolean hasReadAccess() { - return this.innerProperties() == null ? null : this.innerProperties().hasReadAccess(); + public String poNumber() { + return this.innerProperties() == null ? null : this.innerProperties().poNumber(); } /** - * Get the systemId property: The system generated unique identifier for a billing profile. + * Set the poNumber property: The purchase order name that will appear on the invoices generated for the billing + * profile. * - * @return the systemId value. + * @param poNumber the poNumber value to set. + * @return the BillingProfileAutoGeneratedInner object itself. */ - public String systemId() { - return this.innerProperties() == null ? null : this.innerProperties().systemId(); + public BillingProfileAutoGeneratedInner withPoNumber(String poNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingProfilePropertiesAutoGenerated(); + } + this.innerProperties().withPoNumber(poNumber); + return this; + } + + /** + * Get the spendingLimit property: The billing profile spending limit. + * + * @return the spendingLimit value. + */ + public SpendingLimit spendingLimit() { + return this.innerProperties() == null ? null : this.innerProperties().spendingLimit(); } /** @@ -259,23 +259,12 @@ public StatusReasonCode statusReasonCode() { } /** - * Get the spendingLimit property: The billing profile spending limit. - * - * @return the spendingLimit value. - */ - public SpendingLimit spendingLimit() { - return this.innerProperties() == null ? null : this.innerProperties().spendingLimit(); - } - - /** - * Get the targetClouds property: 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. + * Get the systemId property: The system generated unique identifier for a billing profile. * - * @return the targetClouds value. + * @return the systemId value. */ - public List targetClouds() { - return this.innerProperties() == null ? null : this.innerProperties().targetClouds(); + public String systemId() { + return this.innerProperties() == null ? null : this.innerProperties().systemId(); } /** @@ -291,22 +280,35 @@ public Map tags() { * Set the tags property: Tags of billing profiles. * * @param tags the tags value to set. - * @return the BillingProfileInner object itself. + * @return the BillingProfileAutoGeneratedInner object itself. */ - public BillingProfileInner withTags(Map tags) { + public BillingProfileAutoGeneratedInner withTags(Map tags) { if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); + this.innerProperties = new BillingProfilePropertiesAutoGenerated(); } this.innerProperties().withTags(tags); return this; } + /** + * Get the targetClouds property: 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. + * + * @return the targetClouds value. + */ + public List targetClouds() { + return this.innerProperties() == null ? null : this.innerProperties().targetClouds(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileProperties.java index 469a85db194b2..75bb411d68169 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileProperties.java @@ -22,18 +22,6 @@ /** The properties of the billing profile. */ @Fluent public final class BillingProfileProperties { - /* - * The name of the billing profile. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The purchase order name that will appear on the invoices generated for the billing profile. - */ - @JsonProperty(value = "poNumber") - private String poNumber; - /* * Identifies which services and purchases are paid by a billing profile. */ @@ -47,34 +35,46 @@ public final class BillingProfileProperties { private AddressDetails billTo; /* - * Identifies the billing profile that is linked to another billing profile in indirect purchase motion. + * The currency in which the charges for the billing profile are billed. */ - @JsonProperty(value = "indirectRelationshipInfo", access = JsonProperty.Access.WRITE_ONLY) - private IndirectRelationshipInfo indirectRelationshipInfo; + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; /* - * Flag controlling whether the invoices for the billing profile are sent through email. + * The name of the billing profile. */ - @JsonProperty(value = "invoiceEmailOptIn") - private Boolean invoiceEmailOptIn; + @JsonProperty(value = "displayName") + private String displayName; /* - * The day of the month when the invoice for the billing profile is generated. + * Information about the enabled azure plans. */ - @JsonProperty(value = "invoiceDay", access = JsonProperty.Access.WRITE_ONLY) - private Integer invoiceDay; + @JsonProperty(value = "enabledAzurePlans") + private List enabledAzurePlans; /* - * The currency in which the charges for the billing profile are billed. + * Indicates whether user has read access to the billing profile. */ - @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; + @JsonProperty(value = "hasReadAccess", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasReadAccess; /* - * Information about the enabled azure plans. + * Identifies the billing profile that is linked to another billing profile in indirect purchase motion. */ - @JsonProperty(value = "enabledAzurePlans") - private List enabledAzurePlans; + @JsonProperty(value = "indirectRelationshipInfo", access = JsonProperty.Access.WRITE_ONLY) + private IndirectRelationshipInfo indirectRelationshipInfo; + + /* + * The day of the month when the invoice for the billing profile is generated. + */ + @JsonProperty(value = "invoiceDay", access = JsonProperty.Access.WRITE_ONLY) + private Integer invoiceDay; + + /* + * Flag controlling whether the invoices for the billing profile are sent through email. + */ + @JsonProperty(value = "invoiceEmailOptIn") + private Boolean invoiceEmailOptIn; /* * The invoice sections associated to the billing profile. By default this is not populated, unless it's specified @@ -84,16 +84,16 @@ public final class BillingProfileProperties { private InvoiceSectionsOnExpand invoiceSections; /* - * Indicates whether user has read access to the billing profile. + * The purchase order name that will appear on the invoices generated for the billing profile. */ - @JsonProperty(value = "hasReadAccess", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasReadAccess; + @JsonProperty(value = "poNumber") + private String poNumber; /* - * The system generated unique identifier for a billing profile. + * The billing profile spending limit. */ - @JsonProperty(value = "systemId", access = JsonProperty.Access.WRITE_ONLY) - private String systemId; + @JsonProperty(value = "spendingLimit", access = JsonProperty.Access.WRITE_ONLY) + private SpendingLimit spendingLimit; /* * The status of the billing profile. @@ -108,17 +108,10 @@ public final class BillingProfileProperties { private StatusReasonCode statusReasonCode; /* - * The billing profile spending limit. - */ - @JsonProperty(value = "spendingLimit", access = JsonProperty.Access.WRITE_ONLY) - private SpendingLimit spendingLimit; - - /* - * 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 system generated unique identifier for a billing profile. */ - @JsonProperty(value = "targetClouds", access = JsonProperty.Access.WRITE_ONLY) - private List targetClouds; + @JsonProperty(value = "systemId", access = JsonProperty.Access.WRITE_ONLY) + private String systemId; /* * Tags of billing profiles. @@ -127,148 +120,142 @@ public final class BillingProfileProperties { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /* + * 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. + */ + @JsonProperty(value = "targetClouds", access = JsonProperty.Access.WRITE_ONLY) + private List targetClouds; + /** Creates an instance of BillingProfileProperties class. */ public BillingProfileProperties() { } /** - * Get the displayName property: The name of the billing profile. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The name of the billing profile. + * Get the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. * - * @param displayName the displayName value to set. - * @return the BillingProfileProperties object itself. + * @return the billingRelationshipType value. */ - public BillingProfileProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; + public BillingRelationshipType billingRelationshipType() { + return this.billingRelationshipType; } /** - * Get the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. + * Get the billTo property: Billing address. * - * @return the poNumber value. + * @return the billTo value. */ - public String poNumber() { - return this.poNumber; + public AddressDetails billTo() { + return this.billTo; } /** - * Set the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. + * Set the billTo property: Billing address. * - * @param poNumber the poNumber value to set. + * @param billTo the billTo value to set. * @return the BillingProfileProperties object itself. */ - public BillingProfileProperties withPoNumber(String poNumber) { - this.poNumber = poNumber; + public BillingProfileProperties withBillTo(AddressDetails billTo) { + this.billTo = billTo; return this; } /** - * Get the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. + * Get the currency property: The currency in which the charges for the billing profile are billed. * - * @return the billingRelationshipType value. + * @return the currency value. */ - public BillingRelationshipType billingRelationshipType() { - return this.billingRelationshipType; + public String currency() { + return this.currency; } /** - * Get the billTo property: Billing address. + * Get the displayName property: The name of the billing profile. * - * @return the billTo value. + * @return the displayName value. */ - public AddressDetails billTo() { - return this.billTo; + public String displayName() { + return this.displayName; } /** - * Set the billTo property: Billing address. + * Set the displayName property: The name of the billing profile. * - * @param billTo the billTo value to set. + * @param displayName the displayName value to set. * @return the BillingProfileProperties object itself. */ - public BillingProfileProperties withBillTo(AddressDetails billTo) { - this.billTo = billTo; + public BillingProfileProperties withDisplayName(String displayName) { + this.displayName = displayName; return this; } /** - * Get the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing - * profile in indirect purchase motion. + * Get the enabledAzurePlans property: Information about the enabled azure plans. * - * @return the indirectRelationshipInfo value. + * @return the enabledAzurePlans value. */ - public IndirectRelationshipInfo indirectRelationshipInfo() { - return this.indirectRelationshipInfo; + public List enabledAzurePlans() { + return this.enabledAzurePlans; } /** - * Get the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent - * through email. + * Set the enabledAzurePlans property: Information about the enabled azure plans. * - * @return the invoiceEmailOptIn value. + * @param enabledAzurePlans the enabledAzurePlans value to set. + * @return the BillingProfileProperties object itself. */ - public Boolean invoiceEmailOptIn() { - return this.invoiceEmailOptIn; + public BillingProfileProperties withEnabledAzurePlans(List enabledAzurePlans) { + this.enabledAzurePlans = enabledAzurePlans; + return this; } /** - * Set the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent - * through email. + * Get the hasReadAccess property: Indicates whether user has read access to the billing profile. * - * @param invoiceEmailOptIn the invoiceEmailOptIn value to set. - * @return the BillingProfileProperties object itself. + * @return the hasReadAccess value. */ - public BillingProfileProperties withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { - this.invoiceEmailOptIn = invoiceEmailOptIn; - return this; + public Boolean hasReadAccess() { + return this.hasReadAccess; } /** - * Get the invoiceDay property: The day of the month when the invoice for the billing profile is generated. + * Get the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing + * profile in indirect purchase motion. * - * @return the invoiceDay value. + * @return the indirectRelationshipInfo value. */ - public Integer invoiceDay() { - return this.invoiceDay; + public IndirectRelationshipInfo indirectRelationshipInfo() { + return this.indirectRelationshipInfo; } /** - * Get the currency property: The currency in which the charges for the billing profile are billed. + * Get the invoiceDay property: The day of the month when the invoice for the billing profile is generated. * - * @return the currency value. + * @return the invoiceDay value. */ - public String currency() { - return this.currency; + public Integer invoiceDay() { + return this.invoiceDay; } /** - * Get the enabledAzurePlans property: Information about the enabled azure plans. + * Get the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent + * through email. * - * @return the enabledAzurePlans value. + * @return the invoiceEmailOptIn value. */ - public List enabledAzurePlans() { - return this.enabledAzurePlans; + public Boolean invoiceEmailOptIn() { + return this.invoiceEmailOptIn; } /** - * Set the enabledAzurePlans property: Information about the enabled azure plans. + * Set the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent + * through email. * - * @param enabledAzurePlans the enabledAzurePlans value to set. + * @param invoiceEmailOptIn the invoiceEmailOptIn value to set. * @return the BillingProfileProperties object itself. */ - public BillingProfileProperties withEnabledAzurePlans(List enabledAzurePlans) { - this.enabledAzurePlans = enabledAzurePlans; + public BillingProfileProperties withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { + this.invoiceEmailOptIn = invoiceEmailOptIn; return this; } @@ -295,21 +282,34 @@ public BillingProfileProperties withInvoiceSections(InvoiceSectionsOnExpand invo } /** - * Get the hasReadAccess property: Indicates whether user has read access to the billing profile. + * Get the poNumber property: The purchase order name that will appear on the invoices generated for the billing + * profile. * - * @return the hasReadAccess value. + * @return the poNumber value. */ - public Boolean hasReadAccess() { - return this.hasReadAccess; + public String poNumber() { + return this.poNumber; } /** - * Get the systemId property: The system generated unique identifier for a billing profile. + * Set the poNumber property: The purchase order name that will appear on the invoices generated for the billing + * profile. * - * @return the systemId value. + * @param poNumber the poNumber value to set. + * @return the BillingProfileProperties object itself. */ - public String systemId() { - return this.systemId; + public BillingProfileProperties withPoNumber(String poNumber) { + this.poNumber = poNumber; + return this; + } + + /** + * Get the spendingLimit property: The billing profile spending limit. + * + * @return the spendingLimit value. + */ + public SpendingLimit spendingLimit() { + return this.spendingLimit; } /** @@ -331,23 +331,12 @@ public StatusReasonCode statusReasonCode() { } /** - * Get the spendingLimit property: The billing profile spending limit. - * - * @return the spendingLimit value. - */ - public SpendingLimit spendingLimit() { - return this.spendingLimit; - } - - /** - * Get the targetClouds property: 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. + * Get the systemId property: The system generated unique identifier for a billing profile. * - * @return the targetClouds value. + * @return the systemId value. */ - public List targetClouds() { - return this.targetClouds; + public String systemId() { + return this.systemId; } /** @@ -370,6 +359,17 @@ public BillingProfileProperties withTags(Map tags) { return this; } + /** + * Get the targetClouds property: 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. + * + * @return the targetClouds value. + */ + public List targetClouds() { + return this.targetClouds; + } + /** * Validates the instance. * @@ -379,12 +379,12 @@ public void validate() { if (billTo() != null) { billTo().validate(); } - if (indirectRelationshipInfo() != null) { - indirectRelationshipInfo().validate(); - } if (enabledAzurePlans() != null) { enabledAzurePlans().forEach(e -> e.validate()); } + if (indirectRelationshipInfo() != null) { + indirectRelationshipInfo().validate(); + } if (invoiceSections() != null) { invoiceSections().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfilePropertiesAutoGenerated.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfilePropertiesAutoGenerated.java new file mode 100644 index 0000000000000..3c735b3c13e6d --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfilePropertiesAutoGenerated.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.models.AddressDetails; +import com.azure.resourcemanager.billing.models.AzurePlan; +import com.azure.resourcemanager.billing.models.BillingProfileStatus; +import com.azure.resourcemanager.billing.models.BillingRelationshipType; +import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo; +import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpandAutoGenerated; +import com.azure.resourcemanager.billing.models.SpendingLimit; +import com.azure.resourcemanager.billing.models.StatusReasonCode; +import com.azure.resourcemanager.billing.models.TargetCloud; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The properties of the billing profile. */ +@Fluent +public final class BillingProfilePropertiesAutoGenerated { + /* + * Identifies which services and purchases are paid by a billing profile. + */ + @JsonProperty(value = "billingRelationshipType", access = JsonProperty.Access.WRITE_ONLY) + private BillingRelationshipType billingRelationshipType; + + /* + * Billing address. + */ + @JsonProperty(value = "billTo") + private AddressDetails billTo; + + /* + * The currency in which the charges for the billing profile are billed. + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /* + * The name of the billing profile. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Information about the enabled azure plans. + */ + @JsonProperty(value = "enabledAzurePlans") + private List enabledAzurePlans; + + /* + * Indicates whether user has read access to the billing profile. + */ + @JsonProperty(value = "hasReadAccess", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasReadAccess; + + /* + * Identifies the billing profile that is linked to another billing profile in indirect purchase motion. + */ + @JsonProperty(value = "indirectRelationshipInfo", access = JsonProperty.Access.WRITE_ONLY) + private IndirectRelationshipInfo indirectRelationshipInfo; + + /* + * The day of the month when the invoice for the billing profile is generated. + */ + @JsonProperty(value = "invoiceDay", access = JsonProperty.Access.WRITE_ONLY) + private Integer invoiceDay; + + /* + * Flag controlling whether the invoices for the billing profile are sent through email. + */ + @JsonProperty(value = "invoiceEmailOptIn") + private Boolean invoiceEmailOptIn; + + /* + * The invoice sections associated to the billing profile. By default this is not populated, unless it's specified + * in $expand. + */ + @JsonProperty(value = "invoiceSections") + private InvoiceSectionsOnExpandAutoGenerated invoiceSections; + + /* + * The purchase order name that will appear on the invoices generated for the billing profile. + */ + @JsonProperty(value = "poNumber") + private String poNumber; + + /* + * The billing profile spending limit. + */ + @JsonProperty(value = "spendingLimit", access = JsonProperty.Access.WRITE_ONLY) + private SpendingLimit spendingLimit; + + /* + * The status of the billing profile. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private BillingProfileStatus status; + + /* + * Reason for the specified billing profile status. + */ + @JsonProperty(value = "statusReasonCode", access = JsonProperty.Access.WRITE_ONLY) + private StatusReasonCode statusReasonCode; + + /* + * The system generated unique identifier for a billing profile. + */ + @JsonProperty(value = "systemId", access = JsonProperty.Access.WRITE_ONLY) + private String systemId; + + /* + * Tags of billing profiles. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * 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. + */ + @JsonProperty(value = "targetClouds", access = JsonProperty.Access.WRITE_ONLY) + private List targetClouds; + + /** Creates an instance of BillingProfilePropertiesAutoGenerated class. */ + public BillingProfilePropertiesAutoGenerated() { + } + + /** + * Get the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. + * + * @return the billingRelationshipType value. + */ + public BillingRelationshipType billingRelationshipType() { + return this.billingRelationshipType; + } + + /** + * Get the billTo property: Billing address. + * + * @return the billTo value. + */ + public AddressDetails billTo() { + return this.billTo; + } + + /** + * Set the billTo property: Billing address. + * + * @param billTo the billTo value to set. + * @return the BillingProfilePropertiesAutoGenerated object itself. + */ + public BillingProfilePropertiesAutoGenerated withBillTo(AddressDetails billTo) { + this.billTo = billTo; + return this; + } + + /** + * Get the currency property: The currency in which the charges for the billing profile are billed. + * + * @return the currency value. + */ + public String currency() { + return this.currency; + } + + /** + * Get the displayName property: The name of the billing profile. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The name of the billing profile. + * + * @param displayName the displayName value to set. + * @return the BillingProfilePropertiesAutoGenerated object itself. + */ + public BillingProfilePropertiesAutoGenerated withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the enabledAzurePlans property: Information about the enabled azure plans. + * + * @return the enabledAzurePlans value. + */ + public List enabledAzurePlans() { + return this.enabledAzurePlans; + } + + /** + * Set the enabledAzurePlans property: Information about the enabled azure plans. + * + * @param enabledAzurePlans the enabledAzurePlans value to set. + * @return the BillingProfilePropertiesAutoGenerated object itself. + */ + public BillingProfilePropertiesAutoGenerated withEnabledAzurePlans(List enabledAzurePlans) { + this.enabledAzurePlans = enabledAzurePlans; + return this; + } + + /** + * Get the hasReadAccess property: Indicates whether user has read access to the billing profile. + * + * @return the hasReadAccess value. + */ + public Boolean hasReadAccess() { + return this.hasReadAccess; + } + + /** + * Get the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing + * profile in indirect purchase motion. + * + * @return the indirectRelationshipInfo value. + */ + public IndirectRelationshipInfo indirectRelationshipInfo() { + return this.indirectRelationshipInfo; + } + + /** + * Get the invoiceDay property: The day of the month when the invoice for the billing profile is generated. + * + * @return the invoiceDay value. + */ + public Integer invoiceDay() { + return this.invoiceDay; + } + + /** + * Get the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent + * through email. + * + * @return the invoiceEmailOptIn value. + */ + public Boolean invoiceEmailOptIn() { + return this.invoiceEmailOptIn; + } + + /** + * Set the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent + * through email. + * + * @param invoiceEmailOptIn the invoiceEmailOptIn value to set. + * @return the BillingProfilePropertiesAutoGenerated object itself. + */ + public BillingProfilePropertiesAutoGenerated withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { + this.invoiceEmailOptIn = invoiceEmailOptIn; + return this; + } + + /** + * Get the invoiceSections property: The invoice sections associated to the billing profile. By default this is not + * populated, unless it's specified in $expand. + * + * @return the invoiceSections value. + */ + public InvoiceSectionsOnExpandAutoGenerated invoiceSections() { + return this.invoiceSections; + } + + /** + * Set the invoiceSections property: The invoice sections associated to the billing profile. By default this is not + * populated, unless it's specified in $expand. + * + * @param invoiceSections the invoiceSections value to set. + * @return the BillingProfilePropertiesAutoGenerated object itself. + */ + public BillingProfilePropertiesAutoGenerated withInvoiceSections( + InvoiceSectionsOnExpandAutoGenerated invoiceSections) { + this.invoiceSections = invoiceSections; + return this; + } + + /** + * Get the poNumber property: The purchase order name that will appear on the invoices generated for the billing + * profile. + * + * @return the poNumber value. + */ + public String poNumber() { + return this.poNumber; + } + + /** + * Set the poNumber property: The purchase order name that will appear on the invoices generated for the billing + * profile. + * + * @param poNumber the poNumber value to set. + * @return the BillingProfilePropertiesAutoGenerated object itself. + */ + public BillingProfilePropertiesAutoGenerated withPoNumber(String poNumber) { + this.poNumber = poNumber; + return this; + } + + /** + * Get the spendingLimit property: The billing profile spending limit. + * + * @return the spendingLimit value. + */ + public SpendingLimit spendingLimit() { + return this.spendingLimit; + } + + /** + * Get the status property: The status of the billing profile. + * + * @return the status value. + */ + public BillingProfileStatus status() { + return this.status; + } + + /** + * Get the statusReasonCode property: Reason for the specified billing profile status. + * + * @return the statusReasonCode value. + */ + public StatusReasonCode statusReasonCode() { + return this.statusReasonCode; + } + + /** + * Get the systemId property: The system generated unique identifier for a billing profile. + * + * @return the systemId value. + */ + public String systemId() { + return this.systemId; + } + + /** + * Get the tags property: Tags of billing profiles. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags of billing profiles. + * + * @param tags the tags value to set. + * @return the BillingProfilePropertiesAutoGenerated object itself. + */ + public BillingProfilePropertiesAutoGenerated withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the targetClouds property: 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. + * + * @return the targetClouds value. + */ + public List targetClouds() { + return this.targetClouds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (billTo() != null) { + billTo().validate(); + } + if (enabledAzurePlans() != null) { + enabledAzurePlans().forEach(e -> e.validate()); + } + if (indirectRelationshipInfo() != null) { + indirectRelationshipInfo().validate(); + } + if (invoiceSections() != null) { + invoiceSections().validate(); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyInner.java index 13b625a522e7e..dad1706553220 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyInner.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.BillingProfileSpendingLimit; import com.azure.resourcemanager.billing.models.BillingProfileStatus; import com.azure.resourcemanager.billing.models.BillingProfileStatusReasonCode; @@ -13,7 +13,7 @@ /** A billing property. */ @Fluent -public final class BillingPropertyInner extends ProxyResource { +public final class BillingPropertyInner extends ArmResource { /* * A billing property. */ @@ -44,12 +44,12 @@ public String accountAdminNotificationEmailAddress() { } /** - * Get the billingTenantId property: The Azure AD tenant ID of the billing account for the subscription. + * Get the billingAccountDisplayName property: The name of the billing account to which the subscription is billed. * - * @return the billingTenantId value. + * @return the billingAccountDisplayName value. */ - public String billingTenantId() { - return this.innerProperties() == null ? null : this.innerProperties().billingTenantId(); + public String billingAccountDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingAccountDisplayName(); } /** @@ -62,12 +62,12 @@ public String billingAccountId() { } /** - * Get the billingAccountDisplayName property: The name of the billing account to which the subscription is billed. + * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. * - * @return the billingAccountDisplayName value. + * @return the billingProfileDisplayName value. */ - public String billingAccountDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingAccountDisplayName(); + public String billingProfileDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); } /** @@ -80,12 +80,12 @@ public String billingProfileId() { } /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. + * Get the billingProfileSpendingLimit property: The billing profile spending limit. * - * @return the billingProfileDisplayName value. + * @return the billingProfileSpendingLimit value. */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); + public BillingProfileSpendingLimit billingProfileSpendingLimit() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileSpendingLimit(); } /** @@ -107,12 +107,12 @@ public BillingProfileStatusReasonCode billingProfileStatusReasonCode() { } /** - * Get the billingProfileSpendingLimit property: The billing profile spending limit. + * Get the billingTenantId property: The Azure AD tenant ID of the billing account for the subscription. * - * @return the billingProfileSpendingLimit value. + * @return the billingTenantId value. */ - public BillingProfileSpendingLimit billingProfileSpendingLimit() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileSpendingLimit(); + public String billingTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().billingTenantId(); } /** @@ -139,21 +139,21 @@ public BillingPropertyInner withCostCenter(String costCenter) { } /** - * Get the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. + * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. * - * @return the invoiceSectionId value. + * @return the invoiceSectionDisplayName value. */ - public String invoiceSectionId() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); + public String invoiceSectionDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); } /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. + * Get the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. * - * @return the invoiceSectionDisplayName value. + * @return the invoiceSectionId value. */ - public String invoiceSectionDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); + public String invoiceSectionId() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); } /** @@ -184,21 +184,21 @@ public String productName() { } /** - * Get the skuId property: The sku ID of the Azure plan for the subscription. + * Get the skuDescription property: The sku description of the Azure plan for the subscription. * - * @return the skuId value. + * @return the skuDescription value. */ - public String skuId() { - return this.innerProperties() == null ? null : this.innerProperties().skuId(); + public String skuDescription() { + return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); } /** - * Get the skuDescription property: The sku description of the Azure plan for the subscription. + * Get the skuId property: The sku ID of the Azure plan for the subscription. * - * @return the skuDescription value. + * @return the skuId value. */ - public String skuDescription() { - return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); + public String skuId() { + return this.innerProperties() == null ? null : this.innerProperties().skuId(); } /** @@ -206,7 +206,9 @@ public String skuDescription() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyProperties.java index 25c4e7f9ec6ca..13c8668e97386 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyProperties.java @@ -20,10 +20,10 @@ public final class BillingPropertyProperties { private String accountAdminNotificationEmailAddress; /* - * The Azure AD tenant ID of the billing account for the subscription. + * The name of the billing account to which the subscription is billed. */ - @JsonProperty(value = "billingTenantId", access = JsonProperty.Access.WRITE_ONLY) - private String billingTenantId; + @JsonProperty(value = "billingAccountDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountDisplayName; /* * The ID of the billing account to which the subscription is billed. @@ -32,10 +32,10 @@ public final class BillingPropertyProperties { private String billingAccountId; /* - * The name of the billing account to which the subscription is billed. + * The name of the billing profile to which the subscription is billed. */ - @JsonProperty(value = "billingAccountDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingAccountDisplayName; + @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; /* * The ID of the billing profile to which the subscription is billed. @@ -44,10 +44,10 @@ public final class BillingPropertyProperties { private String billingProfileId; /* - * The name of the billing profile to which the subscription is billed. + * The billing profile spending limit. */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; + @JsonProperty(value = "billingProfileSpendingLimit", access = JsonProperty.Access.WRITE_ONLY) + private BillingProfileSpendingLimit billingProfileSpendingLimit; /* * The status of the billing profile. @@ -62,10 +62,10 @@ public final class BillingPropertyProperties { private BillingProfileStatusReasonCode billingProfileStatusReasonCode; /* - * The billing profile spending limit. + * The Azure AD tenant ID of the billing account for the subscription. */ - @JsonProperty(value = "billingProfileSpendingLimit", access = JsonProperty.Access.WRITE_ONLY) - private BillingProfileSpendingLimit billingProfileSpendingLimit; + @JsonProperty(value = "billingTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String billingTenantId; /* * The cost center applied to the subscription. @@ -73,18 +73,18 @@ public final class BillingPropertyProperties { @JsonProperty(value = "costCenter") private String costCenter; - /* - * The ID of the invoice section to which the subscription is billed. - */ - @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - /* * The name of the invoice section to which the subscription is billed. */ @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) private String invoiceSectionDisplayName; + /* + * The ID of the invoice section to which the subscription is billed. + */ + @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + /* * Indicates whether user is the account admin. */ @@ -103,18 +103,18 @@ public final class BillingPropertyProperties { @JsonProperty(value = "productName", access = JsonProperty.Access.WRITE_ONLY) private String productName; - /* - * The sku ID of the Azure plan for the subscription. - */ - @JsonProperty(value = "skuId", access = JsonProperty.Access.WRITE_ONLY) - private String skuId; - /* * The sku description of the Azure plan for the subscription. */ @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) private String skuDescription; + /* + * The sku ID of the Azure plan for the subscription. + */ + @JsonProperty(value = "skuId", access = JsonProperty.Access.WRITE_ONLY) + private String skuId; + /** Creates an instance of BillingPropertyProperties class. */ public BillingPropertyProperties() { } @@ -130,12 +130,12 @@ public String accountAdminNotificationEmailAddress() { } /** - * Get the billingTenantId property: The Azure AD tenant ID of the billing account for the subscription. + * Get the billingAccountDisplayName property: The name of the billing account to which the subscription is billed. * - * @return the billingTenantId value. + * @return the billingAccountDisplayName value. */ - public String billingTenantId() { - return this.billingTenantId; + public String billingAccountDisplayName() { + return this.billingAccountDisplayName; } /** @@ -148,12 +148,12 @@ public String billingAccountId() { } /** - * Get the billingAccountDisplayName property: The name of the billing account to which the subscription is billed. + * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. * - * @return the billingAccountDisplayName value. + * @return the billingProfileDisplayName value. */ - public String billingAccountDisplayName() { - return this.billingAccountDisplayName; + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; } /** @@ -166,12 +166,12 @@ public String billingProfileId() { } /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. + * Get the billingProfileSpendingLimit property: The billing profile spending limit. * - * @return the billingProfileDisplayName value. + * @return the billingProfileSpendingLimit value. */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; + public BillingProfileSpendingLimit billingProfileSpendingLimit() { + return this.billingProfileSpendingLimit; } /** @@ -193,12 +193,12 @@ public BillingProfileStatusReasonCode billingProfileStatusReasonCode() { } /** - * Get the billingProfileSpendingLimit property: The billing profile spending limit. + * Get the billingTenantId property: The Azure AD tenant ID of the billing account for the subscription. * - * @return the billingProfileSpendingLimit value. + * @return the billingTenantId value. */ - public BillingProfileSpendingLimit billingProfileSpendingLimit() { - return this.billingProfileSpendingLimit; + public String billingTenantId() { + return this.billingTenantId; } /** @@ -222,21 +222,21 @@ public BillingPropertyProperties withCostCenter(String costCenter) { } /** - * Get the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. + * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. * - * @return the invoiceSectionId value. + * @return the invoiceSectionDisplayName value. */ - public String invoiceSectionId() { - return this.invoiceSectionId; + public String invoiceSectionDisplayName() { + return this.invoiceSectionDisplayName; } /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. + * Get the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. * - * @return the invoiceSectionDisplayName value. + * @return the invoiceSectionId value. */ - public String invoiceSectionDisplayName() { - return this.invoiceSectionDisplayName; + public String invoiceSectionId() { + return this.invoiceSectionId; } /** @@ -267,21 +267,21 @@ public String productName() { } /** - * Get the skuId property: The sku ID of the Azure plan for the subscription. + * Get the skuDescription property: The sku description of the Azure plan for the subscription. * - * @return the skuId value. + * @return the skuDescription value. */ - public String skuId() { - return this.skuId; + public String skuDescription() { + return this.skuDescription; } /** - * Get the skuDescription property: The sku description of the Azure plan for the subscription. + * Get the skuId property: The sku ID of the Azure plan for the subscription. * - * @return the skuDescription value. + * @return the skuId value. */ - public String skuDescription() { - return this.skuDescription; + public String skuId() { + return this.skuId; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRequestInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRequestInner.java new file mode 100644 index 0000000000000..b02cb9d37135b --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRequestInner.java @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.models.ArmResource; +import com.azure.resourcemanager.billing.models.BillingRequestStatus; +import com.azure.resourcemanager.billing.models.BillingRequestType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A billing request. */ +@Fluent +public final class BillingRequestInner extends ArmResource { + /* + * The properties of a(n) BillingRequest + */ + @JsonProperty(value = "properties") + private BillingRequestProperties innerProperties; + + /** Creates an instance of BillingRequestInner class. */ + public BillingRequestInner() { + } + + /** + * Get the innerProperties property: The properties of a(n) BillingRequest. + * + * @return the innerProperties value. + */ + private BillingRequestProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the additionalInformation property: Additional information for the billing request. + * + * @return the additionalInformation value. + */ + public Map additionalInformation() { + return this.innerProperties() == null ? null : this.innerProperties().additionalInformation(); + } + + /** + * Set the additionalInformation property: Additional information for the billing request. + * + * @param additionalInformation the additionalInformation value to set. + * @return the BillingRequestInner object itself. + */ + public BillingRequestInner withAdditionalInformation(Map additionalInformation) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingRequestProperties(); + } + this.innerProperties().withAdditionalInformation(additionalInformation); + return this; + } + + /** + * Get the reviewedBy property: UPN of request reviewer. Will only be set if request is approved. + * + * @return the reviewedBy value. + */ + public String reviewedBy() { + return this.innerProperties() == null ? null : this.innerProperties().reviewedBy(); + } + + /** + * Get the reviewalDate property: The date and time when the request was reviewed. + * + * @return the reviewalDate value. + */ + public String reviewalDate() { + return this.innerProperties() == null ? null : this.innerProperties().reviewalDate(); + } + + /** + * Get the billingAccountId property: The fully qualified ID that uniquely identifies a billing account. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.innerProperties() == null ? null : this.innerProperties().billingAccountId(); + } + + /** + * Get the billingAccountName property: The ID that uniquely identifies a billing account. + * + * @return the billingAccountName value. + */ + public String billingAccountName() { + return this.innerProperties() == null ? null : this.innerProperties().billingAccountName(); + } + + /** + * Get the billingAccountDisplayName property: The name of the billing account. + * + * @return the billingAccountDisplayName value. + */ + public String billingAccountDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingAccountDisplayName(); + } + + /** + * Get the billingAccountPrimaryBillingTenantId property: The primary tenant ID of the billing account for which the + * billing request was submitted. + * + * @return the billingAccountPrimaryBillingTenantId value. + */ + public String billingAccountPrimaryBillingTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().billingAccountPrimaryBillingTenantId(); + } + + /** + * Get the billingProfileId property: The fully qualified ID that uniquely identifies a billing profile. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); + } + + /** + * Get the billingProfileName property: The ID that uniquely identifies a billing profile. + * + * @return the billingProfileName value. + */ + public String billingProfileName() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileName(); + } + + /** + * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section or customer. + * + * @return the billingProfileDisplayName value. + */ + public String billingProfileDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); + } + + /** + * Get the createdBy property: UPN of user who created the request. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the creationDate property: The date and time when the request was created. + * + * @return the creationDate value. + */ + public String creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + } + + /** + * Get the expirationDate property: The date and time when the request expires. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); + } + + /** + * Get the decisionReason property: The reason to approve or decline the request. + * + * @return the decisionReason value. + */ + public String decisionReason() { + return this.innerProperties() == null ? null : this.innerProperties().decisionReason(); + } + + /** + * Set the decisionReason property: The reason to approve or decline the request. + * + * @param decisionReason the decisionReason value to set. + * @return the BillingRequestInner object itself. + */ + public BillingRequestInner withDecisionReason(String decisionReason) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingRequestProperties(); + } + this.innerProperties().withDecisionReason(decisionReason); + return this; + } + + /** + * Get the invoiceSectionId property: The fully qualified ID that uniquely identifies an invoice section. + * + * @return the invoiceSectionId value. + */ + public String invoiceSectionId() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); + } + + /** + * Get the invoiceSectionName property: The ID that uniquely identifies an invoice section. + * + * @return the invoiceSectionName value. + */ + public String invoiceSectionName() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionName(); + } + + /** + * Get the invoiceSectionDisplayName property: The name of the invoice section. + * + * @return the invoiceSectionDisplayName value. + */ + public String invoiceSectionDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); + } + + /** + * Get the customerId property: The fully qualified ID that uniquely identifies a customer. + * + * @return the customerId value. + */ + public String customerId() { + return this.innerProperties() == null ? null : this.innerProperties().customerId(); + } + + /** + * Get the customerName property: The ID that uniquely identifies a customer. + * + * @return the customerName value. + */ + public String customerName() { + return this.innerProperties() == null ? null : this.innerProperties().customerName(); + } + + /** + * Get the customerDisplayName property: The name of the customer. + * + * @return the customerDisplayName value. + */ + public String customerDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); + } + + /** + * Get the subscriptionId property: The fully qualified ID that uniquely identifies a billing subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); + } + + /** + * Get the subscriptionName property: The ID that uniquely identifies a billing subscription. + * + * @return the subscriptionName value. + */ + public String subscriptionName() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionName(); + } + + /** + * Get the subscriptionDisplayName property: The name of the billing subscription. + * + * @return the subscriptionDisplayName value. + */ + public String subscriptionDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionDisplayName(); + } + + /** + * Get the justification property: Justification for submitting request. + * + * @return the justification value. + */ + public String justification() { + return this.innerProperties() == null ? null : this.innerProperties().justification(); + } + + /** + * Set the justification property: Justification for submitting request. + * + * @param justification the justification value to set. + * @return the BillingRequestInner object itself. + */ + public BillingRequestInner withJustification(String justification) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingRequestProperties(); + } + this.innerProperties().withJustification(justification); + return this; + } + + /** + * Get the recipients property: The recipients of the billing request. + * + * @return the recipients value. + */ + public List recipients() { + return this.innerProperties() == null ? null : this.innerProperties().recipients(); + } + + /** + * Set the recipients property: The recipients of the billing request. + * + * @param recipients the recipients value to set. + * @return the BillingRequestInner object itself. + */ + public BillingRequestInner withRecipients(List recipients) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingRequestProperties(); + } + this.innerProperties().withRecipients(recipients); + return this; + } + + /** + * Get the scope property: The billing scope for which the request was submitted (ex. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'). + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The billing scope for which the request was submitted (ex. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'). + * + * @param scope the scope value to set. + * @return the BillingRequestInner object itself. + */ + public BillingRequestInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingRequestProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the status property: Status of billing request. + * + * @return the status value. + */ + public BillingRequestStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Status of billing request. + * + * @param status the status value to set. + * @return the BillingRequestInner object itself. + */ + public BillingRequestInner withStatus(BillingRequestStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingRequestProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the type property: Type of billing request. + * + * @return the type value. + */ + public BillingRequestType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Type of billing request. + * + * @param type the type value to set. + * @return the BillingRequestInner object itself. + */ + public BillingRequestInner withTypePropertiesType(BillingRequestType type) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingRequestProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the lastUpdatedBy property: UPN of the user who last updated the request. + * + * @return the lastUpdatedBy value. + */ + public String lastUpdatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedBy(); + } + + /** + * Get the lastUpdatedDate property: Date and time of last update. + * + * @return the lastUpdatedDate value. + */ + public String lastUpdatedDate() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDate(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRequestProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRequestProperties.java new file mode 100644 index 0000000000000..73bcf33be4f69 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRequestProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.models.BillingRequestPropertiesAutoGenerated; +import com.azure.resourcemanager.billing.models.BillingRequestStatus; +import com.azure.resourcemanager.billing.models.BillingRequestType; +import java.util.List; +import java.util.Map; + +/** The properties of a(n) BillingRequest. */ +@Fluent +public final class BillingRequestProperties extends BillingRequestPropertiesAutoGenerated { + /** Creates an instance of BillingRequestProperties class. */ + public BillingRequestProperties() { + } + + /** {@inheritDoc} */ + @Override + public BillingRequestProperties withAdditionalInformation(Map additionalInformation) { + super.withAdditionalInformation(additionalInformation); + return this; + } + + /** {@inheritDoc} */ + @Override + public BillingRequestProperties withDecisionReason(String decisionReason) { + super.withDecisionReason(decisionReason); + return this; + } + + /** {@inheritDoc} */ + @Override + public BillingRequestProperties withJustification(String justification) { + super.withJustification(justification); + return this; + } + + /** {@inheritDoc} */ + @Override + public BillingRequestProperties withRecipients(List recipients) { + super.withRecipients(recipients); + return this; + } + + /** {@inheritDoc} */ + @Override + public BillingRequestProperties withScope(String scope) { + super.withScope(scope); + return this; + } + + /** {@inheritDoc} */ + @Override + public BillingRequestProperties withStatus(BillingRequestStatus status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public BillingRequestProperties withType(BillingRequestType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentInner.java index 204fdab2a7136..0f1dbd38510bc 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentInner.java @@ -5,12 +5,12 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.billing.models.ArmResource; import com.fasterxml.jackson.annotation.JsonProperty; /** The role assignment. */ @Fluent -public final class BillingRoleAssignmentInner extends ProxyResource { +public final class BillingRoleAssignmentInner extends ArmResource { /* * The properties of the role assignment. */ @@ -31,12 +31,12 @@ private BillingRoleAssignmentProperties innerProperties() { } /** - * Get the createdOn property: The date the role assignment was created. + * Get the createdByPrincipalId property: The principal Id of the user who created the role assignment. * - * @return the createdOn value. + * @return the createdByPrincipalId value. */ - public String createdOn() { - return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + public String createdByPrincipalId() { + return this.innerProperties() == null ? null : this.innerProperties().createdByPrincipalId(); } /** @@ -49,21 +49,21 @@ public String createdByPrincipalTenantId() { } /** - * Get the createdByPrincipalId property: The principal Id of the user who created the role assignment. + * Get the createdByUserEmailAddress property: The email address of the user who created the role assignment. * - * @return the createdByPrincipalId value. + * @return the createdByUserEmailAddress value. */ - public String createdByPrincipalId() { - return this.innerProperties() == null ? null : this.innerProperties().createdByPrincipalId(); + public String createdByUserEmailAddress() { + return this.innerProperties() == null ? null : this.innerProperties().createdByUserEmailAddress(); } /** - * Get the createdByUserEmailAddress property: The email address of the user who created the role assignment. + * Get the createdOn property: The date the role assignment was created. * - * @return the createdByUserEmailAddress value. + * @return the createdOn value. */ - public String createdByUserEmailAddress() { - return this.innerProperties() == null ? null : this.innerProperties().createdByUserEmailAddress(); + public String createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); } /** @@ -195,7 +195,9 @@ public BillingRoleAssignmentInner withUserEmailAddress(String userEmailAddress) * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentProperties.java index 61a73807dfe09..235fa99274741 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentProperties.java @@ -11,10 +11,10 @@ @Fluent public final class BillingRoleAssignmentProperties { /* - * The date the role assignment was created. + * The principal Id of the user who created the role assignment. */ - @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) - private String createdOn; + @JsonProperty(value = "createdByPrincipalId", access = JsonProperty.Access.WRITE_ONLY) + private String createdByPrincipalId; /* * The tenant Id of the user who created the role assignment. @@ -22,18 +22,18 @@ public final class BillingRoleAssignmentProperties { @JsonProperty(value = "createdByPrincipalTenantId", access = JsonProperty.Access.WRITE_ONLY) private String createdByPrincipalTenantId; - /* - * The principal Id of the user who created the role assignment. - */ - @JsonProperty(value = "createdByPrincipalId", access = JsonProperty.Access.WRITE_ONLY) - private String createdByPrincipalId; - /* * The email address of the user who created the role assignment. */ @JsonProperty(value = "createdByUserEmailAddress", access = JsonProperty.Access.WRITE_ONLY) private String createdByUserEmailAddress; + /* + * The date the role assignment was created. + */ + @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) + private String createdOn; + /* * The principal id of the user to whom the role was assigned. */ @@ -75,12 +75,12 @@ public BillingRoleAssignmentProperties() { } /** - * Get the createdOn property: The date the role assignment was created. + * Get the createdByPrincipalId property: The principal Id of the user who created the role assignment. * - * @return the createdOn value. + * @return the createdByPrincipalId value. */ - public String createdOn() { - return this.createdOn; + public String createdByPrincipalId() { + return this.createdByPrincipalId; } /** @@ -93,21 +93,21 @@ public String createdByPrincipalTenantId() { } /** - * Get the createdByPrincipalId property: The principal Id of the user who created the role assignment. + * Get the createdByUserEmailAddress property: The email address of the user who created the role assignment. * - * @return the createdByPrincipalId value. + * @return the createdByUserEmailAddress value. */ - public String createdByPrincipalId() { - return this.createdByPrincipalId; + public String createdByUserEmailAddress() { + return this.createdByUserEmailAddress; } /** - * Get the createdByUserEmailAddress property: The email address of the user who created the role assignment. + * Get the createdOn property: The date the role assignment was created. * - * @return the createdByUserEmailAddress value. + * @return the createdOn value. */ - public String createdByUserEmailAddress() { - return this.createdByUserEmailAddress; + public String createdOn() { + return this.createdOn; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionInner.java index eff6d305c4813..5bcccaaaba6cb 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionInner.java @@ -5,13 +5,13 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.billing.models.ArmResource; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The properties of a role definition. */ @Fluent -public final class BillingRoleDefinitionInner extends ProxyResource { +public final class BillingRoleDefinitionInner extends ArmResource { /* * The properties of the a role definition. */ @@ -77,7 +77,9 @@ public String roleName() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionInner.java index 4fe6d32aa0f60..9b4e37b581daa 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.models.Amount; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; import com.azure.resourcemanager.billing.models.Reseller; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,7 +15,7 @@ /** A billing subscription. */ @Fluent -public final class BillingSubscriptionInner extends ProxyResource { +public final class BillingSubscriptionInner extends ArmResource { /* * The billing properties of a subscription. */ @@ -36,63 +36,12 @@ private BillingSubscriptionProperties innerProperties() { } /** - * Get the displayName property: The name of the subscription. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the subscriptionId property: The ID of the subscription. - * - * @return the subscriptionId value. - */ - public UUID subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); - } - - /** - * Get the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @return the subscriptionBillingStatus value. - */ - public BillingSubscriptionStatusType subscriptionBillingStatus() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionBillingStatus(); - } - - /** - * Set the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @param subscriptionBillingStatus the subscriptionBillingStatus value to set. - * @return the BillingSubscriptionInner object itself. - */ - public BillingSubscriptionInner withSubscriptionBillingStatus( - BillingSubscriptionStatusType subscriptionBillingStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingSubscriptionProperties(); - } - this.innerProperties().withSubscriptionBillingStatus(subscriptionBillingStatus); - return this; - } - - /** - * Get the lastMonthCharges property: The last month charges. - * - * @return the lastMonthCharges value. - */ - public Amount lastMonthCharges() { - return this.innerProperties() == null ? null : this.innerProperties().lastMonthCharges(); - } - - /** - * Get the monthToDateCharges property: The current month to date charges. + * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. * - * @return the monthToDateCharges value. + * @return the billingProfileDisplayName value. */ - public Amount monthToDateCharges() { - return this.innerProperties() == null ? null : this.innerProperties().monthToDateCharges(); + public String billingProfileDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); } /** @@ -104,15 +53,6 @@ public String billingProfileId() { return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } - /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); - } - /** * Get the costCenter property: The cost center applied to the subscription. * @@ -136,6 +76,16 @@ public BillingSubscriptionInner withCostCenter(String costCenter) { return this; } + /** + * Get the customerDisplayName property: The name of the customer for whom the subscription was created. The field + * is applicable only for Microsoft Partner Agreement billing account. + * + * @return the customerDisplayName value. + */ + public String customerDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); + } + /** * Get the customerId property: The ID of the customer for whom the subscription was created. The field is * applicable only for Microsoft Partner Agreement billing account. @@ -147,13 +97,21 @@ public String customerId() { } /** - * Get the customerDisplayName property: The name of the customer for whom the subscription was created. The field - * is applicable only for Microsoft Partner Agreement billing account. + * Get the displayName property: The name of the subscription. * - * @return the customerDisplayName value. + * @return the displayName value. */ - public String customerDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. + * + * @return the invoiceSectionDisplayName value. + */ + public String invoiceSectionDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); } /** @@ -166,12 +124,21 @@ public String invoiceSectionId() { } /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. + * Get the lastMonthCharges property: The last month charges. * - * @return the invoiceSectionDisplayName value. + * @return the lastMonthCharges value. */ - public String invoiceSectionDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); + public Amount lastMonthCharges() { + return this.innerProperties() == null ? null : this.innerProperties().lastMonthCharges(); + } + + /** + * Get the monthToDateCharges property: The current month to date charges. + * + * @return the monthToDateCharges value. + */ + public Amount monthToDateCharges() { + return this.innerProperties() == null ? null : this.innerProperties().monthToDateCharges(); } /** @@ -183,6 +150,15 @@ public Reseller reseller() { return this.innerProperties() == null ? null : this.innerProperties().reseller(); } + /** + * Get the skuDescription property: The sku description of the Azure plan for the subscription. + * + * @return the skuDescription value. + */ + public String skuDescription() { + return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); + } + /** * Get the skuId property: The sku ID of the Azure plan for the subscription. * @@ -207,12 +183,36 @@ public BillingSubscriptionInner withSkuId(String skuId) { } /** - * Get the skuDescription property: The sku description of the Azure plan for the subscription. + * Get the subscriptionBillingStatus property: The current billing status of the subscription. * - * @return the skuDescription value. + * @return the subscriptionBillingStatus value. */ - public String skuDescription() { - return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); + public BillingSubscriptionStatusType subscriptionBillingStatus() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionBillingStatus(); + } + + /** + * Set the subscriptionBillingStatus property: The current billing status of the subscription. + * + * @param subscriptionBillingStatus the subscriptionBillingStatus value to set. + * @return the BillingSubscriptionInner object itself. + */ + public BillingSubscriptionInner withSubscriptionBillingStatus( + BillingSubscriptionStatusType subscriptionBillingStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingSubscriptionProperties(); + } + this.innerProperties().withSubscriptionBillingStatus(subscriptionBillingStatus); + return this; + } + + /** + * Get the subscriptionId property: The ID of the subscription. + * + * @return the subscriptionId value. + */ + public UUID subscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); } /** @@ -230,7 +230,9 @@ public List suspensionReasons() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionProperties.java index 790abdfb933a9..73bc9daf9d1b9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionProperties.java @@ -16,34 +16,10 @@ @Fluent public final class BillingSubscriptionProperties { /* - * The name of the subscription. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * The ID of the subscription. - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private UUID subscriptionId; - - /* - * The current billing status of the subscription. - */ - @JsonProperty(value = "subscriptionBillingStatus") - private BillingSubscriptionStatusType subscriptionBillingStatus; - - /* - * The last month charges. - */ - @JsonProperty(value = "lastMonthCharges", access = JsonProperty.Access.WRITE_ONLY) - private Amount lastMonthCharges; - - /* - * The current month to date charges. + * The name of the billing profile to which the subscription is billed. */ - @JsonProperty(value = "monthToDateCharges", access = JsonProperty.Access.WRITE_ONLY) - private Amount monthToDateCharges; + @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; /* * The ID of the billing profile to which the subscription is billed. @@ -51,18 +27,19 @@ public final class BillingSubscriptionProperties { @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) private String billingProfileId; - /* - * The name of the billing profile to which the subscription is billed. - */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; - /* * The cost center applied to the subscription. */ @JsonProperty(value = "costCenter") private String costCenter; + /* + * The name of the customer for whom the subscription was created. The field is applicable only for Microsoft + * Partner Agreement billing account. + */ + @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String customerDisplayName; + /* * The ID of the customer for whom the subscription was created. The field is applicable only for Microsoft Partner * Agreement billing account. @@ -71,11 +48,16 @@ public final class BillingSubscriptionProperties { private String customerId; /* - * The name of the customer for whom the subscription was created. The field is applicable only for Microsoft - * Partner Agreement billing account. + * The name of the subscription. */ - @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String customerDisplayName; + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The name of the invoice section to which the subscription is billed. + */ + @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionDisplayName; /* * The ID of the invoice section to which the subscription is billed. @@ -84,10 +66,16 @@ public final class BillingSubscriptionProperties { private String invoiceSectionId; /* - * The name of the invoice section to which the subscription is billed. + * The last month charges. */ - @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionDisplayName; + @JsonProperty(value = "lastMonthCharges", access = JsonProperty.Access.WRITE_ONLY) + private Amount lastMonthCharges; + + /* + * The current month to date charges. + */ + @JsonProperty(value = "monthToDateCharges", access = JsonProperty.Access.WRITE_ONLY) + private Amount monthToDateCharges; /* * Reseller for this subscription. @@ -95,6 +83,12 @@ public final class BillingSubscriptionProperties { @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) private Reseller reseller; + /* + * The sku description of the Azure plan for the subscription. + */ + @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) + private String skuDescription; + /* * The sku ID of the Azure plan for the subscription. */ @@ -102,10 +96,16 @@ public final class BillingSubscriptionProperties { private String skuId; /* - * The sku description of the Azure plan for the subscription. + * The current billing status of the subscription. */ - @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) - private String skuDescription; + @JsonProperty(value = "subscriptionBillingStatus") + private BillingSubscriptionStatusType subscriptionBillingStatus; + + /* + * The ID of the subscription. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID subscriptionId; /* * The suspension reason for a subscription. Applies only to subscriptions in Microsoft Online Services Program @@ -119,60 +119,12 @@ public BillingSubscriptionProperties() { } /** - * Get the displayName property: The name of the subscription. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the subscriptionId property: The ID of the subscription. - * - * @return the subscriptionId value. - */ - public UUID subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @return the subscriptionBillingStatus value. - */ - public BillingSubscriptionStatusType subscriptionBillingStatus() { - return this.subscriptionBillingStatus; - } - - /** - * Set the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @param subscriptionBillingStatus the subscriptionBillingStatus value to set. - * @return the BillingSubscriptionProperties object itself. - */ - public BillingSubscriptionProperties withSubscriptionBillingStatus( - BillingSubscriptionStatusType subscriptionBillingStatus) { - this.subscriptionBillingStatus = subscriptionBillingStatus; - return this; - } - - /** - * Get the lastMonthCharges property: The last month charges. - * - * @return the lastMonthCharges value. - */ - public Amount lastMonthCharges() { - return this.lastMonthCharges; - } - - /** - * Get the monthToDateCharges property: The current month to date charges. + * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. * - * @return the monthToDateCharges value. + * @return the billingProfileDisplayName value. */ - public Amount monthToDateCharges() { - return this.monthToDateCharges; + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; } /** @@ -184,15 +136,6 @@ public String billingProfileId() { return this.billingProfileId; } - /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; - } - /** * Get the costCenter property: The cost center applied to the subscription. * @@ -213,6 +156,16 @@ public BillingSubscriptionProperties withCostCenter(String costCenter) { return this; } + /** + * Get the customerDisplayName property: The name of the customer for whom the subscription was created. The field + * is applicable only for Microsoft Partner Agreement billing account. + * + * @return the customerDisplayName value. + */ + public String customerDisplayName() { + return this.customerDisplayName; + } + /** * Get the customerId property: The ID of the customer for whom the subscription was created. The field is * applicable only for Microsoft Partner Agreement billing account. @@ -224,13 +177,21 @@ public String customerId() { } /** - * Get the customerDisplayName property: The name of the customer for whom the subscription was created. The field - * is applicable only for Microsoft Partner Agreement billing account. + * Get the displayName property: The name of the subscription. * - * @return the customerDisplayName value. + * @return the displayName value. */ - public String customerDisplayName() { - return this.customerDisplayName; + public String displayName() { + return this.displayName; + } + + /** + * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. + * + * @return the invoiceSectionDisplayName value. + */ + public String invoiceSectionDisplayName() { + return this.invoiceSectionDisplayName; } /** @@ -243,12 +204,21 @@ public String invoiceSectionId() { } /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. + * Get the lastMonthCharges property: The last month charges. * - * @return the invoiceSectionDisplayName value. + * @return the lastMonthCharges value. */ - public String invoiceSectionDisplayName() { - return this.invoiceSectionDisplayName; + public Amount lastMonthCharges() { + return this.lastMonthCharges; + } + + /** + * Get the monthToDateCharges property: The current month to date charges. + * + * @return the monthToDateCharges value. + */ + public Amount monthToDateCharges() { + return this.monthToDateCharges; } /** @@ -260,6 +230,15 @@ public Reseller reseller() { return this.reseller; } + /** + * Get the skuDescription property: The sku description of the Azure plan for the subscription. + * + * @return the skuDescription value. + */ + public String skuDescription() { + return this.skuDescription; + } + /** * Get the skuId property: The sku ID of the Azure plan for the subscription. * @@ -281,12 +260,33 @@ public BillingSubscriptionProperties withSkuId(String skuId) { } /** - * Get the skuDescription property: The sku description of the Azure plan for the subscription. + * Get the subscriptionBillingStatus property: The current billing status of the subscription. * - * @return the skuDescription value. + * @return the subscriptionBillingStatus value. */ - public String skuDescription() { - return this.skuDescription; + public BillingSubscriptionStatusType subscriptionBillingStatus() { + return this.subscriptionBillingStatus; + } + + /** + * Set the subscriptionBillingStatus property: The current billing status of the subscription. + * + * @param subscriptionBillingStatus the subscriptionBillingStatus value to set. + * @return the BillingSubscriptionProperties object itself. + */ + public BillingSubscriptionProperties withSubscriptionBillingStatus( + BillingSubscriptionStatusType subscriptionBillingStatus) { + this.subscriptionBillingStatus = subscriptionBillingStatus; + return this; + } + + /** + * Get the subscriptionId property: The ID of the subscription. + * + * @return the subscriptionId value. + */ + public UUID subscriptionId() { + return this.subscriptionId; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerInner.java index 5e6b0215c6ff3..5db1490734907 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerInner.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.AzurePlan; import com.azure.resourcemanager.billing.models.Reseller; import com.fasterxml.jackson.annotation.JsonProperty; @@ -13,7 +13,7 @@ /** A partner's customer. */ @Fluent -public final class CustomerInner extends ProxyResource { +public final class CustomerInner extends ArmResource { /* * The customer. */ @@ -34,21 +34,21 @@ private CustomerProperties innerProperties() { } /** - * Get the billingProfileId property: The ID of the billing profile for the invoice section. + * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section. * - * @return the billingProfileId value. + * @return the billingProfileDisplayName value. */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); + public String billingProfileDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); } /** - * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section. + * Get the billingProfileId property: The ID of the billing profile for the invoice section. * - * @return the billingProfileDisplayName value. + * @return the billingProfileId value. */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); + public String billingProfileId() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } /** @@ -125,7 +125,9 @@ public CustomerInner withResellers(List resellers) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyInner.java index 4c61d6545364a..129ffb8afbee8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyInner.java @@ -5,13 +5,13 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.ViewCharges; import com.fasterxml.jackson.annotation.JsonProperty; /** The customer's Policy. */ @Fluent -public final class CustomerPolicyInner extends ProxyResource { +public final class CustomerPolicyInner extends ArmResource { /* * The properties of a customer's policy. */ @@ -61,7 +61,9 @@ public CustomerPolicyInner withViewCharges(ViewCharges viewCharges) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerProperties.java index e6061bfd4a744..78e2c867d84eb 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerProperties.java @@ -13,18 +13,18 @@ /** The properties of a customer. */ @Fluent public final class CustomerProperties { - /* - * The ID of the billing profile for the invoice section. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - /* * The name of the billing profile for the invoice section. */ @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) private String billingProfileDisplayName; + /* + * The ID of the billing profile for the invoice section. + */ + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + /* * The name of the customer. */ @@ -48,21 +48,21 @@ public CustomerProperties() { } /** - * Get the billingProfileId property: The ID of the billing profile for the invoice section. + * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section. * - * @return the billingProfileId value. + * @return the billingProfileDisplayName value. */ - public String billingProfileId() { - return this.billingProfileId; + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; } /** - * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section. + * Get the billingProfileId property: The ID of the billing profile for the invoice section. * - * @return the billingProfileDisplayName value. + * @return the billingProfileId value. */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; + public String billingProfileId() { + return this.billingProfileId; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DepartmentProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DepartmentProperties.java index 6f63be9b9ef04..50ce7cf311390 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DepartmentProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DepartmentProperties.java @@ -12,12 +12,6 @@ /** The properties of a department. */ @Fluent public final class DepartmentProperties { - /* - * The name of the department. - */ - @JsonProperty(value = "departmentName") - private String departmentName; - /* * The cost center associated with the department. */ @@ -25,10 +19,10 @@ public final class DepartmentProperties { private String costCenter; /* - * The status of the department. + * The name of the department. */ - @JsonProperty(value = "status") - private String status; + @JsonProperty(value = "departmentName") + private String departmentName; /* * Associated enrollment accounts. By default this is not populated, unless it's specified in $expand. @@ -36,28 +30,14 @@ public final class DepartmentProperties { @JsonProperty(value = "enrollmentAccounts") private List enrollmentAccounts; - /** Creates an instance of DepartmentProperties class. */ - public DepartmentProperties() { - } - - /** - * Get the departmentName property: The name of the department. - * - * @return the departmentName value. + /* + * The status of the department. */ - public String departmentName() { - return this.departmentName; - } + @JsonProperty(value = "status") + private String status; - /** - * Set the departmentName property: The name of the department. - * - * @param departmentName the departmentName value to set. - * @return the DepartmentProperties object itself. - */ - public DepartmentProperties withDepartmentName(String departmentName) { - this.departmentName = departmentName; - return this; + /** Creates an instance of DepartmentProperties class. */ + public DepartmentProperties() { } /** @@ -81,22 +61,22 @@ public DepartmentProperties withCostCenter(String costCenter) { } /** - * Get the status property: The status of the department. + * Get the departmentName property: The name of the department. * - * @return the status value. + * @return the departmentName value. */ - public String status() { - return this.status; + public String departmentName() { + return this.departmentName; } /** - * Set the status property: The status of the department. + * Set the departmentName property: The name of the department. * - * @param status the status value to set. + * @param departmentName the departmentName value to set. * @return the DepartmentProperties object itself. */ - public DepartmentProperties withStatus(String status) { - this.status = status; + public DepartmentProperties withDepartmentName(String departmentName) { + this.departmentName = departmentName; return this; } @@ -122,6 +102,26 @@ public DepartmentProperties withEnrollmentAccounts(List enrol return this; } + /** + * Get the status property: The status of the department. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status of the department. + * + * @param status the status value to set. + * @return the DepartmentProperties object itself. + */ + public DepartmentProperties withStatus(String status) { + this.status = status; + return this; + } + /** * Validates the instance. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountProperties.java index 7a73dd359bfde..646f6382f8890 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountProperties.java @@ -18,12 +18,6 @@ public final class EnrollmentAccountProperties { @JsonProperty(value = "accountName") private String accountName; - /* - * The cost center associated with the enrollment account. - */ - @JsonProperty(value = "costCenter") - private String costCenter; - /* * The owner of the enrollment account. */ @@ -37,16 +31,16 @@ public final class EnrollmentAccountProperties { private String accountOwnerEmail; /* - * The status of the enrollment account. + * The cost center associated with the enrollment account. */ - @JsonProperty(value = "status") - private String status; + @JsonProperty(value = "costCenter") + private String costCenter; /* - * The start date of the enrollment account. + * Associated department. By default this is not populated, unless it's specified in $expand. */ - @JsonProperty(value = "startDate") - private OffsetDateTime startDate; + @JsonProperty(value = "department") + private Department department; /* * The end date of the enrollment account. @@ -55,10 +49,16 @@ public final class EnrollmentAccountProperties { private OffsetDateTime endDate; /* - * Associated department. By default this is not populated, unless it's specified in $expand. + * The start date of the enrollment account. */ - @JsonProperty(value = "department") - private Department department; + @JsonProperty(value = "startDate") + private OffsetDateTime startDate; + + /* + * The status of the enrollment account. + */ + @JsonProperty(value = "status") + private String status; /** Creates an instance of EnrollmentAccountProperties class. */ public EnrollmentAccountProperties() { @@ -84,26 +84,6 @@ public EnrollmentAccountProperties withAccountName(String accountName) { return this; } - /** - * Get the costCenter property: The cost center associated with the enrollment account. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.costCenter; - } - - /** - * Set the costCenter property: The cost center associated with the enrollment account. - * - * @param costCenter the costCenter value to set. - * @return the EnrollmentAccountProperties object itself. - */ - public EnrollmentAccountProperties withCostCenter(String costCenter) { - this.costCenter = costCenter; - return this; - } - /** * Get the accountOwner property: The owner of the enrollment account. * @@ -145,42 +125,44 @@ public EnrollmentAccountProperties withAccountOwnerEmail(String accountOwnerEmai } /** - * Get the status property: The status of the enrollment account. + * Get the costCenter property: The cost center associated with the enrollment account. * - * @return the status value. + * @return the costCenter value. */ - public String status() { - return this.status; + public String costCenter() { + return this.costCenter; } /** - * Set the status property: The status of the enrollment account. + * Set the costCenter property: The cost center associated with the enrollment account. * - * @param status the status value to set. + * @param costCenter the costCenter value to set. * @return the EnrollmentAccountProperties object itself. */ - public EnrollmentAccountProperties withStatus(String status) { - this.status = status; + public EnrollmentAccountProperties withCostCenter(String costCenter) { + this.costCenter = costCenter; return this; } /** - * Get the startDate property: The start date of the enrollment account. + * Get the department property: Associated department. By default this is not populated, unless it's specified in + * $expand. * - * @return the startDate value. + * @return the department value. */ - public OffsetDateTime startDate() { - return this.startDate; + public Department department() { + return this.department; } /** - * Set the startDate property: The start date of the enrollment account. + * Set the department property: Associated department. By default this is not populated, unless it's specified in + * $expand. * - * @param startDate the startDate value to set. + * @param department the department value to set. * @return the EnrollmentAccountProperties object itself. */ - public EnrollmentAccountProperties withStartDate(OffsetDateTime startDate) { - this.startDate = startDate; + public EnrollmentAccountProperties withDepartment(Department department) { + this.department = department; return this; } @@ -205,24 +187,42 @@ public EnrollmentAccountProperties withEndDate(OffsetDateTime endDate) { } /** - * Get the department property: Associated department. By default this is not populated, unless it's specified in - * $expand. + * Get the startDate property: The start date of the enrollment account. * - * @return the department value. + * @return the startDate value. */ - public Department department() { - return this.department; + public OffsetDateTime startDate() { + return this.startDate; } /** - * Set the department property: Associated department. By default this is not populated, unless it's specified in - * $expand. + * Set the startDate property: The start date of the enrollment account. * - * @param department the department value to set. + * @param startDate the startDate value to set. * @return the EnrollmentAccountProperties object itself. */ - public EnrollmentAccountProperties withDepartment(Department department) { - this.department = department; + public EnrollmentAccountProperties withStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get the status property: The status of the enrollment account. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status of the enrollment account. + * + * @param status the status value to set. + * @return the EnrollmentAccountProperties object itself. + */ + public EnrollmentAccountProperties withStatus(String status) { + this.status = status; return this; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryInner.java deleted file mode 100644 index 39de9f591389e..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryInner.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An enrollment account resource. */ -@Immutable -public final class EnrollmentAccountSummaryInner extends ProxyResource { - /* - * An enrollment account. - */ - @JsonProperty(value = "properties") - private EnrollmentAccountSummaryProperties innerProperties; - - /** Creates an instance of EnrollmentAccountSummaryInner class. */ - public EnrollmentAccountSummaryInner() { - } - - /** - * Get the innerProperties property: An enrollment account. - * - * @return the innerProperties value. - */ - private EnrollmentAccountSummaryProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the principalName property: The account owner's principal name. - * - * @return the principalName value. - */ - public String principalName() { - return this.innerProperties() == null ? null : this.innerProperties().principalName(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryProperties.java deleted file mode 100644 index b844a8e68cb5c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of the enrollment account. */ -@Immutable -public final class EnrollmentAccountSummaryProperties { - /* - * The account owner's principal name. - */ - @JsonProperty(value = "principalName", access = JsonProperty.Access.WRITE_ONLY) - private String principalName; - - /** Creates an instance of EnrollmentAccountSummaryProperties class. */ - public EnrollmentAccountSummaryProperties() { - } - - /** - * Get the principalName property: The account owner's principal name. - * - * @return the principalName value. - */ - public String principalName() { - return this.principalName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionInner.java index 86708fd377919..5c10bc519cd3c 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionInner.java @@ -5,13 +5,13 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.billing.models.ArmResource; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** An instruction. */ @Fluent -public final class InstructionInner extends ProxyResource { +public final class InstructionInner extends ArmResource { /* * A billing instruction used during invoice generation. */ @@ -55,25 +55,25 @@ public InstructionInner withAmount(Float amount) { } /** - * Get the startDate property: The date this billing instruction goes into effect. + * Get the creationDate property: The date this billing instruction was created. * - * @return the startDate value. + * @return the creationDate value. */ - public OffsetDateTime startDate() { - return this.innerProperties() == null ? null : this.innerProperties().startDate(); + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); } /** - * Set the startDate property: The date this billing instruction goes into effect. + * Set the creationDate property: The date this billing instruction was created. * - * @param startDate the startDate value to set. + * @param creationDate the creationDate value to set. * @return the InstructionInner object itself. */ - public InstructionInner withStartDate(OffsetDateTime startDate) { + public InstructionInner withCreationDate(OffsetDateTime creationDate) { if (this.innerProperties() == null) { this.innerProperties = new InstructionProperties(); } - this.innerProperties().withStartDate(startDate); + this.innerProperties().withCreationDate(creationDate); return this; } @@ -101,25 +101,25 @@ public InstructionInner withEndDate(OffsetDateTime endDate) { } /** - * Get the creationDate property: The date this billing instruction was created. + * Get the startDate property: The date this billing instruction goes into effect. * - * @return the creationDate value. + * @return the startDate value. */ - public OffsetDateTime creationDate() { - return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + public OffsetDateTime startDate() { + return this.innerProperties() == null ? null : this.innerProperties().startDate(); } /** - * Set the creationDate property: The date this billing instruction was created. + * Set the startDate property: The date this billing instruction goes into effect. * - * @param creationDate the creationDate value to set. + * @param startDate the startDate value to set. * @return the InstructionInner object itself. */ - public InstructionInner withCreationDate(OffsetDateTime creationDate) { + public InstructionInner withStartDate(OffsetDateTime startDate) { if (this.innerProperties() == null) { this.innerProperties = new InstructionProperties(); } - this.innerProperties().withCreationDate(creationDate); + this.innerProperties().withStartDate(startDate); return this; } @@ -128,7 +128,9 @@ public InstructionInner withCreationDate(OffsetDateTime creationDate) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionProperties.java index ddb06ed321ba2..ab5c259d87506 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionProperties.java @@ -19,10 +19,10 @@ public final class InstructionProperties { private float amount; /* - * The date this billing instruction goes into effect. + * The date this billing instruction was created. */ - @JsonProperty(value = "startDate", required = true) - private OffsetDateTime startDate; + @JsonProperty(value = "creationDate") + private OffsetDateTime creationDate; /* * The date this billing instruction is no longer in effect. @@ -31,10 +31,10 @@ public final class InstructionProperties { private OffsetDateTime endDate; /* - * The date this billing instruction was created. + * The date this billing instruction goes into effect. */ - @JsonProperty(value = "creationDate") - private OffsetDateTime creationDate; + @JsonProperty(value = "startDate", required = true) + private OffsetDateTime startDate; /** Creates an instance of InstructionProperties class. */ public InstructionProperties() { @@ -61,22 +61,22 @@ public InstructionProperties withAmount(float amount) { } /** - * Get the startDate property: The date this billing instruction goes into effect. + * Get the creationDate property: The date this billing instruction was created. * - * @return the startDate value. + * @return the creationDate value. */ - public OffsetDateTime startDate() { - return this.startDate; + public OffsetDateTime creationDate() { + return this.creationDate; } /** - * Set the startDate property: The date this billing instruction goes into effect. + * Set the creationDate property: The date this billing instruction was created. * - * @param startDate the startDate value to set. + * @param creationDate the creationDate value to set. * @return the InstructionProperties object itself. */ - public InstructionProperties withStartDate(OffsetDateTime startDate) { - this.startDate = startDate; + public InstructionProperties withCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; return this; } @@ -101,22 +101,22 @@ public InstructionProperties withEndDate(OffsetDateTime endDate) { } /** - * Get the creationDate property: The date this billing instruction was created. + * Get the startDate property: The date this billing instruction goes into effect. * - * @return the creationDate value. + * @return the startDate value. */ - public OffsetDateTime creationDate() { - return this.creationDate; + public OffsetDateTime startDate() { + return this.startDate; } /** - * Set the creationDate property: The date this billing instruction was created. + * Set the startDate property: The date this billing instruction goes into effect. * - * @param creationDate the creationDate value to set. + * @param startDate the startDate value to set. * @return the InstructionProperties object itself. */ - public InstructionProperties withCreationDate(OffsetDateTime creationDate) { - this.creationDate = creationDate; + public InstructionProperties withStartDate(OffsetDateTime startDate) { + this.startDate = startDate; return this; } @@ -126,15 +126,15 @@ public InstructionProperties withCreationDate(OffsetDateTime creationDate) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (startDate() == null) { + if (endDate() == null) { throw LOGGER .logExceptionAsError( - new IllegalArgumentException("Missing required property startDate in model InstructionProperties")); + new IllegalArgumentException("Missing required property endDate in model InstructionProperties")); } - if (endDate() == null) { + if (startDate() == null) { throw LOGGER .logExceptionAsError( - new IllegalArgumentException("Missing required property endDate in model InstructionProperties")); + new IllegalArgumentException("Missing required property startDate in model InstructionProperties")); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceInner.java index 79f7df1f60e78..8311fdab97880 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.models.Amount; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.Document; import com.azure.resourcemanager.billing.models.InvoiceDocumentType; import com.azure.resourcemanager.billing.models.InvoiceStatus; @@ -20,7 +20,7 @@ /** An invoice. */ @Immutable -public final class InvoiceInner extends ProxyResource { +public final class InvoiceInner extends ArmResource { /* * An invoice. */ @@ -41,58 +41,59 @@ private InvoiceProperties innerProperties() { } /** - * Get the dueDate property: The due date for the invoice. + * Get the amountDue property: The amount due as of now. * - * @return the dueDate value. + * @return the amountDue value. */ - public OffsetDateTime dueDate() { - return this.innerProperties() == null ? null : this.innerProperties().dueDate(); + public Amount amountDue() { + return this.innerProperties() == null ? null : this.innerProperties().amountDue(); } /** - * Get the invoiceDate property: The date when the invoice was generated. + * Get the azurePrepaymentApplied property: The amount of Azure prepayment applied to the charges. This field is + * applicable to billing accounts with agreement type Microsoft Customer Agreement. * - * @return the invoiceDate value. + * @return the azurePrepaymentApplied value. */ - public OffsetDateTime invoiceDate() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceDate(); + public Amount azurePrepaymentApplied() { + return this.innerProperties() == null ? null : this.innerProperties().azurePrepaymentApplied(); } /** - * Get the status property: The current status of the invoice. + * Get the billedAmount property: The total charges for the invoice billing period. * - * @return the status value. + * @return the billedAmount value. */ - public InvoiceStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); + public Amount billedAmount() { + return this.innerProperties() == null ? null : this.innerProperties().billedAmount(); } /** - * Get the amountDue property: The amount due as of now. + * Get the billedDocumentId property: The Id of the active invoice which is originally billed after this invoice was + * voided. This field is applicable to the void invoices only. * - * @return the amountDue value. + * @return the billedDocumentId value. */ - public Amount amountDue() { - return this.innerProperties() == null ? null : this.innerProperties().amountDue(); + public String billedDocumentId() { + return this.innerProperties() == null ? null : this.innerProperties().billedDocumentId(); } /** - * Get the azurePrepaymentApplied property: The amount of Azure prepayment applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. + * Get the billingProfileDisplayName property: The name of the billing profile for which the invoice is generated. * - * @return the azurePrepaymentApplied value. + * @return the billingProfileDisplayName value. */ - public Amount azurePrepaymentApplied() { - return this.innerProperties() == null ? null : this.innerProperties().azurePrepaymentApplied(); + public String billingProfileDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); } /** - * Get the billedAmount property: The total charges for the invoice billing period. + * Get the billingProfileId property: The ID of the billing profile for which the invoice is generated. * - * @return the billedAmount value. + * @return the billingProfileId value. */ - public Amount billedAmount() { - return this.innerProperties() == null ? null : this.innerProperties().billedAmount(); + public String billingProfileId() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } /** @@ -106,52 +107,59 @@ public Amount creditAmount() { } /** - * Get the freeAzureCreditApplied property: The amount of free Azure credits applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. + * Get the creditForDocumentId property: 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. * - * @return the freeAzureCreditApplied value. + * @return the creditForDocumentId value. */ - public Amount freeAzureCreditApplied() { - return this.innerProperties() == null ? null : this.innerProperties().freeAzureCreditApplied(); + public String creditForDocumentId() { + return this.innerProperties() == null ? null : this.innerProperties().creditForDocumentId(); } /** - * Get the subTotal property: The pre-tax amount due. This field is applicable to billing accounts with agreement - * type Microsoft Customer Agreement. + * Get the documents property: List of documents available to download such as invoice and tax receipt. * - * @return the subTotal value. + * @return the documents value. */ - public Amount subTotal() { - return this.innerProperties() == null ? null : this.innerProperties().subTotal(); + public List documents() { + return this.innerProperties() == null ? null : this.innerProperties().documents(); } /** - * Get the taxAmount property: The amount of tax charged for the billing period. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. + * Get the documentType property: The type of the document. * - * @return the taxAmount value. + * @return the documentType value. */ - public Amount taxAmount() { - return this.innerProperties() == null ? null : this.innerProperties().taxAmount(); + public InvoiceDocumentType documentType() { + return this.innerProperties() == null ? null : this.innerProperties().documentType(); } /** - * Get the totalAmount property: The amount due when the invoice was generated. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. + * Get the dueDate property: The due date for the invoice. * - * @return the totalAmount value. + * @return the dueDate value. */ - public Amount totalAmount() { - return this.innerProperties() == null ? null : this.innerProperties().totalAmount(); + public OffsetDateTime dueDate() { + return this.innerProperties() == null ? null : this.innerProperties().dueDate(); } /** - * Get the invoicePeriodStartDate property: The start date of the billing period for which the invoice is generated. + * Get the freeAzureCreditApplied property: The amount of free Azure credits applied to the charges. This field is + * applicable to billing accounts with agreement type Microsoft Customer Agreement. * - * @return the invoicePeriodStartDate value. + * @return the freeAzureCreditApplied value. */ - public OffsetDateTime invoicePeriodStartDate() { - return this.innerProperties() == null ? null : this.innerProperties().invoicePeriodStartDate(); + public Amount freeAzureCreditApplied() { + return this.innerProperties() == null ? null : this.innerProperties().freeAzureCreditApplied(); + } + + /** + * Get the invoiceDate property: The date when the invoice was generated. + * + * @return the invoiceDate value. + */ + public OffsetDateTime invoiceDate() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceDate(); } /** @@ -163,6 +171,15 @@ public OffsetDateTime invoicePeriodEndDate() { return this.innerProperties() == null ? null : this.innerProperties().invoicePeriodEndDate(); } + /** + * Get the invoicePeriodStartDate property: The start date of the billing period for which the invoice is generated. + * + * @return the invoicePeriodStartDate value. + */ + public OffsetDateTime invoicePeriodStartDate() { + return this.innerProperties() == null ? null : this.innerProperties().invoicePeriodStartDate(); + } + /** * Get the invoiceType property: Invoice type. * @@ -183,21 +200,12 @@ public Boolean isMonthlyInvoice() { } /** - * Get the billingProfileId property: The ID of the billing profile for which the invoice is generated. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile for which the invoice is generated. + * Get the payments property: List of payments. * - * @return the billingProfileDisplayName value. + * @return the payments value. */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); + public List payments() { + return this.innerProperties() == null ? null : this.innerProperties().payments(); } /** @@ -210,68 +218,60 @@ public String purchaseOrderNumber() { } /** - * Get the documents property: List of documents available to download such as invoice and tax receipt. - * - * @return the documents value. - */ - public List documents() { - return this.innerProperties() == null ? null : this.innerProperties().documents(); - } - - /** - * Get the payments property: List of payments. + * Get the rebillDetails property: Rebill details for an invoice. * - * @return the payments value. + * @return the rebillDetails value. */ - public List payments() { - return this.innerProperties() == null ? null : this.innerProperties().payments(); + public Map rebillDetails() { + return this.innerProperties() == null ? null : this.innerProperties().rebillDetails(); } /** - * Get the rebillDetails property: Rebill details for an invoice. + * Get the status property: The current status of the invoice. * - * @return the rebillDetails value. + * @return the status value. */ - public Map rebillDetails() { - return this.innerProperties() == null ? null : this.innerProperties().rebillDetails(); + public InvoiceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** - * Get the documentType property: The type of the document. + * Get the subscriptionId property: The ID of the subscription for which the invoice is generated. * - * @return the documentType value. + * @return the subscriptionId value. */ - public InvoiceDocumentType documentType() { - return this.innerProperties() == null ? null : this.innerProperties().documentType(); + public String subscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); } /** - * Get the billedDocumentId property: The Id of the active invoice which is originally billed after this invoice was - * voided. This field is applicable to the void invoices only. + * Get the subTotal property: The pre-tax amount due. This field is applicable to billing accounts with agreement + * type Microsoft Customer Agreement. * - * @return the billedDocumentId value. + * @return the subTotal value. */ - public String billedDocumentId() { - return this.innerProperties() == null ? null : this.innerProperties().billedDocumentId(); + public Amount subTotal() { + return this.innerProperties() == null ? null : this.innerProperties().subTotal(); } /** - * Get the creditForDocumentId property: 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. + * Get the taxAmount property: The amount of tax charged for the billing period. This field is applicable to billing + * accounts with agreement type Microsoft Customer Agreement. * - * @return the creditForDocumentId value. + * @return the taxAmount value. */ - public String creditForDocumentId() { - return this.innerProperties() == null ? null : this.innerProperties().creditForDocumentId(); + public Amount taxAmount() { + return this.innerProperties() == null ? null : this.innerProperties().taxAmount(); } /** - * Get the subscriptionId property: The ID of the subscription for which the invoice is generated. + * Get the totalAmount property: The amount due when the invoice was generated. This field is applicable to billing + * accounts with agreement type Microsoft Customer Agreement. * - * @return the subscriptionId value. + * @return the totalAmount value. */ - public String subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); + public Amount totalAmount() { + return this.innerProperties() == null ? null : this.innerProperties().totalAmount(); } /** @@ -279,7 +279,9 @@ public String subscriptionId() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceProperties.java index b7eb5925fd433..cea1aa0214dc1 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceProperties.java @@ -21,24 +21,6 @@ /** The properties of the invoice. */ @Immutable public final class InvoiceProperties { - /* - * The due date for the invoice. - */ - @JsonProperty(value = "dueDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime dueDate; - - /* - * The date when the invoice was generated. - */ - @JsonProperty(value = "invoiceDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime invoiceDate; - - /* - * The current status of the invoice. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private InvoiceStatus status; - /* * The amount due as of now. */ @@ -58,6 +40,25 @@ public final class InvoiceProperties { @JsonProperty(value = "billedAmount", access = JsonProperty.Access.WRITE_ONLY) private Amount billedAmount; + /* + * The Id of the active invoice which is originally billed after this invoice was voided. This field is applicable + * to the void invoices only. + */ + @JsonProperty(value = "billedDocumentId", access = JsonProperty.Access.WRITE_ONLY) + private String billedDocumentId; + + /* + * The name of the billing profile for which the invoice is generated. + */ + @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; + + /* + * The ID of the billing profile for which the invoice is generated. + */ + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + /* * 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. @@ -66,38 +67,42 @@ public final class InvoiceProperties { private Amount creditAmount; /* - * The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with - * agreement type Microsoft Customer Agreement. + * 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. */ - @JsonProperty(value = "freeAzureCreditApplied", access = JsonProperty.Access.WRITE_ONLY) - private Amount freeAzureCreditApplied; + @JsonProperty(value = "creditForDocumentId", access = JsonProperty.Access.WRITE_ONLY) + private String creditForDocumentId; /* - * The pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer - * Agreement. + * List of documents available to download such as invoice and tax receipt. */ - @JsonProperty(value = "subTotal", access = JsonProperty.Access.WRITE_ONLY) - private Amount subTotal; + @JsonProperty(value = "documents", access = JsonProperty.Access.WRITE_ONLY) + private List documents; /* - * The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement - * type Microsoft Customer Agreement. + * The type of the document. */ - @JsonProperty(value = "taxAmount", access = JsonProperty.Access.WRITE_ONLY) - private Amount taxAmount; + @JsonProperty(value = "documentType", access = JsonProperty.Access.WRITE_ONLY) + private InvoiceDocumentType documentType; /* - * The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type - * Microsoft Customer Agreement. + * The due date for the invoice. */ - @JsonProperty(value = "totalAmount", access = JsonProperty.Access.WRITE_ONLY) - private Amount totalAmount; + @JsonProperty(value = "dueDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime dueDate; /* - * The start date of the billing period for which the invoice is generated. + * The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with + * agreement type Microsoft Customer Agreement. */ - @JsonProperty(value = "invoicePeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime invoicePeriodStartDate; + @JsonProperty(value = "freeAzureCreditApplied", access = JsonProperty.Access.WRITE_ONLY) + private Amount freeAzureCreditApplied; + + /* + * The date when the invoice was generated. + */ + @JsonProperty(value = "invoiceDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime invoiceDate; /* * The end date of the billing period for which the invoice is generated. @@ -105,6 +110,12 @@ public final class InvoiceProperties { @JsonProperty(value = "invoicePeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime invoicePeriodEndDate; + /* + * The start date of the billing period for which the invoice is generated. + */ + @JsonProperty(value = "invoicePeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime invoicePeriodStartDate; + /* * Invoice type. */ @@ -119,16 +130,10 @@ public final class InvoiceProperties { private Boolean isMonthlyInvoice; /* - * The ID of the billing profile for which the invoice is generated. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * The name of the billing profile for which the invoice is generated. + * List of payments. */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; + @JsonProperty(value = "payments", access = JsonProperty.Access.WRITE_ONLY) + private List payments; /* * An optional purchase order number for the invoice. @@ -136,18 +141,6 @@ public final class InvoiceProperties { @JsonProperty(value = "purchaseOrderNumber", access = JsonProperty.Access.WRITE_ONLY) private String purchaseOrderNumber; - /* - * List of documents available to download such as invoice and tax receipt. - */ - @JsonProperty(value = "documents", access = JsonProperty.Access.WRITE_ONLY) - private List documents; - - /* - * List of payments. - */ - @JsonProperty(value = "payments", access = JsonProperty.Access.WRITE_ONLY) - private List payments; - /* * Rebill details for an invoice. */ @@ -156,88 +149,96 @@ public final class InvoiceProperties { private Map rebillDetails; /* - * The type of the document. + * The current status of the invoice. */ - @JsonProperty(value = "documentType", access = JsonProperty.Access.WRITE_ONLY) - private InvoiceDocumentType documentType; + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private InvoiceStatus status; /* - * 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 of the subscription for which the invoice is generated. */ - @JsonProperty(value = "billedDocumentId", access = JsonProperty.Access.WRITE_ONLY) - private String billedDocumentId; + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; /* - * 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 pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer + * Agreement. */ - @JsonProperty(value = "creditForDocumentId", access = JsonProperty.Access.WRITE_ONLY) - private String creditForDocumentId; + @JsonProperty(value = "subTotal", access = JsonProperty.Access.WRITE_ONLY) + private Amount subTotal; /* - * The ID of the subscription for which the invoice is generated. + * The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement + * type Microsoft Customer Agreement. */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; + @JsonProperty(value = "taxAmount", access = JsonProperty.Access.WRITE_ONLY) + private Amount taxAmount; + + /* + * The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type + * Microsoft Customer Agreement. + */ + @JsonProperty(value = "totalAmount", access = JsonProperty.Access.WRITE_ONLY) + private Amount totalAmount; /** Creates an instance of InvoiceProperties class. */ public InvoiceProperties() { } /** - * Get the dueDate property: The due date for the invoice. + * Get the amountDue property: The amount due as of now. * - * @return the dueDate value. + * @return the amountDue value. */ - public OffsetDateTime dueDate() { - return this.dueDate; + public Amount amountDue() { + return this.amountDue; } /** - * Get the invoiceDate property: The date when the invoice was generated. + * Get the azurePrepaymentApplied property: The amount of Azure prepayment applied to the charges. This field is + * applicable to billing accounts with agreement type Microsoft Customer Agreement. * - * @return the invoiceDate value. + * @return the azurePrepaymentApplied value. */ - public OffsetDateTime invoiceDate() { - return this.invoiceDate; + public Amount azurePrepaymentApplied() { + return this.azurePrepaymentApplied; } /** - * Get the status property: The current status of the invoice. + * Get the billedAmount property: The total charges for the invoice billing period. * - * @return the status value. + * @return the billedAmount value. */ - public InvoiceStatus status() { - return this.status; + public Amount billedAmount() { + return this.billedAmount; } /** - * Get the amountDue property: The amount due as of now. + * Get the billedDocumentId property: The Id of the active invoice which is originally billed after this invoice was + * voided. This field is applicable to the void invoices only. * - * @return the amountDue value. + * @return the billedDocumentId value. */ - public Amount amountDue() { - return this.amountDue; + public String billedDocumentId() { + return this.billedDocumentId; } /** - * Get the azurePrepaymentApplied property: The amount of Azure prepayment applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. + * Get the billingProfileDisplayName property: The name of the billing profile for which the invoice is generated. * - * @return the azurePrepaymentApplied value. + * @return the billingProfileDisplayName value. */ - public Amount azurePrepaymentApplied() { - return this.azurePrepaymentApplied; + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; } /** - * Get the billedAmount property: The total charges for the invoice billing period. + * Get the billingProfileId property: The ID of the billing profile for which the invoice is generated. * - * @return the billedAmount value. + * @return the billingProfileId value. */ - public Amount billedAmount() { - return this.billedAmount; + public String billingProfileId() { + return this.billingProfileId; } /** @@ -251,52 +252,59 @@ public Amount creditAmount() { } /** - * Get the freeAzureCreditApplied property: The amount of free Azure credits applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. + * Get the creditForDocumentId property: 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. * - * @return the freeAzureCreditApplied value. + * @return the creditForDocumentId value. */ - public Amount freeAzureCreditApplied() { - return this.freeAzureCreditApplied; + public String creditForDocumentId() { + return this.creditForDocumentId; } /** - * Get the subTotal property: The pre-tax amount due. This field is applicable to billing accounts with agreement - * type Microsoft Customer Agreement. + * Get the documents property: List of documents available to download such as invoice and tax receipt. * - * @return the subTotal value. + * @return the documents value. */ - public Amount subTotal() { - return this.subTotal; + public List documents() { + return this.documents; } /** - * Get the taxAmount property: The amount of tax charged for the billing period. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. + * Get the documentType property: The type of the document. * - * @return the taxAmount value. + * @return the documentType value. */ - public Amount taxAmount() { - return this.taxAmount; + public InvoiceDocumentType documentType() { + return this.documentType; } /** - * Get the totalAmount property: The amount due when the invoice was generated. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. + * Get the dueDate property: The due date for the invoice. * - * @return the totalAmount value. + * @return the dueDate value. */ - public Amount totalAmount() { - return this.totalAmount; + public OffsetDateTime dueDate() { + return this.dueDate; } /** - * Get the invoicePeriodStartDate property: The start date of the billing period for which the invoice is generated. + * Get the freeAzureCreditApplied property: The amount of free Azure credits applied to the charges. This field is + * applicable to billing accounts with agreement type Microsoft Customer Agreement. * - * @return the invoicePeriodStartDate value. + * @return the freeAzureCreditApplied value. */ - public OffsetDateTime invoicePeriodStartDate() { - return this.invoicePeriodStartDate; + public Amount freeAzureCreditApplied() { + return this.freeAzureCreditApplied; + } + + /** + * Get the invoiceDate property: The date when the invoice was generated. + * + * @return the invoiceDate value. + */ + public OffsetDateTime invoiceDate() { + return this.invoiceDate; } /** @@ -308,6 +316,15 @@ public OffsetDateTime invoicePeriodEndDate() { return this.invoicePeriodEndDate; } + /** + * Get the invoicePeriodStartDate property: The start date of the billing period for which the invoice is generated. + * + * @return the invoicePeriodStartDate value. + */ + public OffsetDateTime invoicePeriodStartDate() { + return this.invoicePeriodStartDate; + } + /** * Get the invoiceType property: Invoice type. * @@ -328,21 +345,12 @@ public Boolean isMonthlyInvoice() { } /** - * Get the billingProfileId property: The ID of the billing profile for which the invoice is generated. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile for which the invoice is generated. + * Get the payments property: List of payments. * - * @return the billingProfileDisplayName value. + * @return the payments value. */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; + public List payments() { + return this.payments; } /** @@ -355,68 +363,60 @@ public String purchaseOrderNumber() { } /** - * Get the documents property: List of documents available to download such as invoice and tax receipt. - * - * @return the documents value. - */ - public List documents() { - return this.documents; - } - - /** - * Get the payments property: List of payments. + * Get the rebillDetails property: Rebill details for an invoice. * - * @return the payments value. + * @return the rebillDetails value. */ - public List payments() { - return this.payments; + public Map rebillDetails() { + return this.rebillDetails; } /** - * Get the rebillDetails property: Rebill details for an invoice. + * Get the status property: The current status of the invoice. * - * @return the rebillDetails value. + * @return the status value. */ - public Map rebillDetails() { - return this.rebillDetails; + public InvoiceStatus status() { + return this.status; } /** - * Get the documentType property: The type of the document. + * Get the subscriptionId property: The ID of the subscription for which the invoice is generated. * - * @return the documentType value. + * @return the subscriptionId value. */ - public InvoiceDocumentType documentType() { - return this.documentType; + public String subscriptionId() { + return this.subscriptionId; } /** - * Get the billedDocumentId property: The Id of the active invoice which is originally billed after this invoice was - * voided. This field is applicable to the void invoices only. + * Get the subTotal property: The pre-tax amount due. This field is applicable to billing accounts with agreement + * type Microsoft Customer Agreement. * - * @return the billedDocumentId value. + * @return the subTotal value. */ - public String billedDocumentId() { - return this.billedDocumentId; + public Amount subTotal() { + return this.subTotal; } /** - * Get the creditForDocumentId property: 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. + * Get the taxAmount property: The amount of tax charged for the billing period. This field is applicable to billing + * accounts with agreement type Microsoft Customer Agreement. * - * @return the creditForDocumentId value. + * @return the taxAmount value. */ - public String creditForDocumentId() { - return this.creditForDocumentId; + public Amount taxAmount() { + return this.taxAmount; } /** - * Get the subscriptionId property: The ID of the subscription for which the invoice is generated. + * Get the totalAmount property: The amount due when the invoice was generated. This field is applicable to billing + * accounts with agreement type Microsoft Customer Agreement. * - * @return the subscriptionId value. + * @return the totalAmount value. */ - public String subscriptionId() { - return this.subscriptionId; + public Amount totalAmount() { + return this.totalAmount; } /** @@ -437,21 +437,12 @@ public void validate() { if (creditAmount() != null) { creditAmount().validate(); } - if (freeAzureCreditApplied() != null) { - freeAzureCreditApplied().validate(); - } - if (subTotal() != null) { - subTotal().validate(); - } - if (taxAmount() != null) { - taxAmount().validate(); - } - if (totalAmount() != null) { - totalAmount().validate(); - } if (documents() != null) { documents().forEach(e -> e.validate()); } + if (freeAzureCreditApplied() != null) { + freeAzureCreditApplied().validate(); + } if (payments() != null) { payments().forEach(e -> e.validate()); } @@ -465,5 +456,14 @@ public void validate() { } }); } + if (subTotal() != null) { + subTotal().validate(); + } + if (taxAmount() != null) { + taxAmount().validate(); + } + if (totalAmount() != null) { + totalAmount().validate(); + } } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionInner.java index d17c5bcdafb01..8e24b79951ea6 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionInner.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.InvoiceSectionState; import com.azure.resourcemanager.billing.models.TargetCloud; import com.fasterxml.jackson.annotation.JsonProperty; @@ -13,7 +13,7 @@ /** An invoice section. */ @Fluent -public final class InvoiceSectionInner extends ProxyResource { +public final class InvoiceSectionInner extends ArmResource { /* * The properties of an invoice section. */ @@ -140,7 +140,9 @@ public TargetCloud targetCloud() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionWithCreateSubPermissionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionWithCreateSubPermissionInner.java index 21475859d3b40..e745312cd2693 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionWithCreateSubPermissionInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionWithCreateSubPermissionInner.java @@ -16,22 +16,10 @@ @Fluent public final class InvoiceSectionWithCreateSubPermissionInner { /* - * The ID of the invoice section. - */ - @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - - /* - * The name of the invoice section. - */ - @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionDisplayName; - - /* - * The system generated unique identifier for an invoice section. + * The name of the billing profile for the invoice section. */ - @JsonProperty(value = "invoiceSectionSystemId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionSystemId; + @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; /* * The ID of the billing profile for the invoice section. @@ -40,10 +28,10 @@ public final class InvoiceSectionWithCreateSubPermissionInner { private String billingProfileId; /* - * The name of the billing profile for the invoice section. + * The billing profile spending limit. */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; + @JsonProperty(value = "billingProfileSpendingLimit", access = JsonProperty.Access.WRITE_ONLY) + private SpendingLimitForBillingProfile billingProfileSpendingLimit; /* * The status of the billing profile. @@ -57,12 +45,6 @@ public final class InvoiceSectionWithCreateSubPermissionInner { @JsonProperty(value = "billingProfileStatusReasonCode", access = JsonProperty.Access.WRITE_ONLY) private StatusReasonCodeForBillingProfile billingProfileStatusReasonCode; - /* - * The billing profile spending limit. - */ - @JsonProperty(value = "billingProfileSpendingLimit", access = JsonProperty.Access.WRITE_ONLY) - private SpendingLimitForBillingProfile billingProfileSpendingLimit; - /* * The system generated unique identifier for a billing profile. */ @@ -75,35 +57,35 @@ public final class InvoiceSectionWithCreateSubPermissionInner { @JsonProperty(value = "enabledAzurePlans") private List enabledAzurePlans; - /** Creates an instance of InvoiceSectionWithCreateSubPermissionInner class. */ - public InvoiceSectionWithCreateSubPermissionInner() { - } + /* + * The name of the invoice section. + */ + @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionDisplayName; - /** - * Get the invoiceSectionId property: The ID of the invoice section. - * - * @return the invoiceSectionId value. + /* + * The ID of the invoice section. */ - public String invoiceSectionId() { - return this.invoiceSectionId; - } + @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section. - * - * @return the invoiceSectionDisplayName value. + /* + * The system generated unique identifier for an invoice section. */ - public String invoiceSectionDisplayName() { - return this.invoiceSectionDisplayName; + @JsonProperty(value = "invoiceSectionSystemId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionSystemId; + + /** Creates an instance of InvoiceSectionWithCreateSubPermissionInner class. */ + public InvoiceSectionWithCreateSubPermissionInner() { } /** - * Get the invoiceSectionSystemId property: The system generated unique identifier for an invoice section. + * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section. * - * @return the invoiceSectionSystemId value. + * @return the billingProfileDisplayName value. */ - public String invoiceSectionSystemId() { - return this.invoiceSectionSystemId; + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; } /** @@ -116,12 +98,12 @@ public String billingProfileId() { } /** - * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section. + * Get the billingProfileSpendingLimit property: The billing profile spending limit. * - * @return the billingProfileDisplayName value. + * @return the billingProfileSpendingLimit value. */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; + public SpendingLimitForBillingProfile billingProfileSpendingLimit() { + return this.billingProfileSpendingLimit; } /** @@ -142,15 +124,6 @@ public StatusReasonCodeForBillingProfile billingProfileStatusReasonCode() { return this.billingProfileStatusReasonCode; } - /** - * Get the billingProfileSpendingLimit property: The billing profile spending limit. - * - * @return the billingProfileSpendingLimit value. - */ - public SpendingLimitForBillingProfile billingProfileSpendingLimit() { - return this.billingProfileSpendingLimit; - } - /** * Get the billingProfileSystemId property: The system generated unique identifier for a billing profile. * @@ -180,6 +153,33 @@ public InvoiceSectionWithCreateSubPermissionInner withEnabledAzurePlans(List logos() { + return this.innerProperties() == null ? null : this.innerProperties().logos(); + } + + /** + * Set the logos property: The list of logos for the payment method. + * + * @param logos the logos value to set. + * @return the PaymentMethodInner object itself. + */ + public PaymentMethodInner withLogos(List logos) { + if (this.innerProperties() == null) { + this.innerProperties = new PaymentMethodProperties(); + } + this.innerProperties().withLogos(logos); + return this; + } + + /** + * Get the status property: Status of the payment method. + * + * @return the status value. + */ + public PaymentMethodStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Status of the payment method. + * + * @param status the status value to set. + * @return the PaymentMethodInner object itself. + */ + public PaymentMethodInner withStatus(PaymentMethodStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new PaymentMethodProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the type property: The type of payment method. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodLinkInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodLinkInner.java new file mode 100644 index 0000000000000..c049b1ca52e29 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodLinkInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.models.ArmResource; +import com.azure.resourcemanager.billing.models.PaymentMethodProjectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A payment method link. */ +@Fluent +public final class PaymentMethodLinkInner extends ArmResource { + /* + * The properties of a payment method link. + */ + @JsonProperty(value = "properties") + private PaymentMethodLinkProperties innerProperties; + + /** Creates an instance of PaymentMethodLinkInner class. */ + public PaymentMethodLinkInner() { + } + + /** + * Get the innerProperties property: The properties of a payment method link. + * + * @return the innerProperties value. + */ + private PaymentMethodLinkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the paymentMethod property: Projection of a payment method. + * + * @return the paymentMethod value. + */ + public PaymentMethodProjectionProperties paymentMethod() { + return this.innerProperties() == null ? null : this.innerProperties().paymentMethod(); + } + + /** + * Set the paymentMethod property: Projection of a payment method. + * + * @param paymentMethod the paymentMethod value to set. + * @return the PaymentMethodLinkInner object itself. + */ + public PaymentMethodLinkInner withPaymentMethod(PaymentMethodProjectionProperties paymentMethod) { + if (this.innerProperties() == null) { + this.innerProperties = new PaymentMethodLinkProperties(); + } + this.innerProperties().withPaymentMethod(paymentMethod); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodLinkProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodLinkProperties.java new file mode 100644 index 0000000000000..d2d03254727fa --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodLinkProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.models.PaymentMethodProjectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a payment method link. */ +@Fluent +public final class PaymentMethodLinkProperties { + /* + * Projection of a payment method + */ + @JsonProperty(value = "paymentMethod") + private PaymentMethodProjectionProperties paymentMethod; + + /** Creates an instance of PaymentMethodLinkProperties class. */ + public PaymentMethodLinkProperties() { + } + + /** + * Get the paymentMethod property: Projection of a payment method. + * + * @return the paymentMethod value. + */ + public PaymentMethodProjectionProperties paymentMethod() { + return this.paymentMethod; + } + + /** + * Set the paymentMethod property: Projection of a payment method. + * + * @param paymentMethod the paymentMethod value to set. + * @return the PaymentMethodLinkProperties object itself. + */ + public PaymentMethodLinkProperties withPaymentMethod(PaymentMethodProjectionProperties paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (paymentMethod() != null) { + paymentMethod().validate(); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodProperties.java new file mode 100644 index 0000000000000..e9e9bec2ddba1 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PaymentMethodProperties.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.models.PaymentMethodFamily; +import com.azure.resourcemanager.billing.models.PaymentMethodLogo; +import com.azure.resourcemanager.billing.models.PaymentMethodStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a payment method. */ +@Fluent +public final class PaymentMethodProperties { + /* + * The account holder name for the payment method. This is only supported for payment methods with family + * CreditCard. + */ + @JsonProperty(value = "accountHolderName", access = JsonProperty.Access.WRITE_ONLY) + private String accountHolderName; + + /* + * The display name of the payment method. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The expiration month and year of the payment method. This is only supported for payment methods with family + * CreditCard. + */ + @JsonProperty(value = "expiration", access = JsonProperty.Access.WRITE_ONLY) + private String expiration; + + /* + * The family of payment method. + */ + @JsonProperty(value = "family") + private PaymentMethodFamily family; + + /* + * Last four digits of payment method. + */ + @JsonProperty(value = "lastFourDigits", access = JsonProperty.Access.WRITE_ONLY) + private String lastFourDigits; + + /* + * The list of logos for the payment method. + */ + @JsonProperty(value = "logos") + private List logos; + + /* + * Status of the payment method. + */ + @JsonProperty(value = "status") + private PaymentMethodStatus status; + + /* + * The type of payment method. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** Creates an instance of PaymentMethodProperties class. */ + public PaymentMethodProperties() { + } + + /** + * Get the accountHolderName property: The account holder name for the payment method. This is only supported for + * payment methods with family CreditCard. + * + * @return the accountHolderName value. + */ + public String accountHolderName() { + return this.accountHolderName; + } + + /** + * Get the displayName property: The display name of the payment method. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the expiration property: The expiration month and year of the payment method. This is only supported for + * payment methods with family CreditCard. + * + * @return the expiration value. + */ + public String expiration() { + return this.expiration; + } + + /** + * Get the family property: The family of payment method. + * + * @return the family value. + */ + public PaymentMethodFamily family() { + return this.family; + } + + /** + * Set the family property: The family of payment method. + * + * @param family the family value to set. + * @return the PaymentMethodProperties object itself. + */ + public PaymentMethodProperties withFamily(PaymentMethodFamily family) { + this.family = family; + return this; + } + + /** + * Get the lastFourDigits property: Last four digits of payment method. + * + * @return the lastFourDigits value. + */ + public String lastFourDigits() { + return this.lastFourDigits; + } + + /** + * Get the logos property: The list of logos for the payment method. + * + * @return the logos value. + */ + public List logos() { + return this.logos; + } + + /** + * Set the logos property: The list of logos for the payment method. + * + * @param logos the logos value to set. + * @return the PaymentMethodProperties object itself. + */ + public PaymentMethodProperties withLogos(List logos) { + this.logos = logos; + return this; + } + + /** + * Get the status property: Status of the payment method. + * + * @return the status value. + */ + public PaymentMethodStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the payment method. + * + * @param status the status value to set. + * @return the PaymentMethodProperties object itself. + */ + public PaymentMethodProperties withStatus(PaymentMethodStatus status) { + this.status = status; + return this; + } + + /** + * Get the type property: The type of payment method. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logos() != null) { + logos().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyInner.java index 92dfa6a9338b6..0ecf4197c9e21 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyInner.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; import com.azure.resourcemanager.billing.models.ViewChargesPolicy; @@ -13,7 +13,7 @@ /** A policy. */ @Fluent -public final class PolicyInner extends ProxyResource { +public final class PolicyInner extends ArmResource { /* * The properties of a policy. */ @@ -113,7 +113,9 @@ public PolicyInner withViewCharges(ViewChargesPolicy viewCharges) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductInner.java index 7e876cc538ab0..9f126885c8265 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.models.Amount; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.AutoRenew; import com.azure.resourcemanager.billing.models.BillingFrequency; import com.azure.resourcemanager.billing.models.ProductStatusType; @@ -16,7 +16,7 @@ /** A product. */ @Fluent -public final class ProductInner extends ProxyResource { +public final class ProductInner extends ArmResource { /* * The properties of a product. */ @@ -60,62 +60,82 @@ public ProductInner withAutoRenew(AutoRenew autoRenew) { } /** - * Get the displayName property: The display name of the product. + * Get the availabilityId property: The availability of the product. * - * @return the displayName value. + * @return the availabilityId value. */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); + public String availabilityId() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityId(); } /** - * Get the purchaseDate property: The date when the product was purchased. + * Get the billingFrequency property: The frequency at which the product will be billed. * - * @return the purchaseDate value. + * @return the billingFrequency value. */ - public OffsetDateTime purchaseDate() { - return this.innerProperties() == null ? null : this.innerProperties().purchaseDate(); + public BillingFrequency billingFrequency() { + return this.innerProperties() == null ? null : this.innerProperties().billingFrequency(); } /** - * Get the productTypeId property: The ID of the type of product. + * Set the billingFrequency property: The frequency at which the product will be billed. * - * @return the productTypeId value. + * @param billingFrequency the billingFrequency value to set. + * @return the ProductInner object itself. */ - public String productTypeId() { - return this.innerProperties() == null ? null : this.innerProperties().productTypeId(); + public ProductInner withBillingFrequency(BillingFrequency billingFrequency) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductProperties(); + } + this.innerProperties().withBillingFrequency(billingFrequency); + return this; } /** - * Get the productType property: The description of the type of product. + * Get the billingProfileDisplayName property: The name of the billing profile to which the product is billed. * - * @return the productType value. + * @return the billingProfileDisplayName value. */ - public String productType() { - return this.innerProperties() == null ? null : this.innerProperties().productType(); + public String billingProfileDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); } /** - * Get the status property: The current status of the product. + * Get the billingProfileId property: The ID of the billing profile to which the product is billed. * - * @return the status value. + * @return the billingProfileId value. */ - public ProductStatusType status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); + public String billingProfileId() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } /** - * Set the status property: The current status of the product. + * Get the customerDisplayName property: The name of the customer for whom the product was purchased. The field is + * applicable only for Microsoft Partner Agreement billing account. * - * @param status the status value to set. - * @return the ProductInner object itself. + * @return the customerDisplayName value. */ - public ProductInner withStatus(ProductStatusType status) { - if (this.innerProperties() == null) { - this.innerProperties = new ProductProperties(); - } - this.innerProperties().withStatus(status); - return this; + public String customerDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); + } + + /** + * Get the customerId property: The ID of the customer for whom the product was purchased. The field is applicable + * only for Microsoft Partner Agreement billing account. + * + * @return the customerId value. + */ + public String customerId() { + return this.innerProperties() == null ? null : this.innerProperties().customerId(); + } + + /** + * Get the displayName property: The display name of the product. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -128,26 +148,21 @@ public OffsetDateTime endDate() { } /** - * Get the billingFrequency property: The frequency at which the product will be billed. + * Get the invoiceSectionDisplayName property: The name of the invoice section to which the product is billed. * - * @return the billingFrequency value. + * @return the invoiceSectionDisplayName value. */ - public BillingFrequency billingFrequency() { - return this.innerProperties() == null ? null : this.innerProperties().billingFrequency(); + public String invoiceSectionDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); } /** - * Set the billingFrequency property: The frequency at which the product will be billed. + * Get the invoiceSectionId property: The ID of the invoice section to which the product is billed. * - * @param billingFrequency the billingFrequency value to set. - * @return the ProductInner object itself. + * @return the invoiceSectionId value. */ - public ProductInner withBillingFrequency(BillingFrequency billingFrequency) { - if (this.innerProperties() == null) { - this.innerProperties = new ProductProperties(); - } - this.innerProperties().withBillingFrequency(billingFrequency); - return this; + public String invoiceSectionId() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); } /** @@ -169,113 +184,98 @@ public OffsetDateTime lastChargeDate() { } /** - * Get the quantity property: The quantity purchased for the product. - * - * @return the quantity value. - */ - public Float quantity() { - return this.innerProperties() == null ? null : this.innerProperties().quantity(); - } - - /** - * Get the skuId property: The sku ID of the product. - * - * @return the skuId value. - */ - public String skuId() { - return this.innerProperties() == null ? null : this.innerProperties().skuId(); - } - - /** - * Get the skuDescription property: The sku description of the product. + * Get the productType property: The description of the type of product. * - * @return the skuDescription value. + * @return the productType value. */ - public String skuDescription() { - return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); + public String productType() { + return this.innerProperties() == null ? null : this.innerProperties().productType(); } /** - * Get the tenantId property: The id of the tenant in which the product is used. + * Get the productTypeId property: The ID of the type of product. * - * @return the tenantId value. + * @return the productTypeId value. */ - public String tenantId() { - return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + public String productTypeId() { + return this.innerProperties() == null ? null : this.innerProperties().productTypeId(); } /** - * Get the availabilityId property: The availability of the product. + * Get the purchaseDate property: The date when the product was purchased. * - * @return the availabilityId value. + * @return the purchaseDate value. */ - public String availabilityId() { - return this.innerProperties() == null ? null : this.innerProperties().availabilityId(); + public OffsetDateTime purchaseDate() { + return this.innerProperties() == null ? null : this.innerProperties().purchaseDate(); } /** - * Get the invoiceSectionId property: The ID of the invoice section to which the product is billed. + * Get the quantity property: The quantity purchased for the product. * - * @return the invoiceSectionId value. + * @return the quantity value. */ - public String invoiceSectionId() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); + public Float quantity() { + return this.innerProperties() == null ? null : this.innerProperties().quantity(); } /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the product is billed. + * Get the reseller property: Reseller for this product. * - * @return the invoiceSectionDisplayName value. + * @return the reseller value. */ - public String invoiceSectionDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); + public Reseller reseller() { + return this.innerProperties() == null ? null : this.innerProperties().reseller(); } /** - * Get the billingProfileId property: The ID of the billing profile to which the product is billed. + * Get the skuDescription property: The sku description of the product. * - * @return the billingProfileId value. + * @return the skuDescription value. */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); + public String skuDescription() { + return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); } /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the product is billed. + * Get the skuId property: The sku ID of the product. * - * @return the billingProfileDisplayName value. + * @return the skuId value. */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); + public String skuId() { + return this.innerProperties() == null ? null : this.innerProperties().skuId(); } /** - * Get the customerId property: The ID of the customer for whom the product was purchased. The field is applicable - * only for Microsoft Partner Agreement billing account. + * Get the status property: The current status of the product. * - * @return the customerId value. + * @return the status value. */ - public String customerId() { - return this.innerProperties() == null ? null : this.innerProperties().customerId(); + public ProductStatusType status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** - * Get the customerDisplayName property: The name of the customer for whom the product was purchased. The field is - * applicable only for Microsoft Partner Agreement billing account. + * Set the status property: The current status of the product. * - * @return the customerDisplayName value. + * @param status the status value to set. + * @return the ProductInner object itself. */ - public String customerDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); + public ProductInner withStatus(ProductStatusType status) { + if (this.innerProperties() == null) { + this.innerProperties = new ProductProperties(); + } + this.innerProperties().withStatus(status); + return this; } /** - * Get the reseller property: Reseller for this product. + * Get the tenantId property: The id of the tenant in which the product is used. * - * @return the reseller value. + * @return the tenantId value. */ - public Reseller reseller() { - return this.innerProperties() == null ? null : this.innerProperties().reseller(); + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); } /** @@ -283,7 +283,9 @@ public Reseller reseller() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductProperties.java index 971f2f5a1d757..ee3ddbfe0817e 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductProperties.java @@ -23,132 +23,132 @@ public final class ProductProperties { private AutoRenew autoRenew; /* - * The display name of the product. + * The availability of the product. */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; + @JsonProperty(value = "availabilityId", access = JsonProperty.Access.WRITE_ONLY) + private String availabilityId; /* - * The date when the product was purchased. + * The frequency at which the product will be billed. */ - @JsonProperty(value = "purchaseDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime purchaseDate; + @JsonProperty(value = "billingFrequency") + private BillingFrequency billingFrequency; /* - * The ID of the type of product. + * The name of the billing profile to which the product is billed. */ - @JsonProperty(value = "productTypeId", access = JsonProperty.Access.WRITE_ONLY) - private String productTypeId; + @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; /* - * The description of the type of product. + * The ID of the billing profile to which the product is billed. */ - @JsonProperty(value = "productType", access = JsonProperty.Access.WRITE_ONLY) - private String productType; + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; /* - * The current status of the product. + * The name of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner + * Agreement billing account. */ - @JsonProperty(value = "status") - private ProductStatusType status; + @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String customerDisplayName; /* - * The date when the product will be renewed or canceled. + * The ID of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner + * Agreement billing account. */ - @JsonProperty(value = "endDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endDate; + @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; /* - * The frequency at which the product will be billed. + * The display name of the product. */ - @JsonProperty(value = "billingFrequency") - private BillingFrequency billingFrequency; + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; /* - * The last month charges. + * The date when the product will be renewed or canceled. */ - @JsonProperty(value = "lastCharge", access = JsonProperty.Access.WRITE_ONLY) - private Amount lastCharge; + @JsonProperty(value = "endDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endDate; /* - * The date of the last charge. + * The name of the invoice section to which the product is billed. */ - @JsonProperty(value = "lastChargeDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastChargeDate; + @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionDisplayName; /* - * The quantity purchased for the product. + * The ID of the invoice section to which the product is billed. */ - @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) - private Float quantity; + @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; /* - * The sku ID of the product. + * The last month charges. */ - @JsonProperty(value = "skuId", access = JsonProperty.Access.WRITE_ONLY) - private String skuId; + @JsonProperty(value = "lastCharge", access = JsonProperty.Access.WRITE_ONLY) + private Amount lastCharge; /* - * The sku description of the product. + * The date of the last charge. */ - @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) - private String skuDescription; + @JsonProperty(value = "lastChargeDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastChargeDate; /* - * The id of the tenant in which the product is used. + * The description of the type of product. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; + @JsonProperty(value = "productType", access = JsonProperty.Access.WRITE_ONLY) + private String productType; /* - * The availability of the product. + * The ID of the type of product. */ - @JsonProperty(value = "availabilityId", access = JsonProperty.Access.WRITE_ONLY) - private String availabilityId; + @JsonProperty(value = "productTypeId", access = JsonProperty.Access.WRITE_ONLY) + private String productTypeId; /* - * The ID of the invoice section to which the product is billed. + * The date when the product was purchased. */ - @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; + @JsonProperty(value = "purchaseDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime purchaseDate; /* - * The name of the invoice section to which the product is billed. + * The quantity purchased for the product. */ - @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionDisplayName; + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Float quantity; /* - * The ID of the billing profile to which the product is billed. + * Reseller for this product. */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; + @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) + private Reseller reseller; /* - * The name of the billing profile to which the product is billed. + * The sku description of the product. */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; + @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) + private String skuDescription; /* - * The ID of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner - * Agreement billing account. + * The sku ID of the product. */ - @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) - private String customerId; + @JsonProperty(value = "skuId", access = JsonProperty.Access.WRITE_ONLY) + private String skuId; /* - * The name of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner - * Agreement billing account. + * The current status of the product. */ - @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String customerDisplayName; + @JsonProperty(value = "status") + private ProductStatusType status; /* - * Reseller for this product. + * The id of the tenant in which the product is used. */ - @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) - private Reseller reseller; + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; /** Creates an instance of ProductProperties class. */ public ProductProperties() { @@ -175,59 +175,79 @@ public ProductProperties withAutoRenew(AutoRenew autoRenew) { } /** - * Get the displayName property: The display name of the product. + * Get the availabilityId property: The availability of the product. * - * @return the displayName value. + * @return the availabilityId value. */ - public String displayName() { - return this.displayName; + public String availabilityId() { + return this.availabilityId; } /** - * Get the purchaseDate property: The date when the product was purchased. + * Get the billingFrequency property: The frequency at which the product will be billed. * - * @return the purchaseDate value. + * @return the billingFrequency value. */ - public OffsetDateTime purchaseDate() { - return this.purchaseDate; + public BillingFrequency billingFrequency() { + return this.billingFrequency; } /** - * Get the productTypeId property: The ID of the type of product. + * Set the billingFrequency property: The frequency at which the product will be billed. * - * @return the productTypeId value. + * @param billingFrequency the billingFrequency value to set. + * @return the ProductProperties object itself. */ - public String productTypeId() { - return this.productTypeId; + public ProductProperties withBillingFrequency(BillingFrequency billingFrequency) { + this.billingFrequency = billingFrequency; + return this; } /** - * Get the productType property: The description of the type of product. + * Get the billingProfileDisplayName property: The name of the billing profile to which the product is billed. * - * @return the productType value. + * @return the billingProfileDisplayName value. */ - public String productType() { - return this.productType; + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; } /** - * Get the status property: The current status of the product. + * Get the billingProfileId property: The ID of the billing profile to which the product is billed. * - * @return the status value. + * @return the billingProfileId value. */ - public ProductStatusType status() { - return this.status; + public String billingProfileId() { + return this.billingProfileId; } /** - * Set the status property: The current status of the product. + * Get the customerDisplayName property: The name of the customer for whom the product was purchased. The field is + * applicable only for Microsoft Partner Agreement billing account. * - * @param status the status value to set. - * @return the ProductProperties object itself. + * @return the customerDisplayName value. */ - public ProductProperties withStatus(ProductStatusType status) { - this.status = status; - return this; + public String customerDisplayName() { + return this.customerDisplayName; + } + + /** + * Get the customerId property: The ID of the customer for whom the product was purchased. The field is applicable + * only for Microsoft Partner Agreement billing account. + * + * @return the customerId value. + */ + public String customerId() { + return this.customerId; + } + + /** + * Get the displayName property: The display name of the product. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; } /** @@ -240,23 +260,21 @@ public OffsetDateTime endDate() { } /** - * Get the billingFrequency property: The frequency at which the product will be billed. + * Get the invoiceSectionDisplayName property: The name of the invoice section to which the product is billed. * - * @return the billingFrequency value. + * @return the invoiceSectionDisplayName value. */ - public BillingFrequency billingFrequency() { - return this.billingFrequency; + public String invoiceSectionDisplayName() { + return this.invoiceSectionDisplayName; } /** - * Set the billingFrequency property: The frequency at which the product will be billed. + * Get the invoiceSectionId property: The ID of the invoice section to which the product is billed. * - * @param billingFrequency the billingFrequency value to set. - * @return the ProductProperties object itself. + * @return the invoiceSectionId value. */ - public ProductProperties withBillingFrequency(BillingFrequency billingFrequency) { - this.billingFrequency = billingFrequency; - return this; + public String invoiceSectionId() { + return this.invoiceSectionId; } /** @@ -278,113 +296,95 @@ public OffsetDateTime lastChargeDate() { } /** - * Get the quantity property: The quantity purchased for the product. - * - * @return the quantity value. - */ - public Float quantity() { - return this.quantity; - } - - /** - * Get the skuId property: The sku ID of the product. - * - * @return the skuId value. - */ - public String skuId() { - return this.skuId; - } - - /** - * Get the skuDescription property: The sku description of the product. + * Get the productType property: The description of the type of product. * - * @return the skuDescription value. + * @return the productType value. */ - public String skuDescription() { - return this.skuDescription; + public String productType() { + return this.productType; } /** - * Get the tenantId property: The id of the tenant in which the product is used. + * Get the productTypeId property: The ID of the type of product. * - * @return the tenantId value. + * @return the productTypeId value. */ - public String tenantId() { - return this.tenantId; + public String productTypeId() { + return this.productTypeId; } /** - * Get the availabilityId property: The availability of the product. + * Get the purchaseDate property: The date when the product was purchased. * - * @return the availabilityId value. + * @return the purchaseDate value. */ - public String availabilityId() { - return this.availabilityId; + public OffsetDateTime purchaseDate() { + return this.purchaseDate; } /** - * Get the invoiceSectionId property: The ID of the invoice section to which the product is billed. + * Get the quantity property: The quantity purchased for the product. * - * @return the invoiceSectionId value. + * @return the quantity value. */ - public String invoiceSectionId() { - return this.invoiceSectionId; + public Float quantity() { + return this.quantity; } /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the product is billed. + * Get the reseller property: Reseller for this product. * - * @return the invoiceSectionDisplayName value. + * @return the reseller value. */ - public String invoiceSectionDisplayName() { - return this.invoiceSectionDisplayName; + public Reseller reseller() { + return this.reseller; } /** - * Get the billingProfileId property: The ID of the billing profile to which the product is billed. + * Get the skuDescription property: The sku description of the product. * - * @return the billingProfileId value. + * @return the skuDescription value. */ - public String billingProfileId() { - return this.billingProfileId; + public String skuDescription() { + return this.skuDescription; } /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the product is billed. + * Get the skuId property: The sku ID of the product. * - * @return the billingProfileDisplayName value. + * @return the skuId value. */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; + public String skuId() { + return this.skuId; } /** - * Get the customerId property: The ID of the customer for whom the product was purchased. The field is applicable - * only for Microsoft Partner Agreement billing account. + * Get the status property: The current status of the product. * - * @return the customerId value. + * @return the status value. */ - public String customerId() { - return this.customerId; + public ProductStatusType status() { + return this.status; } /** - * Get the customerDisplayName property: The name of the customer for whom the product was purchased. The field is - * applicable only for Microsoft Partner Agreement billing account. + * Set the status property: The current status of the product. * - * @return the customerDisplayName value. + * @param status the status value to set. + * @return the ProductProperties object itself. */ - public String customerDisplayName() { - return this.customerDisplayName; + public ProductProperties withStatus(ProductStatusType status) { + this.status = status; + return this; } /** - * Get the reseller property: Reseller for this product. + * Get the tenantId property: The id of the tenant in which the product is used. * - * @return the reseller value. + * @return the tenantId value. */ - public Reseller reseller() { - return this.reseller; + public String tenantId() { + return this.tenantId; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationInner.java index dfa2007edd4ad..c8dcd1b0b1170 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationInner.java @@ -20,22 +20,22 @@ public final class ReservationInner { private String id; /* - * The name of the reservation. + * The location of the reservation. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; /* - * The type of the reservation. + * The name of the reservation. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; /* - * The location of the reservation. + * The properties associated to this reservation */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; + @JsonProperty(value = "properties") + private ReservationProperty innerProperties; /* * The sku information associated to this reservation @@ -44,10 +44,10 @@ public final class ReservationInner { private ReservationSkuProperty sku; /* - * The properties associated to this reservation + * The type of the reservation. */ - @JsonProperty(value = "properties") - private ReservationProperty innerProperties; + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; /** Creates an instance of ReservationInner class. */ public ReservationInner() { @@ -63,30 +63,30 @@ public String id() { } /** - * Get the name property: The name of the reservation. + * Get the location property: The location of the reservation. * - * @return the name value. + * @return the location value. */ - public String name() { - return this.name; + public String location() { + return this.location; } /** - * Get the type property: The type of the reservation. + * Get the name property: The name of the reservation. * - * @return the type value. + * @return the name value. */ - public String type() { - return this.type; + public String name() { + return this.name; } /** - * Get the location property: The location of the reservation. + * Get the innerProperties property: The properties associated to this reservation. * - * @return the location value. + * @return the innerProperties value. */ - public String location() { - return this.location; + private ReservationProperty innerProperties() { + return this.innerProperties; } /** @@ -110,12 +110,12 @@ public ReservationInner withSku(ReservationSkuProperty sku) { } /** - * Get the innerProperties property: The properties associated to this reservation. + * Get the type property: The type of the reservation. * - * @return the innerProperties value. + * @return the type value. */ - private ReservationProperty innerProperties() { - return this.innerProperties; + public String type() { + return this.type; } /** @@ -153,30 +153,30 @@ public String appliedScopeType() { } /** - * Get the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine. + * Get the displayName property: The display name of the reservation. * - * @return the reservedResourceType value. + * @return the displayName value. */ - public String reservedResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().reservedResourceType(); + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** - * Get the quantity property: The number of the reservation. + * Get the displayProvisioningState property: The provisioning state of the reservation for display, e.g. Succeeded. * - * @return the quantity value. + * @return the displayProvisioningState value. */ - public Float quantity() { - return this.innerProperties() == null ? null : this.innerProperties().quantity(); + public String displayProvisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().displayProvisioningState(); } /** - * Get the provisioningState property: The provisioning state of the reservation, e.g. Succeeded. + * Get the effectiveDateTime property: The effective date time of the reservation. * - * @return the provisioningState value. + * @return the effectiveDateTime value. */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public String effectiveDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().effectiveDateTime(); } /** @@ -189,58 +189,57 @@ public String expiryDate() { } /** - * Get the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded. + * Get the provisioningState property: The provisioning state of the reservation, e.g. Succeeded. * - * @return the provisioningSubState value. + * @return the provisioningState value. */ - public String provisioningSubState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningSubState(); + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** - * Get the displayName property: The display name of the reservation. + * Get the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded. * - * @return the displayName value. + * @return the provisioningSubState value. */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); + public String provisioningSubState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningSubState(); } /** - * Get the displayProvisioningState property: The provisioning state of the reservation for display, e.g. Succeeded. + * Get the quantity property: The number of the reservation. * - * @return the displayProvisioningState value. + * @return the quantity value. */ - public String displayProvisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().displayProvisioningState(); + public Float quantity() { + return this.innerProperties() == null ? null : this.innerProperties().quantity(); } /** - * Get the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On. + * Get the renew property: The renew state of the reservation. * - * @return the userFriendlyRenewState value. + * @return the renew value. */ - public String userFriendlyRenewState() { - return this.innerProperties() == null ? null : this.innerProperties().userFriendlyRenewState(); + public Boolean renew() { + return this.innerProperties() == null ? null : this.innerProperties().renew(); } /** - * Get the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. - * Shared. + * Get the renewSource property: The renew source of the reservation. * - * @return the userFriendlyAppliedScopeType value. + * @return the renewSource value. */ - public String userFriendlyAppliedScopeType() { - return this.innerProperties() == null ? null : this.innerProperties().userFriendlyAppliedScopeType(); + public String renewSource() { + return this.innerProperties() == null ? null : this.innerProperties().renewSource(); } /** - * Get the effectiveDateTime property: The effective date time of the reservation. + * Get the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine. * - * @return the effectiveDateTime value. + * @return the reservedResourceType value. */ - public String effectiveDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().effectiveDateTime(); + public String reservedResourceType() { + return this.innerProperties() == null ? null : this.innerProperties().reservedResourceType(); } /** @@ -262,21 +261,22 @@ public String term() { } /** - * Get the renew property: The renew state of the reservation. + * Get the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. + * Shared. * - * @return the renew value. + * @return the userFriendlyAppliedScopeType value. */ - public Boolean renew() { - return this.innerProperties() == null ? null : this.innerProperties().renew(); + public String userFriendlyAppliedScopeType() { + return this.innerProperties() == null ? null : this.innerProperties().userFriendlyAppliedScopeType(); } /** - * Get the renewSource property: The renew source of the reservation. + * Get the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On. * - * @return the renewSource value. + * @return the userFriendlyRenewState value. */ - public String renewSource() { - return this.innerProperties() == null ? null : this.innerProperties().renewSource(); + public String userFriendlyRenewState() { + return this.innerProperties() == null ? null : this.innerProperties().userFriendlyRenewState(); } /** @@ -294,11 +294,11 @@ public ReservationPropertyUtilization utilization() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sku() != null) { - sku().validate(); - } if (innerProperties() != null) { innerProperties().validate(); } + if (sku() != null) { + sku().validate(); + } } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationProperty.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationProperty.java index 7c10570639ea6..434b9cf098894 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationProperty.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationProperty.java @@ -25,22 +25,22 @@ public final class ReservationProperty { private String appliedScopeType; /* - * The reserved source type of the reservation, e.g. virtual machine. + * The display name of the reservation */ - @JsonProperty(value = "reservedResourceType", access = JsonProperty.Access.WRITE_ONLY) - private String reservedResourceType; + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; /* - * The number of the reservation. + * The provisioning state of the reservation for display, e.g. Succeeded */ - @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) - private Float quantity; + @JsonProperty(value = "displayProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String displayProvisioningState; /* - * The provisioning state of the reservation, e.g. Succeeded + * The effective date time of the reservation */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + @JsonProperty(value = "effectiveDateTime", access = JsonProperty.Access.WRITE_ONLY) + private String effectiveDateTime; /* * The expiry date of the reservation @@ -51,38 +51,38 @@ public final class ReservationProperty { /* * The provisioning state of the reservation, e.g. Succeeded */ - @JsonProperty(value = "provisioningSubState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningSubState; + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; /* - * The display name of the reservation + * The provisioning state of the reservation, e.g. Succeeded */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; + @JsonProperty(value = "provisioningSubState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningSubState; /* - * The provisioning state of the reservation for display, e.g. Succeeded + * The number of the reservation. */ - @JsonProperty(value = "displayProvisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String displayProvisioningState; + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Float quantity; /* - * The renew state of the reservation for display, e.g. On + * The renew state of the reservation */ - @JsonProperty(value = "userFriendlyRenewState", access = JsonProperty.Access.WRITE_ONLY) - private String userFriendlyRenewState; + @JsonProperty(value = "renew", access = JsonProperty.Access.WRITE_ONLY) + private Boolean renew; /* - * The applied scope type of the reservation for display, e.g. Shared + * The renew source of the reservation */ - @JsonProperty(value = "userFriendlyAppliedScopeType", access = JsonProperty.Access.WRITE_ONLY) - private String userFriendlyAppliedScopeType; + @JsonProperty(value = "renewSource", access = JsonProperty.Access.WRITE_ONLY) + private String renewSource; /* - * The effective date time of the reservation + * The reserved source type of the reservation, e.g. virtual machine. */ - @JsonProperty(value = "effectiveDateTime", access = JsonProperty.Access.WRITE_ONLY) - private String effectiveDateTime; + @JsonProperty(value = "reservedResourceType", access = JsonProperty.Access.WRITE_ONLY) + private String reservedResourceType; /* * The sku description of the reservation @@ -97,16 +97,16 @@ public final class ReservationProperty { private String term; /* - * The renew state of the reservation + * The applied scope type of the reservation for display, e.g. Shared */ - @JsonProperty(value = "renew", access = JsonProperty.Access.WRITE_ONLY) - private Boolean renew; + @JsonProperty(value = "userFriendlyAppliedScopeType", access = JsonProperty.Access.WRITE_ONLY) + private String userFriendlyAppliedScopeType; /* - * The renew source of the reservation + * The renew state of the reservation for display, e.g. On */ - @JsonProperty(value = "renewSource", access = JsonProperty.Access.WRITE_ONLY) - private String renewSource; + @JsonProperty(value = "userFriendlyRenewState", access = JsonProperty.Access.WRITE_ONLY) + private String userFriendlyRenewState; /* * Reservation utilization @@ -150,30 +150,30 @@ public String appliedScopeType() { } /** - * Get the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine. + * Get the displayName property: The display name of the reservation. * - * @return the reservedResourceType value. + * @return the displayName value. */ - public String reservedResourceType() { - return this.reservedResourceType; + public String displayName() { + return this.displayName; } /** - * Get the quantity property: The number of the reservation. + * Get the displayProvisioningState property: The provisioning state of the reservation for display, e.g. Succeeded. * - * @return the quantity value. + * @return the displayProvisioningState value. */ - public Float quantity() { - return this.quantity; + public String displayProvisioningState() { + return this.displayProvisioningState; } /** - * Get the provisioningState property: The provisioning state of the reservation, e.g. Succeeded. + * Get the effectiveDateTime property: The effective date time of the reservation. * - * @return the provisioningState value. + * @return the effectiveDateTime value. */ - public String provisioningState() { - return this.provisioningState; + public String effectiveDateTime() { + return this.effectiveDateTime; } /** @@ -186,58 +186,57 @@ public String expiryDate() { } /** - * Get the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded. + * Get the provisioningState property: The provisioning state of the reservation, e.g. Succeeded. * - * @return the provisioningSubState value. + * @return the provisioningState value. */ - public String provisioningSubState() { - return this.provisioningSubState; + public String provisioningState() { + return this.provisioningState; } /** - * Get the displayName property: The display name of the reservation. + * Get the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded. * - * @return the displayName value. + * @return the provisioningSubState value. */ - public String displayName() { - return this.displayName; + public String provisioningSubState() { + return this.provisioningSubState; } /** - * Get the displayProvisioningState property: The provisioning state of the reservation for display, e.g. Succeeded. + * Get the quantity property: The number of the reservation. * - * @return the displayProvisioningState value. + * @return the quantity value. */ - public String displayProvisioningState() { - return this.displayProvisioningState; + public Float quantity() { + return this.quantity; } /** - * Get the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On. + * Get the renew property: The renew state of the reservation. * - * @return the userFriendlyRenewState value. + * @return the renew value. */ - public String userFriendlyRenewState() { - return this.userFriendlyRenewState; + public Boolean renew() { + return this.renew; } /** - * Get the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. - * Shared. + * Get the renewSource property: The renew source of the reservation. * - * @return the userFriendlyAppliedScopeType value. + * @return the renewSource value. */ - public String userFriendlyAppliedScopeType() { - return this.userFriendlyAppliedScopeType; + public String renewSource() { + return this.renewSource; } /** - * Get the effectiveDateTime property: The effective date time of the reservation. + * Get the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine. * - * @return the effectiveDateTime value. + * @return the reservedResourceType value. */ - public String effectiveDateTime() { - return this.effectiveDateTime; + public String reservedResourceType() { + return this.reservedResourceType; } /** @@ -259,21 +258,22 @@ public String term() { } /** - * Get the renew property: The renew state of the reservation. + * Get the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. + * Shared. * - * @return the renew value. + * @return the userFriendlyAppliedScopeType value. */ - public Boolean renew() { - return this.renew; + public String userFriendlyAppliedScopeType() { + return this.userFriendlyAppliedScopeType; } /** - * Get the renewSource property: The renew source of the reservation. + * Get the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On. * - * @return the renewSource value. + * @return the userFriendlyRenewState value. */ - public String renewSource() { - return this.renewSource; + public String userFriendlyRenewState() { + return this.userFriendlyRenewState; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionInner.java index 1f63b89936585..e2b1a4637a7f4 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.billing.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.models.Amount; +import com.azure.resourcemanager.billing.models.ArmResource; import com.azure.resourcemanager.billing.models.ReservationType; import com.azure.resourcemanager.billing.models.TransactionTypeKind; import com.fasterxml.jackson.annotation.JsonProperty; @@ -14,7 +14,7 @@ /** A transaction. */ @Fluent -public final class TransactionInner extends ProxyResource { +public final class TransactionInner extends ArmResource { /* * The properties of a transaction. */ @@ -35,341 +35,341 @@ private TransactionProperties innerProperties() { } /** - * Get the kind property: The kind of transaction. Options are all or reservation. + * Get the azureCreditApplied property: The amount of any Azure credits automatically applied to this transaction. * - * @return the kind value. + * @return the azureCreditApplied value. */ - public TransactionTypeKind kind() { - return this.innerProperties() == null ? null : this.innerProperties().kind(); + public Amount azureCreditApplied() { + return this.innerProperties() == null ? null : this.innerProperties().azureCreditApplied(); } /** - * Set the kind property: The kind of transaction. Options are all or reservation. + * Get the azurePlan property: The type of azure plan of the subscription that was used for the transaction. * - * @param kind the kind value to set. - * @return the TransactionInner object itself. + * @return the azurePlan value. */ - public TransactionInner withKind(TransactionTypeKind kind) { - if (this.innerProperties() == null) { - this.innerProperties = new TransactionProperties(); - } - this.innerProperties().withKind(kind); - return this; + public String azurePlan() { + return this.innerProperties() == null ? null : this.innerProperties().azurePlan(); } /** - * Get the date property: The date of transaction. + * Get the billingCurrency property: The ISO 4217 code for the currency in which this transaction is billed. * - * @return the date value. + * @return the billingCurrency value. */ - public OffsetDateTime date() { - return this.innerProperties() == null ? null : this.innerProperties().date(); + public String billingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().billingCurrency(); } /** - * Get the invoice property: Invoice on which the transaction was billed or 'pending' if the transaction is not - * billed. + * Get the billingProfileDisplayName property: The name of the billing profile which will be billed for the + * transaction. * - * @return the invoice value. + * @return the billingProfileDisplayName value. */ - public String invoice() { - return this.innerProperties() == null ? null : this.innerProperties().invoice(); + public String billingProfileDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); } /** - * Get the invoiceId property: The ID of the invoice on which the transaction was billed. This field is only - * applicable for transactions which are billed. + * Get the billingProfileId property: The ID of the billing profile which will be billed for the transaction. * - * @return the invoiceId value. + * @return the billingProfileId value. */ - public String invoiceId() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceId(); + public String billingProfileId() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } /** - * Get the orderId property: The order ID of the reservation. The field is only applicable for transaction of kind - * reservation. + * Get the customerDisplayName property: The name of the customer for which the transaction took place. The field is + * applicable only for Microsoft Partner Agreement billing account. * - * @return the orderId value. + * @return the customerDisplayName value. */ - public String orderId() { - return this.innerProperties() == null ? null : this.innerProperties().orderId(); + public String customerDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); } /** - * Get the orderName property: The name of the reservation order. The field is only applicable for transactions of - * kind reservation. + * Get the customerId property: The ID of the customer for which the transaction took place. The field is applicable + * only for Microsoft Partner Agreement billing account. * - * @return the orderName value. + * @return the customerId value. */ - public String orderName() { - return this.innerProperties() == null ? null : this.innerProperties().orderName(); + public String customerId() { + return this.innerProperties() == null ? null : this.innerProperties().customerId(); } /** - * Get the productFamily property: The family of the product for which the transaction took place. + * Get the date property: The date of transaction. * - * @return the productFamily value. + * @return the date value. */ - public String productFamily() { - return this.innerProperties() == null ? null : this.innerProperties().productFamily(); + public OffsetDateTime date() { + return this.innerProperties() == null ? null : this.innerProperties().date(); } /** - * Get the productTypeId property: The ID of the product type for which the transaction took place. + * Get the discount property: The percentage discount, if any, applied to this transaction. * - * @return the productTypeId value. + * @return the discount value. */ - public String productTypeId() { - return this.innerProperties() == null ? null : this.innerProperties().productTypeId(); + public Float discount() { + return this.innerProperties() == null ? null : this.innerProperties().discount(); } /** - * Get the productType property: The type of the product for which the transaction took place. + * Get the effectivePrice property: The price of the product after applying any discounts. * - * @return the productType value. + * @return the effectivePrice value. */ - public String productType() { - return this.innerProperties() == null ? null : this.innerProperties().productType(); + public Amount effectivePrice() { + return this.innerProperties() == null ? null : this.innerProperties().effectivePrice(); } /** - * Get the productDescription property: The description of the product for which the transaction took place. + * Get the exchangeRate property: The exchange rate used to convert charged amount to billing currency, if + * applicable. * - * @return the productDescription value. + * @return the exchangeRate value. */ - public String productDescription() { - return this.innerProperties() == null ? null : this.innerProperties().productDescription(); + public Float exchangeRate() { + return this.innerProperties() == null ? null : this.innerProperties().exchangeRate(); } /** - * Get the transactionType property: The type of transaction. + * Get the invoice property: Invoice on which the transaction was billed or 'pending' if the transaction is not + * billed. * - * @return the transactionType value. + * @return the invoice value. */ - public ReservationType transactionType() { - return this.innerProperties() == null ? null : this.innerProperties().transactionType(); + public String invoice() { + return this.innerProperties() == null ? null : this.innerProperties().invoice(); } /** - * Set the transactionType property: The type of transaction. + * Get the invoiceId property: The ID of the invoice on which the transaction was billed. This field is only + * applicable for transactions which are billed. * - * @param transactionType the transactionType value to set. - * @return the TransactionInner object itself. + * @return the invoiceId value. */ - public TransactionInner withTransactionType(ReservationType transactionType) { - if (this.innerProperties() == null) { - this.innerProperties = new TransactionProperties(); - } - this.innerProperties().withTransactionType(transactionType); - return this; + public String invoiceId() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceId(); } /** - * Get the transactionAmount property: The charge associated with the transaction. + * Get the invoiceSectionDisplayName property: The name of the invoice section which will be billed for the + * transaction. * - * @return the transactionAmount value. + * @return the invoiceSectionDisplayName value. */ - public Amount transactionAmount() { - return this.innerProperties() == null ? null : this.innerProperties().transactionAmount(); + public String invoiceSectionDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); } /** - * Get the quantity property: The quantity purchased in the transaction. + * Get the invoiceSectionId property: The ID of the invoice section which will be billed for the transaction. * - * @return the quantity value. + * @return the invoiceSectionId value. */ - public Integer quantity() { - return this.innerProperties() == null ? null : this.innerProperties().quantity(); + public String invoiceSectionId() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); } /** - * Get the invoiceSectionId property: The ID of the invoice section which will be billed for the transaction. + * Get the kind property: The kind of transaction. Options are all or reservation. * - * @return the invoiceSectionId value. + * @return the kind value. */ - public String invoiceSectionId() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); + public TransactionTypeKind kind() { + return this.innerProperties() == null ? null : this.innerProperties().kind(); } /** - * Get the invoiceSectionDisplayName property: The name of the invoice section which will be billed for the - * transaction. + * Set the kind property: The kind of transaction. Options are all or reservation. * - * @return the invoiceSectionDisplayName value. + * @param kind the kind value to set. + * @return the TransactionInner object itself. */ - public String invoiceSectionDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); + public TransactionInner withKind(TransactionTypeKind kind) { + if (this.innerProperties() == null) { + this.innerProperties = new TransactionProperties(); + } + this.innerProperties().withKind(kind); + return this; } /** - * Get the billingProfileId property: The ID of the billing profile which will be billed for the transaction. + * Get the marketPrice property: The retail price of the product. * - * @return the billingProfileId value. + * @return the marketPrice value. */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); + public Amount marketPrice() { + return this.innerProperties() == null ? null : this.innerProperties().marketPrice(); } /** - * Get the billingProfileDisplayName property: The name of the billing profile which will be billed for the - * transaction. + * Get the orderId property: The order ID of the reservation. The field is only applicable for transaction of kind + * reservation. * - * @return the billingProfileDisplayName value. + * @return the orderId value. */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); + public String orderId() { + return this.innerProperties() == null ? null : this.innerProperties().orderId(); } /** - * Get the customerId property: The ID of the customer for which the transaction took place. The field is applicable - * only for Microsoft Partner Agreement billing account. + * Get the orderName property: The name of the reservation order. The field is only applicable for transactions of + * kind reservation. * - * @return the customerId value. + * @return the orderName value. */ - public String customerId() { - return this.innerProperties() == null ? null : this.innerProperties().customerId(); + public String orderName() { + return this.innerProperties() == null ? null : this.innerProperties().orderName(); } /** - * Get the customerDisplayName property: The name of the customer for which the transaction took place. The field is - * applicable only for Microsoft Partner Agreement billing account. + * Get the pricingCurrency property: The ISO 4217 code for the currency in which the product is priced. * - * @return the customerDisplayName value. + * @return the pricingCurrency value. */ - public String customerDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); + public String pricingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().pricingCurrency(); } /** - * Get the subscriptionId property: The ID of the subscription that was used for the transaction. The field is only - * applicable for transaction of kind reservation. + * Get the productDescription property: The description of the product for which the transaction took place. * - * @return the subscriptionId value. + * @return the productDescription value. */ - public String subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); + public String productDescription() { + return this.innerProperties() == null ? null : this.innerProperties().productDescription(); } /** - * Get the subscriptionName property: The name of the subscription that was used for the transaction. The field is - * only applicable for transaction of kind reservation. + * Get the productFamily property: The family of the product for which the transaction took place. * - * @return the subscriptionName value. + * @return the productFamily value. */ - public String subscriptionName() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionName(); + public String productFamily() { + return this.innerProperties() == null ? null : this.innerProperties().productFamily(); } /** - * Get the azurePlan property: The type of azure plan of the subscription that was used for the transaction. + * Get the productType property: The type of the product for which the transaction took place. * - * @return the azurePlan value. + * @return the productType value. */ - public String azurePlan() { - return this.innerProperties() == null ? null : this.innerProperties().azurePlan(); + public String productType() { + return this.innerProperties() == null ? null : this.innerProperties().productType(); } /** - * Get the azureCreditApplied property: The amount of any Azure credits automatically applied to this transaction. + * Get the productTypeId property: The ID of the product type for which the transaction took place. * - * @return the azureCreditApplied value. + * @return the productTypeId value. */ - public Amount azureCreditApplied() { - return this.innerProperties() == null ? null : this.innerProperties().azureCreditApplied(); + public String productTypeId() { + return this.innerProperties() == null ? null : this.innerProperties().productTypeId(); } /** - * Get the billingCurrency property: The ISO 4217 code for the currency in which this transaction is billed. + * Get the quantity property: The quantity purchased in the transaction. * - * @return the billingCurrency value. + * @return the quantity value. */ - public String billingCurrency() { - return this.innerProperties() == null ? null : this.innerProperties().billingCurrency(); + public Integer quantity() { + return this.innerProperties() == null ? null : this.innerProperties().quantity(); } /** - * Get the discount property: The percentage discount, if any, applied to this transaction. + * Get the servicePeriodEndDate property: The end date of the product term, or the end date of the month in which + * usage ended. * - * @return the discount value. + * @return the servicePeriodEndDate value. */ - public Float discount() { - return this.innerProperties() == null ? null : this.innerProperties().discount(); + public OffsetDateTime servicePeriodEndDate() { + return this.innerProperties() == null ? null : this.innerProperties().servicePeriodEndDate(); } /** - * Get the effectivePrice property: The price of the product after applying any discounts. + * Get the servicePeriodStartDate property: The date of the purchase of the product, or the start date of the month + * in which usage started. * - * @return the effectivePrice value. + * @return the servicePeriodStartDate value. */ - public Amount effectivePrice() { - return this.innerProperties() == null ? null : this.innerProperties().effectivePrice(); + public OffsetDateTime servicePeriodStartDate() { + return this.innerProperties() == null ? null : this.innerProperties().servicePeriodStartDate(); } /** - * Get the exchangeRate property: The exchange rate used to convert charged amount to billing currency, if - * applicable. + * Get the subscriptionId property: The ID of the subscription that was used for the transaction. The field is only + * applicable for transaction of kind reservation. * - * @return the exchangeRate value. + * @return the subscriptionId value. */ - public Float exchangeRate() { - return this.innerProperties() == null ? null : this.innerProperties().exchangeRate(); + public String subscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); } /** - * Get the marketPrice property: The retail price of the product. + * Get the subscriptionName property: The name of the subscription that was used for the transaction. The field is + * only applicable for transaction of kind reservation. * - * @return the marketPrice value. + * @return the subscriptionName value. */ - public Amount marketPrice() { - return this.innerProperties() == null ? null : this.innerProperties().marketPrice(); + public String subscriptionName() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionName(); } /** - * Get the pricingCurrency property: The ISO 4217 code for the currency in which the product is priced. + * Get the subTotal property: The pre-tax charged amount for the transaction. * - * @return the pricingCurrency value. + * @return the subTotal value. */ - public String pricingCurrency() { - return this.innerProperties() == null ? null : this.innerProperties().pricingCurrency(); + public Amount subTotal() { + return this.innerProperties() == null ? null : this.innerProperties().subTotal(); } /** - * Get the servicePeriodStartDate property: The date of the purchase of the product, or the start date of the month - * in which usage started. + * Get the tax property: The tax amount applied to the transaction. * - * @return the servicePeriodStartDate value. + * @return the tax value. */ - public OffsetDateTime servicePeriodStartDate() { - return this.innerProperties() == null ? null : this.innerProperties().servicePeriodStartDate(); + public Amount tax() { + return this.innerProperties() == null ? null : this.innerProperties().tax(); } /** - * Get the servicePeriodEndDate property: The end date of the product term, or the end date of the month in which - * usage ended. + * Get the transactionAmount property: The charge associated with the transaction. * - * @return the servicePeriodEndDate value. + * @return the transactionAmount value. */ - public OffsetDateTime servicePeriodEndDate() { - return this.innerProperties() == null ? null : this.innerProperties().servicePeriodEndDate(); + public Amount transactionAmount() { + return this.innerProperties() == null ? null : this.innerProperties().transactionAmount(); } /** - * Get the subTotal property: The pre-tax charged amount for the transaction. + * Get the transactionType property: The type of transaction. * - * @return the subTotal value. + * @return the transactionType value. */ - public Amount subTotal() { - return this.innerProperties() == null ? null : this.innerProperties().subTotal(); + public ReservationType transactionType() { + return this.innerProperties() == null ? null : this.innerProperties().transactionType(); } /** - * Get the tax property: The tax amount applied to the transaction. + * Set the transactionType property: The type of transaction. * - * @return the tax value. + * @param transactionType the transactionType value to set. + * @return the TransactionInner object itself. */ - public Amount tax() { - return this.innerProperties() == null ? null : this.innerProperties().tax(); + public TransactionInner withTransactionType(ReservationType transactionType) { + if (this.innerProperties() == null) { + this.innerProperties = new TransactionProperties(); + } + this.innerProperties().withTransactionType(transactionType); + return this; } /** @@ -405,7 +405,9 @@ public String unitType() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionProperties.java index bd7d1ca9777ac..2f5d7c1626327 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionProperties.java @@ -15,89 +15,85 @@ @Fluent public final class TransactionProperties { /* - * The kind of transaction. Options are all or reservation. - */ - @JsonProperty(value = "kind") - private TransactionTypeKind kind; - - /* - * The date of transaction. + * The amount of any Azure credits automatically applied to this transaction. */ - @JsonProperty(value = "date", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime date; + @JsonProperty(value = "azureCreditApplied", access = JsonProperty.Access.WRITE_ONLY) + private Amount azureCreditApplied; /* - * Invoice on which the transaction was billed or 'pending' if the transaction is not billed. + * The type of azure plan of the subscription that was used for the transaction. */ - @JsonProperty(value = "invoice", access = JsonProperty.Access.WRITE_ONLY) - private String invoice; + @JsonProperty(value = "azurePlan", access = JsonProperty.Access.WRITE_ONLY) + private String azurePlan; /* - * The ID of the invoice on which the transaction was billed. This field is only applicable for transactions which - * are billed. + * The ISO 4217 code for the currency in which this transaction is billed. */ - @JsonProperty(value = "invoiceId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceId; + @JsonProperty(value = "billingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String billingCurrency; /* - * The order ID of the reservation. The field is only applicable for transaction of kind reservation. + * The name of the billing profile which will be billed for the transaction. */ - @JsonProperty(value = "orderId", access = JsonProperty.Access.WRITE_ONLY) - private String orderId; + @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; /* - * The name of the reservation order. The field is only applicable for transactions of kind reservation. + * The ID of the billing profile which will be billed for the transaction. */ - @JsonProperty(value = "orderName", access = JsonProperty.Access.WRITE_ONLY) - private String orderName; + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; /* - * The family of the product for which the transaction took place. + * The name of the customer for which the transaction took place. The field is applicable only for Microsoft + * Partner Agreement billing account. */ - @JsonProperty(value = "productFamily", access = JsonProperty.Access.WRITE_ONLY) - private String productFamily; + @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String customerDisplayName; /* - * The ID of the product type for which the transaction took place. + * The ID of the customer for which the transaction took place. The field is applicable only for Microsoft Partner + * Agreement billing account. */ - @JsonProperty(value = "productTypeId", access = JsonProperty.Access.WRITE_ONLY) - private String productTypeId; + @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; /* - * The type of the product for which the transaction took place. + * The date of transaction. */ - @JsonProperty(value = "productType", access = JsonProperty.Access.WRITE_ONLY) - private String productType; + @JsonProperty(value = "date", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime date; /* - * The description of the product for which the transaction took place. + * The percentage discount, if any, applied to this transaction. */ - @JsonProperty(value = "productDescription", access = JsonProperty.Access.WRITE_ONLY) - private String productDescription; + @JsonProperty(value = "discount", access = JsonProperty.Access.WRITE_ONLY) + private Float discount; /* - * The type of transaction. + * The price of the product after applying any discounts. */ - @JsonProperty(value = "transactionType") - private ReservationType transactionType; + @JsonProperty(value = "effectivePrice", access = JsonProperty.Access.WRITE_ONLY) + private Amount effectivePrice; /* - * The charge associated with the transaction. + * The exchange rate used to convert charged amount to billing currency, if applicable. */ - @JsonProperty(value = "transactionAmount", access = JsonProperty.Access.WRITE_ONLY) - private Amount transactionAmount; + @JsonProperty(value = "exchangeRate", access = JsonProperty.Access.WRITE_ONLY) + private Float exchangeRate; /* - * The quantity purchased in the transaction. + * Invoice on which the transaction was billed or 'pending' if the transaction is not billed. */ - @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) - private Integer quantity; + @JsonProperty(value = "invoice", access = JsonProperty.Access.WRITE_ONLY) + private String invoice; /* - * The ID of the invoice section which will be billed for the transaction. + * The ID of the invoice on which the transaction was billed. This field is only applicable for transactions which + * are billed. */ - @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; + @JsonProperty(value = "invoiceId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceId; /* * The name of the invoice section which will be billed for the transaction. @@ -106,92 +102,76 @@ public final class TransactionProperties { private String invoiceSectionDisplayName; /* - * The ID of the billing profile which will be billed for the transaction. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * The name of the billing profile which will be billed for the transaction. - */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; - - /* - * The ID of the customer for which the transaction took place. The field is applicable only for Microsoft Partner - * Agreement billing account. + * The ID of the invoice section which will be billed for the transaction. */ - @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) - private String customerId; + @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; /* - * The name of the customer for which the transaction took place. The field is applicable only for Microsoft - * Partner Agreement billing account. + * The kind of transaction. Options are all or reservation. */ - @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String customerDisplayName; + @JsonProperty(value = "kind") + private TransactionTypeKind kind; /* - * The ID of the subscription that was used for the transaction. The field is only applicable for transaction of - * kind reservation. + * The retail price of the product. */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; + @JsonProperty(value = "marketPrice", access = JsonProperty.Access.WRITE_ONLY) + private Amount marketPrice; /* - * The name of the subscription that was used for the transaction. The field is only applicable for transaction of - * kind reservation. + * The order ID of the reservation. The field is only applicable for transaction of kind reservation. */ - @JsonProperty(value = "subscriptionName", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionName; + @JsonProperty(value = "orderId", access = JsonProperty.Access.WRITE_ONLY) + private String orderId; /* - * The type of azure plan of the subscription that was used for the transaction. + * The name of the reservation order. The field is only applicable for transactions of kind reservation. */ - @JsonProperty(value = "azurePlan", access = JsonProperty.Access.WRITE_ONLY) - private String azurePlan; + @JsonProperty(value = "orderName", access = JsonProperty.Access.WRITE_ONLY) + private String orderName; /* - * The amount of any Azure credits automatically applied to this transaction. + * The ISO 4217 code for the currency in which the product is priced. */ - @JsonProperty(value = "azureCreditApplied", access = JsonProperty.Access.WRITE_ONLY) - private Amount azureCreditApplied; + @JsonProperty(value = "pricingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String pricingCurrency; /* - * The ISO 4217 code for the currency in which this transaction is billed. + * The description of the product for which the transaction took place. */ - @JsonProperty(value = "billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; + @JsonProperty(value = "productDescription", access = JsonProperty.Access.WRITE_ONLY) + private String productDescription; /* - * The percentage discount, if any, applied to this transaction. + * The family of the product for which the transaction took place. */ - @JsonProperty(value = "discount", access = JsonProperty.Access.WRITE_ONLY) - private Float discount; + @JsonProperty(value = "productFamily", access = JsonProperty.Access.WRITE_ONLY) + private String productFamily; /* - * The price of the product after applying any discounts. + * The type of the product for which the transaction took place. */ - @JsonProperty(value = "effectivePrice", access = JsonProperty.Access.WRITE_ONLY) - private Amount effectivePrice; + @JsonProperty(value = "productType", access = JsonProperty.Access.WRITE_ONLY) + private String productType; /* - * The exchange rate used to convert charged amount to billing currency, if applicable. + * The ID of the product type for which the transaction took place. */ - @JsonProperty(value = "exchangeRate", access = JsonProperty.Access.WRITE_ONLY) - private Float exchangeRate; + @JsonProperty(value = "productTypeId", access = JsonProperty.Access.WRITE_ONLY) + private String productTypeId; /* - * The retail price of the product. + * The quantity purchased in the transaction. */ - @JsonProperty(value = "marketPrice", access = JsonProperty.Access.WRITE_ONLY) - private Amount marketPrice; + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Integer quantity; /* - * The ISO 4217 code for the currency in which the product is priced. + * The end date of the product term, or the end date of the month in which usage ended. */ - @JsonProperty(value = "pricingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String pricingCurrency; + @JsonProperty(value = "servicePeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime servicePeriodEndDate; /* * The date of the purchase of the product, or the start date of the month in which usage started. @@ -200,10 +180,18 @@ public final class TransactionProperties { private OffsetDateTime servicePeriodStartDate; /* - * The end date of the product term, or the end date of the month in which usage ended. + * The ID of the subscription that was used for the transaction. The field is only applicable for transaction of + * kind reservation. */ - @JsonProperty(value = "servicePeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime servicePeriodEndDate; + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /* + * The name of the subscription that was used for the transaction. The field is only applicable for transaction of + * kind reservation. + */ + @JsonProperty(value = "subscriptionName", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionName; /* * The pre-tax charged amount for the transaction. @@ -217,6 +205,18 @@ public final class TransactionProperties { @JsonProperty(value = "tax", access = JsonProperty.Access.WRITE_ONLY) private Amount tax; + /* + * The charge associated with the transaction. + */ + @JsonProperty(value = "transactionAmount", access = JsonProperty.Access.WRITE_ONLY) + private Amount transactionAmount; + + /* + * The type of transaction. + */ + @JsonProperty(value = "transactionType") + private ReservationType transactionType; + /* * The unit of measure used to bill for the product. For example, compute services are billed per hour. */ @@ -240,155 +240,126 @@ public TransactionProperties() { } /** - * Get the kind property: The kind of transaction. Options are all or reservation. - * - * @return the kind value. - */ - public TransactionTypeKind kind() { - return this.kind; - } - - /** - * Set the kind property: The kind of transaction. Options are all or reservation. - * - * @param kind the kind value to set. - * @return the TransactionProperties object itself. - */ - public TransactionProperties withKind(TransactionTypeKind kind) { - this.kind = kind; - return this; - } - - /** - * Get the date property: The date of transaction. - * - * @return the date value. - */ - public OffsetDateTime date() { - return this.date; - } - - /** - * Get the invoice property: Invoice on which the transaction was billed or 'pending' if the transaction is not - * billed. + * Get the azureCreditApplied property: The amount of any Azure credits automatically applied to this transaction. * - * @return the invoice value. + * @return the azureCreditApplied value. */ - public String invoice() { - return this.invoice; + public Amount azureCreditApplied() { + return this.azureCreditApplied; } /** - * Get the invoiceId property: The ID of the invoice on which the transaction was billed. This field is only - * applicable for transactions which are billed. + * Get the azurePlan property: The type of azure plan of the subscription that was used for the transaction. * - * @return the invoiceId value. + * @return the azurePlan value. */ - public String invoiceId() { - return this.invoiceId; + public String azurePlan() { + return this.azurePlan; } /** - * Get the orderId property: The order ID of the reservation. The field is only applicable for transaction of kind - * reservation. + * Get the billingCurrency property: The ISO 4217 code for the currency in which this transaction is billed. * - * @return the orderId value. + * @return the billingCurrency value. */ - public String orderId() { - return this.orderId; + public String billingCurrency() { + return this.billingCurrency; } /** - * Get the orderName property: The name of the reservation order. The field is only applicable for transactions of - * kind reservation. + * Get the billingProfileDisplayName property: The name of the billing profile which will be billed for the + * transaction. * - * @return the orderName value. + * @return the billingProfileDisplayName value. */ - public String orderName() { - return this.orderName; + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; } /** - * Get the productFamily property: The family of the product for which the transaction took place. + * Get the billingProfileId property: The ID of the billing profile which will be billed for the transaction. * - * @return the productFamily value. + * @return the billingProfileId value. */ - public String productFamily() { - return this.productFamily; + public String billingProfileId() { + return this.billingProfileId; } /** - * Get the productTypeId property: The ID of the product type for which the transaction took place. + * Get the customerDisplayName property: The name of the customer for which the transaction took place. The field is + * applicable only for Microsoft Partner Agreement billing account. * - * @return the productTypeId value. + * @return the customerDisplayName value. */ - public String productTypeId() { - return this.productTypeId; + public String customerDisplayName() { + return this.customerDisplayName; } /** - * Get the productType property: The type of the product for which the transaction took place. + * Get the customerId property: The ID of the customer for which the transaction took place. The field is applicable + * only for Microsoft Partner Agreement billing account. * - * @return the productType value. + * @return the customerId value. */ - public String productType() { - return this.productType; + public String customerId() { + return this.customerId; } /** - * Get the productDescription property: The description of the product for which the transaction took place. + * Get the date property: The date of transaction. * - * @return the productDescription value. + * @return the date value. */ - public String productDescription() { - return this.productDescription; + public OffsetDateTime date() { + return this.date; } /** - * Get the transactionType property: The type of transaction. + * Get the discount property: The percentage discount, if any, applied to this transaction. * - * @return the transactionType value. + * @return the discount value. */ - public ReservationType transactionType() { - return this.transactionType; + public Float discount() { + return this.discount; } /** - * Set the transactionType property: The type of transaction. + * Get the effectivePrice property: The price of the product after applying any discounts. * - * @param transactionType the transactionType value to set. - * @return the TransactionProperties object itself. + * @return the effectivePrice value. */ - public TransactionProperties withTransactionType(ReservationType transactionType) { - this.transactionType = transactionType; - return this; + public Amount effectivePrice() { + return this.effectivePrice; } /** - * Get the transactionAmount property: The charge associated with the transaction. + * Get the exchangeRate property: The exchange rate used to convert charged amount to billing currency, if + * applicable. * - * @return the transactionAmount value. + * @return the exchangeRate value. */ - public Amount transactionAmount() { - return this.transactionAmount; + public Float exchangeRate() { + return this.exchangeRate; } /** - * Get the quantity property: The quantity purchased in the transaction. + * Get the invoice property: Invoice on which the transaction was billed or 'pending' if the transaction is not + * billed. * - * @return the quantity value. + * @return the invoice value. */ - public Integer quantity() { - return this.quantity; + public String invoice() { + return this.invoice; } /** - * Get the invoiceSectionId property: The ID of the invoice section which will be billed for the transaction. + * Get the invoiceId property: The ID of the invoice on which the transaction was billed. This field is only + * applicable for transactions which are billed. * - * @return the invoiceSectionId value. + * @return the invoiceId value. */ - public String invoiceSectionId() { - return this.invoiceSectionId; + public String invoiceId() { + return this.invoiceId; } /** @@ -402,135 +373,125 @@ public String invoiceSectionDisplayName() { } /** - * Get the billingProfileId property: The ID of the billing profile which will be billed for the transaction. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile which will be billed for the - * transaction. + * Get the invoiceSectionId property: The ID of the invoice section which will be billed for the transaction. * - * @return the billingProfileDisplayName value. + * @return the invoiceSectionId value. */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; + public String invoiceSectionId() { + return this.invoiceSectionId; } /** - * Get the customerId property: The ID of the customer for which the transaction took place. The field is applicable - * only for Microsoft Partner Agreement billing account. + * Get the kind property: The kind of transaction. Options are all or reservation. * - * @return the customerId value. + * @return the kind value. */ - public String customerId() { - return this.customerId; + public TransactionTypeKind kind() { + return this.kind; } /** - * Get the customerDisplayName property: The name of the customer for which the transaction took place. The field is - * applicable only for Microsoft Partner Agreement billing account. + * Set the kind property: The kind of transaction. Options are all or reservation. * - * @return the customerDisplayName value. + * @param kind the kind value to set. + * @return the TransactionProperties object itself. */ - public String customerDisplayName() { - return this.customerDisplayName; + public TransactionProperties withKind(TransactionTypeKind kind) { + this.kind = kind; + return this; } /** - * Get the subscriptionId property: The ID of the subscription that was used for the transaction. The field is only - * applicable for transaction of kind reservation. + * Get the marketPrice property: The retail price of the product. * - * @return the subscriptionId value. + * @return the marketPrice value. */ - public String subscriptionId() { - return this.subscriptionId; + public Amount marketPrice() { + return this.marketPrice; } /** - * Get the subscriptionName property: The name of the subscription that was used for the transaction. The field is - * only applicable for transaction of kind reservation. + * Get the orderId property: The order ID of the reservation. The field is only applicable for transaction of kind + * reservation. * - * @return the subscriptionName value. + * @return the orderId value. */ - public String subscriptionName() { - return this.subscriptionName; + public String orderId() { + return this.orderId; } /** - * Get the azurePlan property: The type of azure plan of the subscription that was used for the transaction. + * Get the orderName property: The name of the reservation order. The field is only applicable for transactions of + * kind reservation. * - * @return the azurePlan value. + * @return the orderName value. */ - public String azurePlan() { - return this.azurePlan; + public String orderName() { + return this.orderName; } /** - * Get the azureCreditApplied property: The amount of any Azure credits automatically applied to this transaction. + * Get the pricingCurrency property: The ISO 4217 code for the currency in which the product is priced. * - * @return the azureCreditApplied value. + * @return the pricingCurrency value. */ - public Amount azureCreditApplied() { - return this.azureCreditApplied; + public String pricingCurrency() { + return this.pricingCurrency; } /** - * Get the billingCurrency property: The ISO 4217 code for the currency in which this transaction is billed. + * Get the productDescription property: The description of the product for which the transaction took place. * - * @return the billingCurrency value. + * @return the productDescription value. */ - public String billingCurrency() { - return this.billingCurrency; + public String productDescription() { + return this.productDescription; } /** - * Get the discount property: The percentage discount, if any, applied to this transaction. + * Get the productFamily property: The family of the product for which the transaction took place. * - * @return the discount value. + * @return the productFamily value. */ - public Float discount() { - return this.discount; + public String productFamily() { + return this.productFamily; } /** - * Get the effectivePrice property: The price of the product after applying any discounts. + * Get the productType property: The type of the product for which the transaction took place. * - * @return the effectivePrice value. + * @return the productType value. */ - public Amount effectivePrice() { - return this.effectivePrice; + public String productType() { + return this.productType; } /** - * Get the exchangeRate property: The exchange rate used to convert charged amount to billing currency, if - * applicable. + * Get the productTypeId property: The ID of the product type for which the transaction took place. * - * @return the exchangeRate value. + * @return the productTypeId value. */ - public Float exchangeRate() { - return this.exchangeRate; + public String productTypeId() { + return this.productTypeId; } /** - * Get the marketPrice property: The retail price of the product. + * Get the quantity property: The quantity purchased in the transaction. * - * @return the marketPrice value. + * @return the quantity value. */ - public Amount marketPrice() { - return this.marketPrice; + public Integer quantity() { + return this.quantity; } /** - * Get the pricingCurrency property: The ISO 4217 code for the currency in which the product is priced. + * Get the servicePeriodEndDate property: The end date of the product term, or the end date of the month in which + * usage ended. * - * @return the pricingCurrency value. + * @return the servicePeriodEndDate value. */ - public String pricingCurrency() { - return this.pricingCurrency; + public OffsetDateTime servicePeriodEndDate() { + return this.servicePeriodEndDate; } /** @@ -544,13 +505,23 @@ public OffsetDateTime servicePeriodStartDate() { } /** - * Get the servicePeriodEndDate property: The end date of the product term, or the end date of the month in which - * usage ended. + * Get the subscriptionId property: The ID of the subscription that was used for the transaction. The field is only + * applicable for transaction of kind reservation. * - * @return the servicePeriodEndDate value. + * @return the subscriptionId value. */ - public OffsetDateTime servicePeriodEndDate() { - return this.servicePeriodEndDate; + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the subscriptionName property: The name of the subscription that was used for the transaction. The field is + * only applicable for transaction of kind reservation. + * + * @return the subscriptionName value. + */ + public String subscriptionName() { + return this.subscriptionName; } /** @@ -571,6 +542,35 @@ public Amount tax() { return this.tax; } + /** + * Get the transactionAmount property: The charge associated with the transaction. + * + * @return the transactionAmount value. + */ + public Amount transactionAmount() { + return this.transactionAmount; + } + + /** + * Get the transactionType property: The type of transaction. + * + * @return the transactionType value. + */ + public ReservationType transactionType() { + return this.transactionType; + } + + /** + * Set the transactionType property: The type of transaction. + * + * @param transactionType the transactionType value to set. + * @return the TransactionProperties object itself. + */ + public TransactionProperties withTransactionType(ReservationType transactionType) { + this.transactionType = transactionType; + return this; + } + /** * Get the unitOfMeasure property: The unit of measure used to bill for the product. For example, compute services * are billed per hour. @@ -605,9 +605,6 @@ public String unitType() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (transactionAmount() != null) { - transactionAmount().validate(); - } if (azureCreditApplied() != null) { azureCreditApplied().validate(); } @@ -623,5 +620,8 @@ public void validate() { if (tax() != null) { tax().validate(); } + if (transactionAmount() != null) { + transactionAmount().validate(); + } } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateProductTransferEligibilityResultInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateProductTransferEligibilityResultInner.java index 0bd677a082de9..eb541dbfca63b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateProductTransferEligibilityResultInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateProductTransferEligibilityResultInner.java @@ -11,31 +11,22 @@ /** Result of the product transfer eligibility validation. */ @Fluent public final class ValidateProductTransferEligibilityResultInner { - /* - * Specifies whether the transfer is eligible or not. - */ - @JsonProperty(value = "isMoveEligible", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isMoveEligible; - /* * Validation error details. */ @JsonProperty(value = "errorDetails") private ValidateProductTransferEligibilityError errorDetails; + /* + * Specifies whether the transfer is eligible or not. + */ + @JsonProperty(value = "isMoveEligible", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isMoveEligible; + /** Creates an instance of ValidateProductTransferEligibilityResultInner class. */ public ValidateProductTransferEligibilityResultInner() { } - /** - * Get the isMoveEligible property: Specifies whether the transfer is eligible or not. - * - * @return the isMoveEligible value. - */ - public Boolean isMoveEligible() { - return this.isMoveEligible; - } - /** * Get the errorDetails property: Validation error details. * @@ -57,6 +48,15 @@ public ValidateProductTransferEligibilityResultInner withErrorDetails( return this; } + /** + * Get the isMoveEligible property: Specifies whether the transfer is eligible or not. + * + * @return the isMoveEligible value. + */ + public Boolean isMoveEligible() { + return this.isMoveEligible; + } + /** * Validates the instance. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateSubscriptionTransferEligibilityResultInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateSubscriptionTransferEligibilityResultInner.java index 575c971584ffc..acd784b26779d 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateSubscriptionTransferEligibilityResultInner.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateSubscriptionTransferEligibilityResultInner.java @@ -11,31 +11,22 @@ /** Result of the transfer eligibility validation. */ @Fluent public final class ValidateSubscriptionTransferEligibilityResultInner { - /* - * Specifies whether the subscription is eligible to be transferred. - */ - @JsonProperty(value = "isMoveEligible", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isMoveEligible; - /* * Validation error details. */ @JsonProperty(value = "errorDetails") private ValidateSubscriptionTransferEligibilityError errorDetails; + /* + * Specifies whether the subscription is eligible to be transferred. + */ + @JsonProperty(value = "isMoveEligible", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isMoveEligible; + /** Creates an instance of ValidateSubscriptionTransferEligibilityResultInner class. */ public ValidateSubscriptionTransferEligibilityResultInner() { } - /** - * Get the isMoveEligible property: Specifies whether the subscription is eligible to be transferred. - * - * @return the isMoveEligible value. - */ - public Boolean isMoveEligible() { - return this.isMoveEligible; - } - /** * Get the errorDetails property: Validation error details. * @@ -57,6 +48,15 @@ public ValidateSubscriptionTransferEligibilityResultInner withErrorDetails( return this; } + /** + * Get the isMoveEligible property: Specifies whether the subscription is eligible to be transferred. + * + * @return the isMoveEligible value. + */ + public Boolean isMoveEligible() { + return this.isMoveEligible; + } + /** * Validates the instance. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/package-info.java index 21d8afb068dac..83136d91bd821 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/package-info.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/package-info.java @@ -2,8 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** - * Package containing the inner data models for BillingManagementClient. Billing client provides access to billing - * resources for Azure subscriptions. - */ +/** Package containing the inner data models for BillingManagementClient. Billing Client. */ package com.azure.resourcemanager.billing.fluent.models; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/package-info.java index ff6c7f208f6aa..667511fec4b87 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/package-info.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/package-info.java @@ -2,8 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** - * Package containing the service clients for BillingManagementClient. Billing client provides access to billing - * resources for Azure subscriptions. - */ +/** Package containing the service clients for BillingManagementClient. Billing Client. */ package com.azure.resourcemanager.billing.fluent; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressClientImpl.java index 0fe9599abe05a..40715f865151a 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressClientImpl.java @@ -85,10 +85,11 @@ private Mono> validateWithResponseAsync(A } else { address.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validate(this.client.getEndpoint(), apiVersion, address, accept, context)) + .withContext( + context -> + service.validate(this.client.getEndpoint(), this.client.getApiVersion(), address, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -116,10 +117,9 @@ private Mono> validateWithResponseAsync( } else { address.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validate(this.client.getEndpoint(), apiVersion, address, accept, context); + return service.validate(this.client.getEndpoint(), this.client.getApiVersion(), address, accept, context); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementImpl.java index ab49f9e9987a8..4eabe8fb43efd 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.AgreementInner; import com.azure.resourcemanager.billing.models.AcceptanceMode; import com.azure.resourcemanager.billing.models.Agreement; @@ -36,22 +37,26 @@ public String type() { return this.innerModel().type(); } - public String agreementLink() { - return this.innerModel().agreementLink(); - } - - public Category category() { - return this.innerModel().category(); + public SystemData systemData() { + return this.innerModel().systemData(); } public AcceptanceMode acceptanceMode() { return this.innerModel().acceptanceMode(); } + public String agreementLink() { + return this.innerModel().agreementLink(); + } + public BillingProfileInfo billingProfileInfo() { return this.innerModel().billingProfileInfo(); } + public Category category() { + return this.innerModel().category(); + } + public OffsetDateTime effectiveDate() { return this.innerModel().effectiveDate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsClientImpl.java index 9e8ec643fcdc4..ad6995aa43e72 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsClientImpl.java @@ -115,14 +115,18 @@ private Mono> listByBillingAccountSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context)) + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + expand, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -159,11 +163,11 @@ private Mono> listByBillingAccountSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context) + .listByBillingAccount( + this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, expand, accept, context) .map( res -> new PagedResponseBase<>( @@ -287,7 +291,6 @@ private Mono> getWithResponseAsync( if (agreementName == null) { return Mono.error(new IllegalArgumentException("Parameter agreementName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -295,7 +298,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, agreementName, expand, @@ -332,11 +335,17 @@ private Mono> getWithResponseAsync( if (agreementName == null) { return Mono.error(new IllegalArgumentException("Parameter agreementName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get(this.client.getEndpoint(), apiVersion, billingAccountName, agreementName, expand, accept, context); + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + agreementName, + expand, + accept, + context); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantImpl.java new file mode 100644 index 0000000000000..fd5428a8aa5ef --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.billing.fluent.models.AssociatedTenantInner; +import com.azure.resourcemanager.billing.models.AssociatedTenant; +import com.azure.resourcemanager.billing.models.BillingManagementTenantState; +import com.azure.resourcemanager.billing.models.ProvisioningTenantState; + +public final class AssociatedTenantImpl implements AssociatedTenant { + private AssociatedTenantInner innerObject; + + private final com.azure.resourcemanager.billing.BillingManager serviceManager; + + AssociatedTenantImpl( + AssociatedTenantInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public BillingManagementTenantState billingManagementState() { + return this.innerModel().billingManagementState(); + } + + public ProvisioningTenantState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String provisioningBillingRequestId() { + return this.innerModel().provisioningBillingRequestId(); + } + + public AssociatedTenantInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.billing.BillingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantsClientImpl.java new file mode 100644 index 0000000000000..7a991e9532f9b --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantsClientImpl.java @@ -0,0 +1,1177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.billing.fluent.AssociatedTenantsClient; +import com.azure.resourcemanager.billing.fluent.models.AssociatedTenantInner; +import com.azure.resourcemanager.billing.models.AssociatedTenantListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AssociatedTenantsClient. */ +public final class AssociatedTenantsClientImpl implements AssociatedTenantsClient { + /** The proxy service used to perform REST calls. */ + private final AssociatedTenantsService service; + + /** The service client containing this operation class. */ + private final BillingManagementClientImpl client; + + /** + * Initializes an instance of AssociatedTenantsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssociatedTenantsClientImpl(BillingManagementClientImpl client) { + this.service = + RestProxy.create(AssociatedTenantsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BillingManagementClientAssociatedTenants to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BillingManagementCli") + public interface AssociatedTenantsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/associatedTenants") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccount( + @HostParam("$host") String endpoint, + @PathParam("billingAccountName") String billingAccountName, + @QueryParam("includeRevoked") Boolean includeRevoked, + @QueryParam("api-version") String apiVersion, + @QueryParam("filter") String filter, + @QueryParam("orderBy") String orderBy, + @QueryParam("top") Long top, + @QueryParam("skip") Long skip, + @QueryParam("count") Boolean count, + @QueryParam("search") String search, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/associatedTenants/{associatedTenantName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("billingAccountName") String billingAccountName, + @PathParam("associatedTenantName") String associatedTenantName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/associatedTenants/{associatedTenantName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("billingAccountName") String billingAccountName, + @PathParam("associatedTenantName") String associatedTenantName, + @QueryParam("includeRevoked") Boolean includeRevoked, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/associatedTenants/{associatedTenantName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("billingAccountName") String billingAccountName, + @PathParam("associatedTenantName") String associatedTenantName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AssociatedTenantInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param includeRevoked Can be used to get revoked associated tenants. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, + Boolean includeRevoked, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByBillingAccount( + this.client.getEndpoint(), + billingAccountName, + includeRevoked, + this.client.getApiVersion(), + filter, + orderBy, + top, + skip, + count, + search, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param includeRevoked Can be used to get revoked associated tenants. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, + Boolean includeRevoked, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingAccount( + this.client.getEndpoint(), + billingAccountName, + includeRevoked, + this.client.getApiVersion(), + filter, + orderBy, + top, + skip, + count, + search, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param includeRevoked Can be used to get revoked associated tenants. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync( + String billingAccountName, + Boolean includeRevoked, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search) { + return new PagedFlux<>( + () -> + listByBillingAccountSinglePageAsync( + billingAccountName, includeRevoked, filter, orderBy, top, skip, count, search), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountName) { + final Boolean includeRevoked = null; + final String filter = null; + final String orderBy = null; + final Long top = null; + final Long skip = null; + final Boolean count = null; + final String search = null; + return new PagedFlux<>( + () -> + listByBillingAccountSinglePageAsync( + billingAccountName, includeRevoked, filter, orderBy, top, skip, count, search), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param includeRevoked Can be used to get revoked associated tenants. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync( + String billingAccountName, + Boolean includeRevoked, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context) { + return new PagedFlux<>( + () -> + listByBillingAccountSinglePageAsync( + billingAccountName, includeRevoked, filter, orderBy, top, skip, count, search, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount(String billingAccountName) { + final Boolean includeRevoked = null; + final String filter = null; + final String orderBy = null; + final Long top = null; + final Long skip = null; + final Boolean count = null; + final String search = null; + return new PagedIterable<>( + listByBillingAccountAsync(billingAccountName, includeRevoked, filter, orderBy, top, skip, count, search)); + } + + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param includeRevoked Can be used to get revoked associated tenants. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount( + String billingAccountName, + Boolean includeRevoked, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context) { + return new PagedIterable<>( + listByBillingAccountAsync( + billingAccountName, includeRevoked, filter, orderBy, top, skip, count, search, context)); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String billingAccountName, String associatedTenantName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (associatedTenantName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associatedTenantName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + billingAccountName, + associatedTenantName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String billingAccountName, String associatedTenantName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (associatedTenantName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associatedTenantName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + billingAccountName, + associatedTenantName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String billingAccountName, String associatedTenantName) { + Mono>> mono = deleteWithResponseAsync(billingAccountName, associatedTenantName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String billingAccountName, String associatedTenantName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(billingAccountName, associatedTenantName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String billingAccountName, String associatedTenantName) { + return this.beginDeleteAsync(billingAccountName, associatedTenantName).getSyncPoller(); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String billingAccountName, String associatedTenantName, Context context) { + return this.beginDeleteAsync(billingAccountName, associatedTenantName, context).getSyncPoller(); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String billingAccountName, String associatedTenantName) { + return beginDeleteAsync(billingAccountName, associatedTenantName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String billingAccountName, String associatedTenantName, Context context) { + return beginDeleteAsync(billingAccountName, associatedTenantName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String billingAccountName, String associatedTenantName) { + deleteAsync(billingAccountName, associatedTenantName).block(); + } + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String billingAccountName, String associatedTenantName, Context context) { + deleteAsync(billingAccountName, associatedTenantName, context).block(); + } + + /** + * 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 includeRevoked Can be used to get revoked associated tenants. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String billingAccountName, String associatedTenantName, Boolean includeRevoked) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (associatedTenantName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associatedTenantName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + billingAccountName, + associatedTenantName, + includeRevoked, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 includeRevoked Can be used to get revoked associated tenants. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String billingAccountName, String associatedTenantName, Boolean includeRevoked, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (associatedTenantName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associatedTenantName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + billingAccountName, + associatedTenantName, + includeRevoked, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant by ID on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String billingAccountName, String associatedTenantName) { + final Boolean includeRevoked = null; + return getWithResponseAsync(billingAccountName, associatedTenantName, includeRevoked) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 includeRevoked Can be used to get revoked associated tenants. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String billingAccountName, String associatedTenantName, Boolean includeRevoked, Context context) { + return getWithResponseAsync(billingAccountName, associatedTenantName, includeRevoked, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssociatedTenantInner get(String billingAccountName, String associatedTenantName) { + final Boolean includeRevoked = null; + return getWithResponse(billingAccountName, associatedTenantName, includeRevoked, Context.NONE).getValue(); + } + + /** + * 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 body An associated tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (associatedTenantName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associatedTenantName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + billingAccountName, + associatedTenantName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 body An associated tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (associatedTenantName == null) { + return Mono + .error(new IllegalArgumentException("Parameter associatedTenantName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + billingAccountName, + associatedTenantName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 body An associated tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an associated tenant. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AssociatedTenantInner> beginCreateOrUpdateAsync( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(billingAccountName, associatedTenantName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AssociatedTenantInner.class, + AssociatedTenantInner.class, + this.client.getContext()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an associated tenant. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AssociatedTenantInner> beginCreateOrUpdateAsync( + String billingAccountName, String associatedTenantName) { + final AssociatedTenantInner body = null; + Mono>> mono = + createOrUpdateWithResponseAsync(billingAccountName, associatedTenantName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AssociatedTenantInner.class, + AssociatedTenantInner.class, + this.client.getContext()); + } + + /** + * 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 body An associated tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an associated tenant. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AssociatedTenantInner> beginCreateOrUpdateAsync( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(billingAccountName, associatedTenantName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AssociatedTenantInner.class, AssociatedTenantInner.class, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an associated tenant. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AssociatedTenantInner> beginCreateOrUpdate( + String billingAccountName, String associatedTenantName) { + final AssociatedTenantInner body = null; + return this.beginCreateOrUpdateAsync(billingAccountName, associatedTenantName, body).getSyncPoller(); + } + + /** + * 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 body An associated tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an associated tenant. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AssociatedTenantInner> beginCreateOrUpdate( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body, Context context) { + return this.beginCreateOrUpdateAsync(billingAccountName, associatedTenantName, body, context).getSyncPoller(); + } + + /** + * 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 body An associated tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body) { + return beginCreateOrUpdateAsync(billingAccountName, associatedTenantName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String billingAccountName, String associatedTenantName) { + final AssociatedTenantInner body = null; + return beginCreateOrUpdateAsync(billingAccountName, associatedTenantName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body An associated tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body, Context context) { + return beginCreateOrUpdateAsync(billingAccountName, associatedTenantName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssociatedTenantInner createOrUpdate(String billingAccountName, String associatedTenantName) { + final AssociatedTenantInner body = null; + return createOrUpdateAsync(billingAccountName, associatedTenantName, body).block(); + } + + /** + * 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 body An associated tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssociatedTenantInner createOrUpdate( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body, Context context) { + return createOrUpdateAsync(billingAccountName, associatedTenantName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantsImpl.java new file mode 100644 index 0000000000000..c48c8a5f0377a --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AssociatedTenantsImpl.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.billing.fluent.AssociatedTenantsClient; +import com.azure.resourcemanager.billing.fluent.models.AssociatedTenantInner; +import com.azure.resourcemanager.billing.models.AssociatedTenant; +import com.azure.resourcemanager.billing.models.AssociatedTenants; + +public final class AssociatedTenantsImpl implements AssociatedTenants { + private static final ClientLogger LOGGER = new ClientLogger(AssociatedTenantsImpl.class); + + private final AssociatedTenantsClient innerClient; + + private final com.azure.resourcemanager.billing.BillingManager serviceManager; + + public AssociatedTenantsImpl( + AssociatedTenantsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByBillingAccount(String billingAccountName) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); + return Utils.mapPage(inner, inner1 -> new AssociatedTenantImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount( + String billingAccountName, + Boolean includeRevoked, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByBillingAccount( + billingAccountName, includeRevoked, filter, orderBy, top, skip, count, search, context); + return Utils.mapPage(inner, inner1 -> new AssociatedTenantImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String billingAccountName, String associatedTenantName) { + this.serviceClient().delete(billingAccountName, associatedTenantName); + } + + public void delete(String billingAccountName, String associatedTenantName, Context context) { + this.serviceClient().delete(billingAccountName, associatedTenantName, context); + } + + public Response getWithResponse( + String billingAccountName, String associatedTenantName, Boolean includeRevoked, Context context) { + Response inner = + this.serviceClient().getWithResponse(billingAccountName, associatedTenantName, includeRevoked, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AssociatedTenantImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AssociatedTenant get(String billingAccountName, String associatedTenantName) { + AssociatedTenantInner inner = this.serviceClient().get(billingAccountName, associatedTenantName); + if (inner != null) { + return new AssociatedTenantImpl(inner, this.manager()); + } else { + return null; + } + } + + public AssociatedTenant createOrUpdate(String billingAccountName, String associatedTenantName) { + AssociatedTenantInner inner = this.serviceClient().createOrUpdate(billingAccountName, associatedTenantName); + if (inner != null) { + return new AssociatedTenantImpl(inner, this.manager()); + } else { + return null; + } + } + + public AssociatedTenant createOrUpdate( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body, Context context) { + AssociatedTenantInner inner = + this.serviceClient().createOrUpdate(billingAccountName, associatedTenantName, body, context); + if (inner != null) { + return new AssociatedTenantImpl(inner, this.manager()); + } else { + return null; + } + } + + private AssociatedTenantsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.billing.BillingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalanceImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalanceImpl.java index bc5cb89696126..c25b6993ec4d7 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalanceImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalanceImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; import com.azure.resourcemanager.billing.models.Amount; import com.azure.resourcemanager.billing.models.AvailableBalance; @@ -31,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public Amount amount() { return this.innerModel().amount(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java index 471b34da5840c..950ec74d63201 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java @@ -53,8 +53,7 @@ public final class AvailableBalancesClientImpl implements AvailableBalancesClien public interface AvailableBalancesService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/availableBalance/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -95,7 +94,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -105,7 +103,7 @@ private Mono> getWithResponseAsync( this.client.getEndpoint(), billingAccountName, billingProfileName, - apiVersion, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -141,11 +139,16 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get(this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, accept, context); + .get( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + this.client.getApiVersion(), + accept, + context); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountImpl.java index 51db3bd097ad2..a2fff57115027 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingAccountInner; import com.azure.resourcemanager.billing.models.AccountStatus; import com.azure.resourcemanager.billing.models.AccountType; @@ -40,34 +41,26 @@ public String type() { return this.innerModel().type(); } - public String displayName() { - return this.innerModel().displayName(); - } - - public AddressDetails soldTo() { - return this.innerModel().soldTo(); + public SystemData systemData() { + return this.innerModel().systemData(); } - public AgreementType agreementType() { - return this.innerModel().agreementType(); + public AccountStatus accountStatus() { + return this.innerModel().accountStatus(); } public AccountType accountType() { return this.innerModel().accountType(); } - public AccountStatus accountStatus() { - return this.innerModel().accountStatus(); + public AgreementType agreementType() { + return this.innerModel().agreementType(); } public BillingProfilesOnExpand billingProfiles() { return this.innerModel().billingProfiles(); } - public Enrollment enrollmentDetails() { - return this.innerModel().enrollmentDetails(); - } - public List departments() { List inner = this.innerModel().departments(); if (inner != null) { @@ -77,6 +70,10 @@ public List departments() { } } + public String displayName() { + return this.innerModel().displayName(); + } + public List enrollmentAccounts() { List inner = this.innerModel().enrollmentAccounts(); if (inner != null) { @@ -86,6 +83,10 @@ public List enrollmentAccounts() { } } + public Enrollment enrollmentDetails() { + return this.innerModel().enrollmentDetails(); + } + public Boolean hasReadAccess() { return this.innerModel().hasReadAccess(); } @@ -94,6 +95,10 @@ public String notificationEmailAddress() { return this.innerModel().notificationEmailAddress(); } + public AddressDetails soldTo() { + return this.innerModel().soldTo(); + } + public BillingAccountInner innerModel() { return this.innerObject; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java index 11d57989b5271..25b21629e7476 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java @@ -104,8 +104,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}" - + "/listInvoiceSectionsWithCreateSubscriptionPermission") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> @@ -155,10 +154,11 @@ private Mono> listSinglePageAsync(String expa new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, expand, accept, context)) + .withContext( + context -> + service.list(this.client.getEndpoint(), this.client.getApiVersion(), expand, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -189,11 +189,10 @@ private Mono> listSinglePageAsync(String expa new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, expand, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), expand, accept, context) .map( res -> new PagedResponseBase<>( @@ -298,12 +297,18 @@ private Mono> getWithResponseAsync(String billingA return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> - service.get(this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context)) + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + expand, + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -331,10 +336,10 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context); + return service + .get(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, expand, accept, context); } /** @@ -412,13 +417,18 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .update(this.client.getEndpoint(), apiVersion, billingAccountName, parameters, accept, context)) + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + parameters, + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -452,10 +462,16 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, billingAccountName, parameters, accept, context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + parameters, + accept, + context); } /** @@ -635,14 +651,17 @@ public BillingAccountInner update( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service .listInvoiceSectionsByCreateSubscriptionPermission( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context)) + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -680,12 +699,11 @@ public BillingAccountInner update( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listInvoiceSectionsByCreateSubscriptionPermission( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context) + this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java index 884d4f2877fd5..d7390f5c2b761 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java @@ -17,22 +17,6 @@ /** A builder for creating a new instance of the BillingManagementClientImpl type. */ @ServiceClientBuilder(serviceClients = {BillingManagementClientImpl.class}) public final class BillingManagementClientBuilder { - /* - * The ID that uniquely identifies an Azure subscription. - */ - private String subscriptionId; - - /** - * Sets The ID that uniquely identifies an Azure subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the BillingManagementClientBuilder. - */ - public BillingManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - /* * server parameter */ @@ -133,12 +117,7 @@ public BillingManagementClientImpl buildClient() { : SerializerFactory.createDefaultManagementSerializerAdapter(); BillingManagementClientImpl client = new BillingManagementClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); + localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint); return client; } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientImpl.java index 0bd154a2b8411..dda07d0161f24 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientImpl.java @@ -24,22 +24,23 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.billing.fluent.AddressClient; import com.azure.resourcemanager.billing.fluent.AgreementsClient; +import com.azure.resourcemanager.billing.fluent.AssociatedTenantsClient; import com.azure.resourcemanager.billing.fluent.AvailableBalancesClient; import com.azure.resourcemanager.billing.fluent.BillingAccountsClient; import com.azure.resourcemanager.billing.fluent.BillingManagementClient; -import com.azure.resourcemanager.billing.fluent.BillingPeriodsClient; import com.azure.resourcemanager.billing.fluent.BillingPermissionsClient; import com.azure.resourcemanager.billing.fluent.BillingProfilesClient; import com.azure.resourcemanager.billing.fluent.BillingPropertiesClient; +import com.azure.resourcemanager.billing.fluent.BillingRequestsClient; import com.azure.resourcemanager.billing.fluent.BillingRoleAssignmentsClient; import com.azure.resourcemanager.billing.fluent.BillingRoleDefinitionsClient; import com.azure.resourcemanager.billing.fluent.BillingSubscriptionsClient; import com.azure.resourcemanager.billing.fluent.CustomersClient; -import com.azure.resourcemanager.billing.fluent.EnrollmentAccountsClient; import com.azure.resourcemanager.billing.fluent.InstructionsClient; import com.azure.resourcemanager.billing.fluent.InvoiceSectionsClient; import com.azure.resourcemanager.billing.fluent.InvoicesClient; import com.azure.resourcemanager.billing.fluent.OperationsClient; +import com.azure.resourcemanager.billing.fluent.PaymentMethodsClient; import com.azure.resourcemanager.billing.fluent.PoliciesClient; import com.azure.resourcemanager.billing.fluent.ProductsClient; import com.azure.resourcemanager.billing.fluent.ReservationsClient; @@ -56,18 +57,6 @@ /** Initializes a new instance of the BillingManagementClientImpl type. */ @ServiceClient(builder = BillingManagementClientBuilder.class) public final class BillingManagementClientImpl implements BillingManagementClient { - /** The ID that uniquely identifies an Azure subscription. */ - private final String subscriptionId; - - /** - * Gets The ID that uniquely identifies an Azure subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - /** server parameter. */ private final String endpoint; @@ -80,6 +69,18 @@ public String getEndpoint() { return this.endpoint; } + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** The HTTP pipeline to send requests through. */ private final HttpPipeline httpPipeline; @@ -116,28 +117,28 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The BillingAccountsClient object to access its operations. */ - private final BillingAccountsClient billingAccounts; + /** The AgreementsClient object to access its operations. */ + private final AgreementsClient agreements; /** - * Gets the BillingAccountsClient object to access its operations. + * Gets the AgreementsClient object to access its operations. * - * @return the BillingAccountsClient object. + * @return the AgreementsClient object. */ - public BillingAccountsClient getBillingAccounts() { - return this.billingAccounts; + public AgreementsClient getAgreements() { + return this.agreements; } - /** The AddressClient object to access its operations. */ - private final AddressClient address; + /** The AssociatedTenantsClient object to access its operations. */ + private final AssociatedTenantsClient associatedTenants; /** - * Gets the AddressClient object to access its operations. + * Gets the AssociatedTenantsClient object to access its operations. * - * @return the AddressClient object. + * @return the AssociatedTenantsClient object. */ - public AddressClient getAddress() { - return this.address; + public AssociatedTenantsClient getAssociatedTenants() { + return this.associatedTenants; } /** The AvailableBalancesClient object to access its operations. */ @@ -152,16 +153,40 @@ public AvailableBalancesClient getAvailableBalances() { return this.availableBalances; } - /** The InstructionsClient object to access its operations. */ - private final InstructionsClient instructions; + /** The BillingAccountsClient object to access its operations. */ + private final BillingAccountsClient billingAccounts; /** - * Gets the InstructionsClient object to access its operations. + * Gets the BillingAccountsClient object to access its operations. * - * @return the InstructionsClient object. + * @return the BillingAccountsClient object. */ - public InstructionsClient getInstructions() { - return this.instructions; + public BillingAccountsClient getBillingAccounts() { + return this.billingAccounts; + } + + /** The AddressClient object to access its operations. */ + private final AddressClient address; + + /** + * Gets the AddressClient object to access its operations. + * + * @return the AddressClient object. + */ + public AddressClient getAddress() { + return this.address; + } + + /** The BillingPermissionsClient object to access its operations. */ + private final BillingPermissionsClient billingPermissions; + + /** + * Gets the BillingPermissionsClient object to access its operations. + * + * @return the BillingPermissionsClient object. + */ + public BillingPermissionsClient getBillingPermissions() { + return this.billingPermissions; } /** The BillingProfilesClient object to access its operations. */ @@ -176,40 +201,52 @@ public BillingProfilesClient getBillingProfiles() { return this.billingProfiles; } - /** The CustomersClient object to access its operations. */ - private final CustomersClient customers; + /** The BillingPropertiesClient object to access its operations. */ + private final BillingPropertiesClient billingProperties; /** - * Gets the CustomersClient object to access its operations. + * Gets the BillingPropertiesClient object to access its operations. * - * @return the CustomersClient object. + * @return the BillingPropertiesClient object. */ - public CustomersClient getCustomers() { - return this.customers; + public BillingPropertiesClient getBillingProperties() { + return this.billingProperties; } - /** The InvoiceSectionsClient object to access its operations. */ - private final InvoiceSectionsClient invoiceSections; + /** The BillingRequestsClient object to access its operations. */ + private final BillingRequestsClient billingRequests; /** - * Gets the InvoiceSectionsClient object to access its operations. + * Gets the BillingRequestsClient object to access its operations. * - * @return the InvoiceSectionsClient object. + * @return the BillingRequestsClient object. */ - public InvoiceSectionsClient getInvoiceSections() { - return this.invoiceSections; + public BillingRequestsClient getBillingRequests() { + return this.billingRequests; } - /** The BillingPermissionsClient object to access its operations. */ - private final BillingPermissionsClient billingPermissions; + /** The BillingRoleAssignmentsClient object to access its operations. */ + private final BillingRoleAssignmentsClient billingRoleAssignments; /** - * Gets the BillingPermissionsClient object to access its operations. + * Gets the BillingRoleAssignmentsClient object to access its operations. * - * @return the BillingPermissionsClient object. + * @return the BillingRoleAssignmentsClient object. */ - public BillingPermissionsClient getBillingPermissions() { - return this.billingPermissions; + public BillingRoleAssignmentsClient getBillingRoleAssignments() { + return this.billingRoleAssignments; + } + + /** The BillingRoleDefinitionsClient object to access its operations. */ + private final BillingRoleDefinitionsClient billingRoleDefinitions; + + /** + * Gets the BillingRoleDefinitionsClient object to access its operations. + * + * @return the BillingRoleDefinitionsClient object. + */ + public BillingRoleDefinitionsClient getBillingRoleDefinitions() { + return this.billingRoleDefinitions; } /** The BillingSubscriptionsClient object to access its operations. */ @@ -224,100 +261,100 @@ public BillingSubscriptionsClient getBillingSubscriptions() { return this.billingSubscriptions; } - /** The ProductsClient object to access its operations. */ - private final ProductsClient products; + /** The CustomersClient object to access its operations. */ + private final CustomersClient customers; /** - * Gets the ProductsClient object to access its operations. + * Gets the CustomersClient object to access its operations. * - * @return the ProductsClient object. + * @return the CustomersClient object. */ - public ProductsClient getProducts() { - return this.products; + public CustomersClient getCustomers() { + return this.customers; } - /** The InvoicesClient object to access its operations. */ - private final InvoicesClient invoices; + /** The InstructionsClient object to access its operations. */ + private final InstructionsClient instructions; /** - * Gets the InvoicesClient object to access its operations. + * Gets the InstructionsClient object to access its operations. * - * @return the InvoicesClient object. + * @return the InstructionsClient object. */ - public InvoicesClient getInvoices() { - return this.invoices; + public InstructionsClient getInstructions() { + return this.instructions; } - /** The TransactionsClient object to access its operations. */ - private final TransactionsClient transactions; + /** The InvoicesClient object to access its operations. */ + private final InvoicesClient invoices; /** - * Gets the TransactionsClient object to access its operations. + * Gets the InvoicesClient object to access its operations. * - * @return the TransactionsClient object. + * @return the InvoicesClient object. */ - public TransactionsClient getTransactions() { - return this.transactions; + public InvoicesClient getInvoices() { + return this.invoices; } - /** The PoliciesClient object to access its operations. */ - private final PoliciesClient policies; + /** The InvoiceSectionsClient object to access its operations. */ + private final InvoiceSectionsClient invoiceSections; /** - * Gets the PoliciesClient object to access its operations. + * Gets the InvoiceSectionsClient object to access its operations. * - * @return the PoliciesClient object. + * @return the InvoiceSectionsClient object. */ - public PoliciesClient getPolicies() { - return this.policies; + public InvoiceSectionsClient getInvoiceSections() { + return this.invoiceSections; } - /** The BillingPropertiesClient object to access its operations. */ - private final BillingPropertiesClient billingProperties; + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; /** - * Gets the BillingPropertiesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the BillingPropertiesClient object. + * @return the OperationsClient object. */ - public BillingPropertiesClient getBillingProperties() { - return this.billingProperties; + public OperationsClient getOperations() { + return this.operations; } - /** The BillingRoleDefinitionsClient object to access its operations. */ - private final BillingRoleDefinitionsClient billingRoleDefinitions; + /** The PaymentMethodsClient object to access its operations. */ + private final PaymentMethodsClient paymentMethods; /** - * Gets the BillingRoleDefinitionsClient object to access its operations. + * Gets the PaymentMethodsClient object to access its operations. * - * @return the BillingRoleDefinitionsClient object. + * @return the PaymentMethodsClient object. */ - public BillingRoleDefinitionsClient getBillingRoleDefinitions() { - return this.billingRoleDefinitions; + public PaymentMethodsClient getPaymentMethods() { + return this.paymentMethods; } - /** The BillingRoleAssignmentsClient object to access its operations. */ - private final BillingRoleAssignmentsClient billingRoleAssignments; + /** The PoliciesClient object to access its operations. */ + private final PoliciesClient policies; /** - * Gets the BillingRoleAssignmentsClient object to access its operations. + * Gets the PoliciesClient object to access its operations. * - * @return the BillingRoleAssignmentsClient object. + * @return the PoliciesClient object. */ - public BillingRoleAssignmentsClient getBillingRoleAssignments() { - return this.billingRoleAssignments; + public PoliciesClient getPolicies() { + return this.policies; } - /** The AgreementsClient object to access its operations. */ - private final AgreementsClient agreements; + /** The ProductsClient object to access its operations. */ + private final ProductsClient products; /** - * Gets the AgreementsClient object to access its operations. + * Gets the ProductsClient object to access its operations. * - * @return the AgreementsClient object. + * @return the ProductsClient object. */ - public AgreementsClient getAgreements() { - return this.agreements; + public ProductsClient getProducts() { + return this.products; } /** The ReservationsClient object to access its operations. */ @@ -332,40 +369,16 @@ public ReservationsClient getReservations() { return this.reservations; } - /** The EnrollmentAccountsClient object to access its operations. */ - private final EnrollmentAccountsClient enrollmentAccounts; - - /** - * Gets the EnrollmentAccountsClient object to access its operations. - * - * @return the EnrollmentAccountsClient object. - */ - public EnrollmentAccountsClient getEnrollmentAccounts() { - return this.enrollmentAccounts; - } - - /** The BillingPeriodsClient object to access its operations. */ - private final BillingPeriodsClient billingPeriods; - - /** - * Gets the BillingPeriodsClient object to access its operations. - * - * @return the BillingPeriodsClient object. - */ - public BillingPeriodsClient getBillingPeriods() { - return this.billingPeriods; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The TransactionsClient object to access its operations. */ + private final TransactionsClient transactions; /** - * Gets the OperationsClient object to access its operations. + * Gets the TransactionsClient object to access its operations. * - * @return the OperationsClient object. + * @return the TransactionsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public TransactionsClient getTransactions() { + return this.transactions; } /** @@ -375,7 +388,6 @@ public OperationsClient getOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID that uniquely identifies an Azure subscription. * @param endpoint server parameter. */ BillingManagementClientImpl( @@ -383,34 +395,34 @@ public OperationsClient getOperations() { SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, - String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = "2023-04-01"; + this.agreements = new AgreementsClientImpl(this); + this.associatedTenants = new AssociatedTenantsClientImpl(this); + this.availableBalances = new AvailableBalancesClientImpl(this); this.billingAccounts = new BillingAccountsClientImpl(this); this.address = new AddressClientImpl(this); - this.availableBalances = new AvailableBalancesClientImpl(this); - this.instructions = new InstructionsClientImpl(this); - this.billingProfiles = new BillingProfilesClientImpl(this); - this.customers = new CustomersClientImpl(this); - this.invoiceSections = new InvoiceSectionsClientImpl(this); this.billingPermissions = new BillingPermissionsClientImpl(this); + this.billingProfiles = new BillingProfilesClientImpl(this); + this.billingProperties = new BillingPropertiesClientImpl(this); + this.billingRequests = new BillingRequestsClientImpl(this); + this.billingRoleAssignments = new BillingRoleAssignmentsClientImpl(this); + this.billingRoleDefinitions = new BillingRoleDefinitionsClientImpl(this); this.billingSubscriptions = new BillingSubscriptionsClientImpl(this); - this.products = new ProductsClientImpl(this); + this.customers = new CustomersClientImpl(this); + this.instructions = new InstructionsClientImpl(this); this.invoices = new InvoicesClientImpl(this); - this.transactions = new TransactionsClientImpl(this); + this.invoiceSections = new InvoiceSectionsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.paymentMethods = new PaymentMethodsClientImpl(this); this.policies = new PoliciesClientImpl(this); - this.billingProperties = new BillingPropertiesClientImpl(this); - this.billingRoleDefinitions = new BillingRoleDefinitionsClientImpl(this); - this.billingRoleAssignments = new BillingRoleAssignmentsClientImpl(this); - this.agreements = new AgreementsClientImpl(this); + this.products = new ProductsClientImpl(this); this.reservations = new ReservationsClientImpl(this); - this.enrollmentAccounts = new EnrollmentAccountsClientImpl(this); - this.billingPeriods = new BillingPeriodsClientImpl(this); - this.operations = new OperationsClientImpl(this); + this.transactions = new TransactionsClientImpl(this); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodImpl.java deleted file mode 100644 index 73818c947611b..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import java.time.LocalDate; -import java.util.Collections; -import java.util.List; - -public final class BillingPeriodImpl implements BillingPeriod { - private BillingPeriodInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - BillingPeriodImpl(BillingPeriodInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public LocalDate billingPeriodStartDate() { - return this.innerModel().billingPeriodStartDate(); - } - - public LocalDate billingPeriodEndDate() { - return this.innerModel().billingPeriodEndDate(); - } - - public List invoiceIds() { - List inner = this.innerModel().invoiceIds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public BillingPeriodInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsClientImpl.java deleted file mode 100644 index f2c6a987f1cba..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsClientImpl.java +++ /dev/null @@ -1,520 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.billing.fluent.BillingPeriodsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; -import com.azure.resourcemanager.billing.models.BillingPeriodsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BillingPeriodsClient. */ -public final class BillingPeriodsClientImpl implements BillingPeriodsClient { - /** The proxy service used to perform REST calls. */ - private final BillingPeriodsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of BillingPeriodsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BillingPeriodsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(BillingPeriodsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientBillingPeriods to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - public interface BillingPeriodsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @QueryParam("$skiptoken") String skiptoken, - @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("billingPeriodName") String billingPeriodName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * 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 filter 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'. - * @param skiptoken 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. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String skiptoken, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - filter, - skiptoken, - top, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 filter 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'. - * @param skiptoken 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. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String filter, String skiptoken, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - filter, - skiptoken, - top, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * 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 filter 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'. - * @param skiptoken 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. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String skiptoken, Integer top) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, skiptoken, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * 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. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - final String skiptoken = null; - final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter, skiptoken, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * 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 filter 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'. - * @param skiptoken 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. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String skiptoken, Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, skiptoken, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * 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. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final String skiptoken = null; - final Integer top = null; - return new PagedIterable<>(listAsync(filter, skiptoken, top)); - } - - /** - * 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 filter 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'. - * @param skiptoken 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. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String skiptoken, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, skiptoken, top, context)); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingPeriodName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (billingPeriodName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingPeriodName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - billingPeriodName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingPeriodName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (billingPeriodName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingPeriodName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - billingPeriodName, - accept, - context); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingPeriodName) { - return getWithResponseAsync(billingPeriodName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingPeriodName, Context context) { - return getWithResponseAsync(billingPeriodName, context).block(); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingPeriodInner get(String billingPeriodName) { - return getWithResponse(billingPeriodName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsImpl.java deleted file mode 100644 index caca277c8889f..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingPeriodsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import com.azure.resourcemanager.billing.models.BillingPeriods; - -public final class BillingPeriodsImpl implements BillingPeriods { - private static final ClientLogger LOGGER = new ClientLogger(BillingPeriodsImpl.class); - - private final BillingPeriodsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public BillingPeriodsImpl( - BillingPeriodsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new BillingPeriodImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, String skiptoken, Integer top, Context context) { - PagedIterable inner = this.serviceClient().list(filter, skiptoken, top, context); - return Utils.mapPage(inner, inner1 -> new BillingPeriodImpl(inner1, this.manager())); - } - - public Response getWithResponse(String billingPeriodName, Context context) { - Response inner = this.serviceClient().getWithResponse(billingPeriodName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingPeriodImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingPeriod get(String billingPeriodName) { - BillingPeriodInner inner = this.serviceClient().get(billingPeriodName); - if (inner != null) { - return new BillingPeriodImpl(inner, this.manager()); - } else { - return null; - } - } - - private BillingPeriodsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java index 73f902d8b4175..c7335e48510d3 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java @@ -57,34 +57,32 @@ public final class BillingPermissionsClientImpl implements BillingPermissionsCli @ServiceInterface(name = "BillingManagementCli") public interface BillingPermissionsService { @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}" - + "/billingPermissions") + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomer( + Mono> listByBillingAccount( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("customerName") String customerName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingPermissions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByInvoiceSections( @@ -98,15 +96,14 @@ Mono> listByInvoiceSections( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingPermissions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingPermissions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( + Mono> listByCustomer( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, + @PathParam("customerName") String customerName, @HeaderParam("Accept") String accept, Context context); @@ -114,7 +111,7 @@ Mono> listByBillingProfile( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomerNext( + Mono> listByBillingAccountNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -124,7 +121,7 @@ Mono> listByCustomerNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( + Mono> listByBillingProfileNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -144,7 +141,7 @@ Mono> listByInvoiceSectionsNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( + Mono> listByCustomerNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -152,10 +149,9 @@ Mono> listByBillingProfileNext( } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -163,8 +159,8 @@ Mono> listByBillingProfileNext( * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -175,17 +171,17 @@ private Mono> listByCustomerSin return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByCustomer( - this.client.getEndpoint(), apiVersion, billingAccountName, customerName, accept, context)) + .listByBillingAccount( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -199,10 +195,9 @@ private Mono> listByCustomerSin } /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -211,8 +206,8 @@ private Mono> listByCustomerSin * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName, Context context) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -223,14 +218,11 @@ private Mono> listByCustomerSin return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByCustomer(this.client.getEndpoint(), apiVersion, billingAccountName, customerName, accept, context) + .listByBillingAccount( + this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, accept, context) .map( res -> new PagedResponseBase<>( @@ -243,10 +235,9 @@ private Mono> listByCustomerSin } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -254,18 +245,16 @@ private Mono> listByCustomerSin * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync( - String billingAccountName, String customerName) { + private PagedFlux listByBillingAccountAsync(String billingAccountName) { return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName), - nextLink -> listByCustomerNextSinglePageAsync(nextLink)); + () -> listByBillingAccountSinglePageAsync(billingAccountName), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -274,18 +263,17 @@ private PagedFlux listByCustomerAsync( * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync( - String billingAccountName, String customerName, Context context) { + private PagedFlux listByBillingAccountAsync( + String billingAccountName, Context context) { return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName, context), - nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); + () -> listByBillingAccountSinglePageAsync(billingAccountName, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -293,16 +281,14 @@ private PagedFlux listByCustomerAsync( * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer( - String billingAccountName, String customerName) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName)); + public PagedIterable listByBillingAccount(String billingAccountName) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); } /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -311,15 +297,16 @@ public PagedIterable listByCustomer( * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName, context)); + public PagedIterable listByBillingAccount( + String billingAccountName, Context context) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -327,8 +314,8 @@ public PagedIterable listByCustomer( * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -339,14 +326,22 @@ private Mono> listByBillingAcco return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context)) + .listByBillingProfile( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingProfileName, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -360,9 +355,10 @@ private Mono> listByBillingAcco } /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -371,8 +367,8 @@ private Mono> listByBillingAcco * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, Context context) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -383,11 +379,20 @@ private Mono> listByBillingAcco return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, accept, context) + .listByBillingProfile( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingProfileName, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -400,9 +405,10 @@ private Mono> listByBillingAcco } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -410,16 +416,18 @@ private Mono> listByBillingAcco * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName) { return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -428,17 +436,18 @@ private PagedFlux listByBillingAccountAsync(S * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, Context context) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName, Context context) { return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -446,14 +455,16 @@ private PagedFlux listByBillingAccountAsync( * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); } /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -462,9 +473,9 @@ public PagedIterable listByBillingAccount(Str * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); } /** @@ -500,7 +511,6 @@ private Mono> listByInvoiceSect return Mono .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -508,7 +518,7 @@ private Mono> listByInvoiceSect service .listByInvoiceSections( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, invoiceSectionName, @@ -560,13 +570,12 @@ private Mono> listByInvoiceSect return Mono .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByInvoiceSections( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, invoiceSectionName, @@ -666,10 +675,10 @@ public PagedIterable listByInvoiceSections( } /** - * Lists the billing permissions the caller has on a billing profile. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -677,8 +686,8 @@ public PagedIterable listByInvoiceSections( * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { + private Mono> listByCustomerSinglePageAsync( + String billingAccountName, String customerName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -689,21 +698,19 @@ private Mono> listByBillingProf return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + if (customerName == null) { + return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingProfile( + .listByCustomer( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, + customerName, accept, context)) .>map( @@ -719,10 +726,10 @@ private Mono> listByBillingProf } /** - * Lists the billing permissions the caller has on a billing profile. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -731,8 +738,8 @@ private Mono> listByBillingProf * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { + private Mono> listByCustomerSinglePageAsync( + String billingAccountName, String customerName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -743,16 +750,19 @@ private Mono> listByBillingProf return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + if (customerName == null) { + return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfile( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, accept, context) + .listByCustomer( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + customerName, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -765,10 +775,10 @@ private Mono> listByBillingProf } /** - * Lists the billing permissions the caller has on a billing profile. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -776,18 +786,18 @@ private Mono> listByBillingProf * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { + private PagedFlux listByCustomerAsync( + String billingAccountName, String customerName) { return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + () -> listByCustomerSinglePageAsync(billingAccountName, customerName), + nextLink -> listByCustomerNextSinglePageAsync(nextLink)); } /** - * Lists the billing permissions the caller has on a billing profile. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -796,18 +806,18 @@ private PagedFlux listByBillingProfileAsync( * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { + private PagedFlux listByCustomerAsync( + String billingAccountName, String customerName, Context context) { return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); + () -> listByCustomerSinglePageAsync(billingAccountName, customerName, context), + nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); } /** - * Lists the billing permissions the caller has on a billing profile. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -815,16 +825,16 @@ private PagedFlux listByBillingProfileAsync( * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); + public PagedIterable listByCustomer( + String billingAccountName, String customerName) { + return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName)); } /** - * Lists the billing permissions the caller has on a billing profile. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -833,9 +843,9 @@ public PagedIterable listByBillingProfile( * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); + public PagedIterable listByCustomer( + String billingAccountName, String customerName, Context context) { + return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName, context)); } /** @@ -850,7 +860,8 @@ public PagedIterable listByBillingProfile( * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync(String nextLink) { + private Mono> listByBillingAccountNextSinglePageAsync( + String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -862,7 +873,8 @@ private Mono> listByCustomerNex } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext( + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -888,7 +900,7 @@ private Mono> listByCustomerNex * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync( + private Mono> listByBillingAccountNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -902,7 +914,7 @@ private Mono> listByCustomerNex final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -926,7 +938,7 @@ private Mono> listByCustomerNex * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( + private Mono> listByBillingProfileNextSinglePageAsync( String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -940,7 +952,7 @@ private Mono> listByBillingAcco final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -966,7 +978,7 @@ private Mono> listByBillingAcco * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( + private Mono> listByBillingProfileNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -980,7 +992,7 @@ private Mono> listByBillingAcco final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1082,8 +1094,7 @@ private Mono> listByInvoiceSect * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink) { + private Mono> listByCustomerNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1095,8 +1106,7 @@ private Mono> listByBillingProf } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1122,7 +1132,7 @@ private Mono> listByBillingProf * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( + private Mono> listByCustomerNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1136,7 +1146,7 @@ private Mono> listByBillingProf final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsImpl.java index 270cfd126b1f3..8a6116aa81db5 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsImpl.java @@ -25,29 +25,30 @@ public BillingPermissionsImpl( this.serviceManager = serviceManager; } - public PagedIterable listByCustomer(String billingAccountName, String customerName) { + public PagedIterable listByBillingAccount(String billingAccountName) { PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName); + this.serviceClient().listByBillingAccount(billingAccountName); return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); } - public PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context) { + public PagedIterable listByBillingAccount( + String billingAccountName, Context context) { PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName, context); + this.serviceClient().listByBillingAccount(billingAccountName, context); return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); } - public PagedIterable listByBillingAccount(String billingAccountName) { + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName) { PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName); + this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); } - public PagedIterable listByBillingAccount( - String billingAccountName, Context context) { + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context) { PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, context); + this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); } @@ -67,17 +68,16 @@ public PagedIterable listByInvoiceSections( return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); } - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { + public PagedIterable listByCustomer(String billingAccountName, String customerName) { PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); + this.serviceClient().listByCustomer(billingAccountName, customerName); return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); } - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { + public PagedIterable listByCustomer( + String billingAccountName, String customerName, Context context) { PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); + this.serviceClient().listByCustomer(billingAccountName, customerName, context); return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfileImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfileAutoGeneratedImpl.java similarity index 84% rename from sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfileImpl.java rename to sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfileAutoGeneratedImpl.java index ed1966be0269d..4ed693de7eac4 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfileImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfileAutoGeneratedImpl.java @@ -4,14 +4,15 @@ package com.azure.resourcemanager.billing.implementation; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner; import com.azure.resourcemanager.billing.models.AddressDetails; import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.BillingProfile; +import com.azure.resourcemanager.billing.models.BillingProfileAutoGenerated; import com.azure.resourcemanager.billing.models.BillingProfileStatus; import com.azure.resourcemanager.billing.models.BillingRelationshipType; import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo; -import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpand; +import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpandAutoGenerated; import com.azure.resourcemanager.billing.models.SpendingLimit; import com.azure.resourcemanager.billing.models.StatusReasonCode; import com.azure.resourcemanager.billing.models.TargetCloud; @@ -19,13 +20,13 @@ import java.util.List; import java.util.Map; -public final class BillingProfileImpl implements BillingProfile { - private BillingProfileInner innerObject; +public final class BillingProfileAutoGeneratedImpl implements BillingProfileAutoGenerated { + private BillingProfileAutoGeneratedInner innerObject; private final com.azure.resourcemanager.billing.BillingManager serviceManager; - BillingProfileImpl( - BillingProfileInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { + BillingProfileAutoGeneratedImpl( + BillingProfileAutoGeneratedInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -42,12 +43,8 @@ public String type() { return this.innerModel().type(); } - public String displayName() { - return this.innerModel().displayName(); - } - - public String poNumber() { - return this.innerModel().poNumber(); + public SystemData systemData() { + return this.innerModel().systemData(); } public BillingRelationshipType billingRelationshipType() { @@ -58,22 +55,14 @@ public AddressDetails billTo() { return this.innerModel().billTo(); } - public IndirectRelationshipInfo indirectRelationshipInfo() { - return this.innerModel().indirectRelationshipInfo(); - } - - public Boolean invoiceEmailOptIn() { - return this.innerModel().invoiceEmailOptIn(); - } - - public Integer invoiceDay() { - return this.innerModel().invoiceDay(); - } - public String currency() { return this.innerModel().currency(); } + public String displayName() { + return this.innerModel().displayName(); + } + public List enabledAzurePlans() { List inner = this.innerModel().enabledAzurePlans(); if (inner != null) { @@ -83,16 +72,32 @@ public List enabledAzurePlans() { } } - public InvoiceSectionsOnExpand invoiceSections() { + public Boolean hasReadAccess() { + return this.innerModel().hasReadAccess(); + } + + public IndirectRelationshipInfo indirectRelationshipInfo() { + return this.innerModel().indirectRelationshipInfo(); + } + + public Integer invoiceDay() { + return this.innerModel().invoiceDay(); + } + + public Boolean invoiceEmailOptIn() { + return this.innerModel().invoiceEmailOptIn(); + } + + public InvoiceSectionsOnExpandAutoGenerated invoiceSections() { return this.innerModel().invoiceSections(); } - public Boolean hasReadAccess() { - return this.innerModel().hasReadAccess(); + public String poNumber() { + return this.innerModel().poNumber(); } - public String systemId() { - return this.innerModel().systemId(); + public SpendingLimit spendingLimit() { + return this.innerModel().spendingLimit(); } public BillingProfileStatus status() { @@ -103,29 +108,29 @@ public StatusReasonCode statusReasonCode() { return this.innerModel().statusReasonCode(); } - public SpendingLimit spendingLimit() { - return this.innerModel().spendingLimit(); + public String systemId() { + return this.innerModel().systemId(); } - public List targetClouds() { - List inner = this.innerModel().targetClouds(); + public Map tags() { + Map inner = this.innerModel().tags(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableMap(inner); } else { - return Collections.emptyList(); + return Collections.emptyMap(); } } - public Map tags() { - Map inner = this.innerModel().tags(); + public List targetClouds() { + List inner = this.innerModel().targetClouds(); if (inner != null) { - return Collections.unmodifiableMap(inner); + return Collections.unmodifiableList(inner); } else { - return Collections.emptyMap(); + return Collections.emptyList(); } } - public BillingProfileInner innerModel() { + public BillingProfileAutoGeneratedInner innerModel() { return this.innerObject; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java index 2637067911973..92789b240b802 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java @@ -31,7 +31,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.billing.fluent.BillingProfilesClient; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner; import com.azure.resourcemanager.billing.models.BillingProfileListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -79,7 +79,7 @@ Mono> listByBillingAccount( @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @@ -97,7 +97,7 @@ Mono>> createOrUpdate( @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, - @BodyParam("application/json") BillingProfileInner parameters, + @BodyParam("application/json") BillingProfileAutoGeneratedInner parameters, @HeaderParam("Accept") String accept, Context context); @@ -124,7 +124,7 @@ Mono> listByBillingAccountNext( * @return the list of billing profiles along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( + private Mono> listByBillingAccountSinglePageAsync( String billingAccountName, String expand) { if (this.client.getEndpoint() == null) { return Mono @@ -136,15 +136,19 @@ private Mono> listByBillingAccountSinglePageA return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context)) - .>map( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + expand, + accept, + context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -169,7 +173,7 @@ private Mono> listByBillingAccountSinglePageA * @return the list of billing profiles along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( + private Mono> listByBillingAccountSinglePageAsync( String billingAccountName, String expand, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -181,11 +185,11 @@ private Mono> listByBillingAccountSinglePageA return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context) + .listByBillingAccount( + this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, expand, accept, context) .map( res -> new PagedResponseBase<>( @@ -209,7 +213,8 @@ private Mono> listByBillingAccountSinglePageA * @return the list of billing profiles as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName, String expand) { + private PagedFlux listByBillingAccountAsync( + String billingAccountName, String expand) { return new PagedFlux<>( () -> listByBillingAccountSinglePageAsync(billingAccountName, expand), nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); @@ -226,7 +231,7 @@ private PagedFlux listByBillingAccountAsync(String billingA * @return the list of billing profiles as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { + private PagedFlux listByBillingAccountAsync(String billingAccountName) { final String expand = null; return new PagedFlux<>( () -> listByBillingAccountSinglePageAsync(billingAccountName, expand), @@ -246,7 +251,7 @@ private PagedFlux listByBillingAccountAsync(String billingA * @return the list of billing profiles as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( + private PagedFlux listByBillingAccountAsync( String billingAccountName, String expand, Context context) { return new PagedFlux<>( () -> listByBillingAccountSinglePageAsync(billingAccountName, expand, context), @@ -264,7 +269,7 @@ private PagedFlux listByBillingAccountAsync( * @return the list of billing profiles as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { + public PagedIterable listByBillingAccount(String billingAccountName) { final String expand = null; return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, expand)); } @@ -282,7 +287,7 @@ public PagedIterable listByBillingAccount(String billingAcc * @return the list of billing profiles as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( + public PagedIterable listByBillingAccount( String billingAccountName, String expand, Context context) { return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, expand, context)); } @@ -300,7 +305,7 @@ public PagedIterable listByBillingAccount( * @return a billing profile by its ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String billingAccountName, String billingProfileName, String expand) { if (this.client.getEndpoint() == null) { return Mono @@ -316,7 +321,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -324,7 +328,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, expand, @@ -347,7 +351,7 @@ private Mono> getWithResponseAsync( * @return a billing profile by its ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( + private Mono> getWithResponseAsync( String billingAccountName, String billingProfileName, String expand, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -363,12 +367,17 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, expand, accept, context); + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingProfileName, + expand, + accept, + context); } /** @@ -383,7 +392,7 @@ private Mono> getWithResponseAsync( * @return a billing profile by its ID on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String billingProfileName) { + private Mono getAsync(String billingAccountName, String billingProfileName) { final String expand = null; return getWithResponseAsync(billingAccountName, billingProfileName, expand) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -403,7 +412,7 @@ private Mono getAsync(String billingAccountName, String bil * @return a billing profile by its ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( + public Response getWithResponse( String billingAccountName, String billingProfileName, String expand, Context context) { return getWithResponseAsync(billingAccountName, billingProfileName, expand, context).block(); } @@ -420,7 +429,7 @@ public Response getWithResponse( * @return a billing profile by its ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingProfileInner get(String billingAccountName, String billingProfileName) { + public BillingProfileAutoGeneratedInner get(String billingAccountName, String billingProfileName) { final String expand = null; return getWithResponse(billingAccountName, billingProfileName, expand, Context.NONE).getValue(); } @@ -439,7 +448,7 @@ public BillingProfileInner get(String billingAccountName, String billingProfileN */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + String billingAccountName, String billingProfileName, BillingProfileAutoGeneratedInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -459,7 +468,6 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -467,7 +475,7 @@ private Mono>> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, parameters, @@ -491,7 +499,10 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { + String billingAccountName, + String billingProfileName, + BillingProfileAutoGeneratedInner parameters, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -511,13 +522,12 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, parameters, @@ -538,17 +548,18 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of a billing profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BillingProfileInner> beginCreateOrUpdateAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + private PollerFlux, BillingProfileAutoGeneratedInner> + beginCreateOrUpdateAsync( + String billingAccountName, String billingProfileName, BillingProfileAutoGeneratedInner parameters) { Mono>> mono = createOrUpdateWithResponseAsync(billingAccountName, billingProfileName, parameters); return this .client - .getLroResult( + .getLroResult( mono, this.client.getHttpPipeline(), - BillingProfileInner.class, - BillingProfileInner.class, + BillingProfileAutoGeneratedInner.class, + BillingProfileAutoGeneratedInner.class, this.client.getContext()); } @@ -566,15 +577,23 @@ private PollerFlux, BillingProfileInner> beginCr * @return the {@link PollerFlux} for polling of a billing profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BillingProfileInner> beginCreateOrUpdateAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { + private PollerFlux, BillingProfileAutoGeneratedInner> + beginCreateOrUpdateAsync( + String billingAccountName, + String billingProfileName, + BillingProfileAutoGeneratedInner parameters, + Context context) { context = this.client.mergeContext(context); Mono>> mono = createOrUpdateWithResponseAsync(billingAccountName, billingProfileName, parameters, context); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), BillingProfileInner.class, BillingProfileInner.class, context); + .getLroResult( + mono, + this.client.getHttpPipeline(), + BillingProfileAutoGeneratedInner.class, + BillingProfileAutoGeneratedInner.class, + context); } /** @@ -590,8 +609,9 @@ private PollerFlux, BillingProfileInner> beginCr * @return the {@link SyncPoller} for polling of a billing profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + public SyncPoller, BillingProfileAutoGeneratedInner> + beginCreateOrUpdate( + String billingAccountName, String billingProfileName, BillingProfileAutoGeneratedInner parameters) { return this.beginCreateOrUpdateAsync(billingAccountName, billingProfileName, parameters).getSyncPoller(); } @@ -609,8 +629,12 @@ public SyncPoller, BillingProfileInner> beginCre * @return the {@link SyncPoller} for polling of a billing profile. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { + public SyncPoller, BillingProfileAutoGeneratedInner> + beginCreateOrUpdate( + String billingAccountName, + String billingProfileName, + BillingProfileAutoGeneratedInner parameters, + Context context) { return this .beginCreateOrUpdateAsync(billingAccountName, billingProfileName, parameters, context) .getSyncPoller(); @@ -629,8 +653,8 @@ public SyncPoller, BillingProfileInner> beginCre * @return a billing profile on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + private Mono createOrUpdateAsync( + String billingAccountName, String billingProfileName, BillingProfileAutoGeneratedInner parameters) { return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -650,8 +674,11 @@ private Mono createOrUpdateAsync( * @return a billing profile on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { + private Mono createOrUpdateAsync( + String billingAccountName, + String billingProfileName, + BillingProfileAutoGeneratedInner parameters, + Context context) { return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -670,8 +697,8 @@ private Mono createOrUpdateAsync( * @return a billing profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingProfileInner createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { + public BillingProfileAutoGeneratedInner createOrUpdate( + String billingAccountName, String billingProfileName, BillingProfileAutoGeneratedInner parameters) { return createOrUpdateAsync(billingAccountName, billingProfileName, parameters).block(); } @@ -689,8 +716,11 @@ public BillingProfileInner createOrUpdate( * @return a billing profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingProfileInner createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { + public BillingProfileAutoGeneratedInner createOrUpdate( + String billingAccountName, + String billingProfileName, + BillingProfileAutoGeneratedInner parameters, + Context context) { return createOrUpdateAsync(billingAccountName, billingProfileName, parameters, context).block(); } @@ -705,7 +735,8 @@ public BillingProfileInner createOrUpdate( * @return the list of billing profiles along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + private Mono> listByBillingAccountNextSinglePageAsync( + String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -719,7 +750,7 @@ private Mono> listByBillingAccountNextSingleP return FluxUtil .withContext( context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -743,7 +774,7 @@ private Mono> listByBillingAccountNextSingleP * @return the list of billing profiles along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( + private Mono> listByBillingAccountNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesImpl.java index 601b499b1af99..0446d7f754b0e 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesImpl.java @@ -10,8 +10,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.billing.fluent.BillingProfilesClient; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; -import com.azure.resourcemanager.billing.models.BillingProfile; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner; +import com.azure.resourcemanager.billing.models.BillingProfileAutoGenerated; import com.azure.resourcemanager.billing.models.BillingProfiles; public final class BillingProfilesImpl implements BillingProfiles { @@ -27,59 +27,63 @@ public BillingProfilesImpl( this.serviceManager = serviceManager; } - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new BillingProfileImpl(inner1, this.manager())); + public PagedIterable listByBillingAccount(String billingAccountName) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountName); + return Utils.mapPage(inner, inner1 -> new BillingProfileAutoGeneratedImpl(inner1, this.manager())); } - public PagedIterable listByBillingAccount( + public PagedIterable listByBillingAccount( String billingAccountName, String expand, Context context) { - PagedIterable inner = + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName, expand, context); - return Utils.mapPage(inner, inner1 -> new BillingProfileImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new BillingProfileAutoGeneratedImpl(inner1, this.manager())); } - public Response getWithResponse( + public Response getWithResponse( String billingAccountName, String billingProfileName, String expand, Context context) { - Response inner = + Response inner = this.serviceClient().getWithResponse(billingAccountName, billingProfileName, expand, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BillingProfileImpl(inner.getValue(), this.manager())); + new BillingProfileAutoGeneratedImpl(inner.getValue(), this.manager())); } else { return null; } } - public BillingProfile get(String billingAccountName, String billingProfileName) { - BillingProfileInner inner = this.serviceClient().get(billingAccountName, billingProfileName); + public BillingProfileAutoGenerated get(String billingAccountName, String billingProfileName) { + BillingProfileAutoGeneratedInner inner = this.serviceClient().get(billingAccountName, billingProfileName); if (inner != null) { - return new BillingProfileImpl(inner, this.manager()); + return new BillingProfileAutoGeneratedImpl(inner, this.manager()); } else { return null; } } - public BillingProfile createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { - BillingProfileInner inner = + public BillingProfileAutoGenerated createOrUpdate( + String billingAccountName, String billingProfileName, BillingProfileAutoGeneratedInner parameters) { + BillingProfileAutoGeneratedInner inner = this.serviceClient().createOrUpdate(billingAccountName, billingProfileName, parameters); if (inner != null) { - return new BillingProfileImpl(inner, this.manager()); + return new BillingProfileAutoGeneratedImpl(inner, this.manager()); } else { return null; } } - public BillingProfile createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { - BillingProfileInner inner = + public BillingProfileAutoGenerated createOrUpdate( + String billingAccountName, + String billingProfileName, + BillingProfileAutoGeneratedInner parameters, + Context context) { + BillingProfileAutoGeneratedInner inner = this.serviceClient().createOrUpdate(billingAccountName, billingProfileName, parameters, context); if (inner != null) { - return new BillingProfileImpl(inner, this.manager()); + return new BillingProfileAutoGeneratedImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesClientImpl.java index ecbccb1a5717f..d7ef8f413bc85 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesClientImpl.java @@ -81,32 +81,30 @@ Mono> update( * Get the billing properties for a subscription. This operation is not supported for billing accounts with * agreement type Enterprise Agreement. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the billing properties for a subscription along with {@link Response} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync() { + private Mono> getWithResponseAsync(String subscriptionId) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .get(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -114,6 +112,7 @@ private Mono> getWithResponseAsync() { * Get the billing properties for a subscription. This operation is not supported for billing accounts with * agreement type Enterprise Agreement. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -122,42 +121,41 @@ private Mono> getWithResponseAsync() { * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(Context context) { + private Mono> getWithResponseAsync(String subscriptionId, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context); + return service.get(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), accept, context); } /** * Get the billing properties for a subscription. This operation is not supported for billing accounts with * agreement type Enterprise Agreement. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the billing properties for a subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String subscriptionId) { + return getWithResponseAsync(subscriptionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get the billing properties for a subscription. This operation is not supported for billing accounts with * agreement type Enterprise Agreement. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -165,27 +163,30 @@ private Mono getAsync() { * @return the billing properties for a subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); + public Response getWithResponse(String subscriptionId, Context context) { + return getWithResponseAsync(subscriptionId, context).block(); } /** * Get the billing properties for a subscription. This operation is not supported for billing accounts with * agreement type Enterprise Agreement. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the billing properties for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingPropertyInner get() { - return getWithResponse(Context.NONE).getValue(); + public BillingPropertyInner get(String subscriptionId) { + return getWithResponse(subscriptionId, Context.NONE).getValue(); } /** * 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing property operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -193,25 +194,22 @@ public BillingPropertyInner get() { * @return a billing property along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(BillingPropertyInner parameters) { + private Mono> updateWithResponseAsync( + String subscriptionId, BillingPropertyInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -219,8 +217,8 @@ private Mono> updateWithResponseAsync(BillingProp service .update( this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, + subscriptionId, + this.client.getApiVersion(), parameters, accept, context)) @@ -231,6 +229,7 @@ private Mono> updateWithResponseAsync(BillingProp * 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing property operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -240,36 +239,33 @@ private Mono> updateWithResponseAsync(BillingProp */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - BillingPropertyInner parameters, Context context) { + String subscriptionId, BillingPropertyInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( - this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), parameters, accept, context); } /** * 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing property operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -277,14 +273,15 @@ private Mono> updateWithResponseAsync( * @return a billing property on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(BillingPropertyInner parameters) { - return updateWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono updateAsync(String subscriptionId, BillingPropertyInner parameters) { + return updateWithResponseAsync(subscriptionId, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing property operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -293,14 +290,16 @@ private Mono updateAsync(BillingPropertyInner parameters) * @return a billing property along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(BillingPropertyInner parameters, Context context) { - return updateWithResponseAsync(parameters, context).block(); + public Response updateWithResponse( + String subscriptionId, BillingPropertyInner parameters, Context context) { + return updateWithResponseAsync(subscriptionId, parameters, context).block(); } /** * 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing property operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -308,7 +307,7 @@ public Response updateWithResponse(BillingPropertyInner pa * @return a billing property. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingPropertyInner update(BillingPropertyInner parameters) { - return updateWithResponse(parameters, Context.NONE).getValue(); + public BillingPropertyInner update(String subscriptionId, BillingPropertyInner parameters) { + return updateWithResponse(subscriptionId, parameters, Context.NONE).getValue(); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesImpl.java index 9a48d10fc169a..04fb14fab9679 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesImpl.java @@ -26,8 +26,8 @@ public BillingPropertiesImpl( this.serviceManager = serviceManager; } - public Response getWithResponse(Context context) { - Response inner = this.serviceClient().getWithResponse(context); + public Response getWithResponse(String subscriptionId, Context context) { + Response inner = this.serviceClient().getWithResponse(subscriptionId, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -39,8 +39,8 @@ public Response getWithResponse(Context context) { } } - public BillingProperty get() { - BillingPropertyInner inner = this.serviceClient().get(); + public BillingProperty get(String subscriptionId) { + BillingPropertyInner inner = this.serviceClient().get(subscriptionId); if (inner != null) { return new BillingPropertyImpl(inner, this.manager()); } else { @@ -48,8 +48,10 @@ public BillingProperty get() { } } - public Response updateWithResponse(BillingPropertyInner parameters, Context context) { - Response inner = this.serviceClient().updateWithResponse(parameters, context); + public Response updateWithResponse( + String subscriptionId, BillingPropertyInner parameters, Context context) { + Response inner = + this.serviceClient().updateWithResponse(subscriptionId, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -61,8 +63,8 @@ public Response updateWithResponse(BillingPropertyInner paramet } } - public BillingProperty update(BillingPropertyInner parameters) { - BillingPropertyInner inner = this.serviceClient().update(parameters); + public BillingProperty update(String subscriptionId, BillingPropertyInner parameters) { + BillingPropertyInner inner = this.serviceClient().update(subscriptionId, parameters); if (inner != null) { return new BillingPropertyImpl(inner, this.manager()); } else { diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertyImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertyImpl.java index 2b7e9f77c294f..71efd47abd2d2 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertyImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertyImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; import com.azure.resourcemanager.billing.models.BillingProfileSpendingLimit; import com.azure.resourcemanager.billing.models.BillingProfileStatus; @@ -33,28 +34,32 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String accountAdminNotificationEmailAddress() { return this.innerModel().accountAdminNotificationEmailAddress(); } - public String billingTenantId() { - return this.innerModel().billingTenantId(); + public String billingAccountDisplayName() { + return this.innerModel().billingAccountDisplayName(); } public String billingAccountId() { return this.innerModel().billingAccountId(); } - public String billingAccountDisplayName() { - return this.innerModel().billingAccountDisplayName(); + public String billingProfileDisplayName() { + return this.innerModel().billingProfileDisplayName(); } public String billingProfileId() { return this.innerModel().billingProfileId(); } - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); + public BillingProfileSpendingLimit billingProfileSpendingLimit() { + return this.innerModel().billingProfileSpendingLimit(); } public BillingProfileStatus billingProfileStatus() { @@ -65,22 +70,22 @@ public BillingProfileStatusReasonCode billingProfileStatusReasonCode() { return this.innerModel().billingProfileStatusReasonCode(); } - public BillingProfileSpendingLimit billingProfileSpendingLimit() { - return this.innerModel().billingProfileSpendingLimit(); + public String billingTenantId() { + return this.innerModel().billingTenantId(); } public String costCenter() { return this.innerModel().costCenter(); } - public String invoiceSectionId() { - return this.innerModel().invoiceSectionId(); - } - public String invoiceSectionDisplayName() { return this.innerModel().invoiceSectionDisplayName(); } + public String invoiceSectionId() { + return this.innerModel().invoiceSectionId(); + } + public Boolean isAccountAdmin() { return this.innerModel().isAccountAdmin(); } @@ -93,14 +98,14 @@ public String productName() { return this.innerModel().productName(); } - public String skuId() { - return this.innerModel().skuId(); - } - public String skuDescription() { return this.innerModel().skuDescription(); } + public String skuId() { + return this.innerModel().skuId(); + } + public BillingPropertyInner innerModel() { return this.innerObject; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestImpl.java new file mode 100644 index 0000000000000..c04bd51e81686 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.billing.fluent.models.BillingRequestInner; +import com.azure.resourcemanager.billing.models.BillingRequest; +import com.azure.resourcemanager.billing.models.BillingRequestStatus; +import com.azure.resourcemanager.billing.models.BillingRequestType; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BillingRequestImpl implements BillingRequest { + private BillingRequestInner innerObject; + + private final com.azure.resourcemanager.billing.BillingManager serviceManager; + + BillingRequestImpl( + BillingRequestInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Map additionalInformation() { + Map inner = this.innerModel().additionalInformation(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String reviewedBy() { + return this.innerModel().reviewedBy(); + } + + public String reviewalDate() { + return this.innerModel().reviewalDate(); + } + + public String billingAccountId() { + return this.innerModel().billingAccountId(); + } + + public String billingAccountName() { + return this.innerModel().billingAccountName(); + } + + public String billingAccountDisplayName() { + return this.innerModel().billingAccountDisplayName(); + } + + public String billingAccountPrimaryBillingTenantId() { + return this.innerModel().billingAccountPrimaryBillingTenantId(); + } + + public String billingProfileId() { + return this.innerModel().billingProfileId(); + } + + public String billingProfileName() { + return this.innerModel().billingProfileName(); + } + + public String billingProfileDisplayName() { + return this.innerModel().billingProfileDisplayName(); + } + + public String createdBy() { + return this.innerModel().createdBy(); + } + + public String creationDate() { + return this.innerModel().creationDate(); + } + + public String expirationDate() { + return this.innerModel().expirationDate(); + } + + public String decisionReason() { + return this.innerModel().decisionReason(); + } + + public String invoiceSectionId() { + return this.innerModel().invoiceSectionId(); + } + + public String invoiceSectionName() { + return this.innerModel().invoiceSectionName(); + } + + public String invoiceSectionDisplayName() { + return this.innerModel().invoiceSectionDisplayName(); + } + + public String customerId() { + return this.innerModel().customerId(); + } + + public String customerName() { + return this.innerModel().customerName(); + } + + public String customerDisplayName() { + return this.innerModel().customerDisplayName(); + } + + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public String subscriptionName() { + return this.innerModel().subscriptionName(); + } + + public String subscriptionDisplayName() { + return this.innerModel().subscriptionDisplayName(); + } + + public String justification() { + return this.innerModel().justification(); + } + + public List recipients() { + List inner = this.innerModel().recipients(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String scope() { + return this.innerModel().scope(); + } + + public BillingRequestStatus status() { + return this.innerModel().status(); + } + + public BillingRequestType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String lastUpdatedBy() { + return this.innerModel().lastUpdatedBy(); + } + + public String lastUpdatedDate() { + return this.innerModel().lastUpdatedDate(); + } + + public BillingRequestInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.billing.BillingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestsClientImpl.java new file mode 100644 index 0000000000000..98c8196bb6dfb --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestsClientImpl.java @@ -0,0 +1,1163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.billing.fluent.BillingRequestsClient; +import com.azure.resourcemanager.billing.fluent.models.BillingRequestInner; +import com.azure.resourcemanager.billing.models.BillingRequestListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BillingRequestsClient. */ +public final class BillingRequestsClientImpl implements BillingRequestsClient { + /** The proxy service used to perform REST calls. */ + private final BillingRequestsService service; + + /** The service client containing this operation class. */ + private final BillingManagementClientImpl client; + + /** + * Initializes an instance of BillingRequestsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BillingRequestsClientImpl(BillingManagementClientImpl client) { + this.service = + RestProxy.create(BillingRequestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BillingManagementClientBillingRequests to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BillingManagementCli") + public interface BillingRequestsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRequests") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccount( + @HostParam("$host") String endpoint, + @PathParam("billingAccountName") String billingAccountName, + @QueryParam("api-version") String apiVersion, + @QueryParam("filter") String filter, + @QueryParam("orderBy") String orderBy, + @QueryParam("top") Long top, + @QueryParam("skip") Long skip, + @QueryParam("count") Boolean count, + @QueryParam("search") String search, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingRequests") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByUser( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @QueryParam("filter") String filter, + @QueryParam("orderBy") String orderBy, + @QueryParam("top") Long top, + @QueryParam("skip") Long skip, + @QueryParam("count") Boolean count, + @QueryParam("search") String search, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingRequests/{billingRequestName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("billingRequestName") String billingRequestName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/providers/Microsoft.Billing/billingRequests/{billingRequestName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("billingRequestName") String billingRequestName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BillingRequestInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByUserNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, String filter, String orderBy, Long top, Long skip, Boolean count, String search) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByBillingAccount( + this.client.getEndpoint(), + billingAccountName, + this.client.getApiVersion(), + filter, + orderBy, + top, + skip, + count, + search, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingAccount( + this.client.getEndpoint(), + billingAccountName, + this.client.getApiVersion(), + filter, + orderBy, + top, + skip, + count, + search, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync( + String billingAccountName, String filter, String orderBy, Long top, Long skip, Boolean count, String search) { + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountName, filter, orderBy, top, skip, count, search), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountName) { + final String filter = null; + final String orderBy = null; + final Long top = null; + final Long skip = null; + final Boolean count = null; + final String search = null; + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountName, filter, orderBy, top, skip, count, search), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync( + String billingAccountName, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context) { + return new PagedFlux<>( + () -> + listByBillingAccountSinglePageAsync( + billingAccountName, filter, orderBy, top, skip, count, search, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount(String billingAccountName) { + final String filter = null; + final String orderBy = null; + final Long top = null; + final Long skip = null; + final Boolean count = null; + final String search = null; + return new PagedIterable<>( + listByBillingAccountAsync(billingAccountName, filter, orderBy, top, skip, count, search)); + } + + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount( + String billingAccountName, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context) { + return new PagedIterable<>( + listByBillingAccountAsync(billingAccountName, filter, orderBy, top, skip, count, search, context)); + } + + /** + * The list of billing requests submitted by a user. + * + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserSinglePageAsync( + String filter, String orderBy, Long top, Long skip, Boolean count, String search) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByUser( + this.client.getEndpoint(), + this.client.getApiVersion(), + filter, + orderBy, + top, + skip, + count, + search, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The list of billing requests submitted by a user. + * + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserSinglePageAsync( + String filter, String orderBy, Long top, Long skip, Boolean count, String search, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByUser( + this.client.getEndpoint(), + this.client.getApiVersion(), + filter, + orderBy, + top, + skip, + count, + search, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The list of billing requests submitted by a user. + * + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByUserAsync( + String filter, String orderBy, Long top, Long skip, Boolean count, String search) { + return new PagedFlux<>( + () -> listByUserSinglePageAsync(filter, orderBy, top, skip, count, search), + nextLink -> listByUserNextSinglePageAsync(nextLink)); + } + + /** + * The list of billing requests submitted by a user. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByUserAsync() { + final String filter = null; + final String orderBy = null; + final Long top = null; + final Long skip = null; + final Boolean count = null; + final String search = null; + return new PagedFlux<>( + () -> listByUserSinglePageAsync(filter, orderBy, top, skip, count, search), + nextLink -> listByUserNextSinglePageAsync(nextLink)); + } + + /** + * The list of billing requests submitted by a user. + * + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByUserAsync( + String filter, String orderBy, Long top, Long skip, Boolean count, String search, Context context) { + return new PagedFlux<>( + () -> listByUserSinglePageAsync(filter, orderBy, top, skip, count, search, context), + nextLink -> listByUserNextSinglePageAsync(nextLink, context)); + } + + /** + * The list of billing requests submitted by a user. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByUser() { + final String filter = null; + final String orderBy = null; + final Long top = null; + final Long skip = null; + final Boolean count = null; + final String search = null; + return new PagedIterable<>(listByUserAsync(filter, orderBy, top, skip, count, search)); + } + + /** + * The list of billing requests submitted by a user. + * + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByUser( + String filter, String orderBy, Long top, Long skip, Boolean count, String search, Context context) { + return new PagedIterable<>(listByUserAsync(filter, orderBy, top, skip, count, search, context)); + } + + /** + * Gets a billing request by its ID. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request by its ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String billingRequestName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingRequestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingRequestName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + billingRequestName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a billing request by its ID. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request by its ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String billingRequestName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingRequestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingRequestName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), billingRequestName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets a billing request by its ID. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request by its ID on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String billingRequestName) { + return getWithResponseAsync(billingRequestName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a billing request by its ID. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request by its ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String billingRequestName, Context context) { + return getWithResponseAsync(billingRequestName, context).block(); + } + + /** + * Gets a billing request by its ID. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request by its ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingRequestInner get(String billingRequestName) { + return getWithResponse(billingRequestName, Context.NONE).getValue(); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String billingRequestName, BillingRequestInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingRequestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingRequestName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + billingRequestName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String billingRequestName, BillingRequestInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingRequestName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingRequestName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), billingRequestName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a billing request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BillingRequestInner> beginCreateOrUpdateAsync( + String billingRequestName, BillingRequestInner body) { + Mono>> mono = createOrUpdateWithResponseAsync(billingRequestName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BillingRequestInner.class, + BillingRequestInner.class, + this.client.getContext()); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a billing request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BillingRequestInner> beginCreateOrUpdateAsync( + String billingRequestName) { + final BillingRequestInner body = null; + Mono>> mono = createOrUpdateWithResponseAsync(billingRequestName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BillingRequestInner.class, + BillingRequestInner.class, + this.client.getContext()); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a billing request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BillingRequestInner> beginCreateOrUpdateAsync( + String billingRequestName, BillingRequestInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(billingRequestName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BillingRequestInner.class, BillingRequestInner.class, context); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a billing request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BillingRequestInner> beginCreateOrUpdate( + String billingRequestName) { + final BillingRequestInner body = null; + return this.beginCreateOrUpdateAsync(billingRequestName, body).getSyncPoller(); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a billing request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BillingRequestInner> beginCreateOrUpdate( + String billingRequestName, BillingRequestInner body, Context context) { + return this.beginCreateOrUpdateAsync(billingRequestName, body, context).getSyncPoller(); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String billingRequestName, BillingRequestInner body) { + return beginCreateOrUpdateAsync(billingRequestName, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String billingRequestName) { + final BillingRequestInner body = null; + return beginCreateOrUpdateAsync(billingRequestName, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String billingRequestName, BillingRequestInner body, Context context) { + return beginCreateOrUpdateAsync(billingRequestName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingRequestInner createOrUpdate(String billingRequestName) { + final BillingRequestInner body = null; + return createOrUpdateAsync(billingRequestName, body).block(); + } + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingRequestInner createOrUpdate(String billingRequestName, BillingRequestInner body, Context context) { + return createOrUpdateAsync(billingRequestName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByUserNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByUserNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestsImpl.java new file mode 100644 index 0000000000000..40520e383512b --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRequestsImpl.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.billing.fluent.BillingRequestsClient; +import com.azure.resourcemanager.billing.fluent.models.BillingRequestInner; +import com.azure.resourcemanager.billing.models.BillingRequest; +import com.azure.resourcemanager.billing.models.BillingRequests; + +public final class BillingRequestsImpl implements BillingRequests { + private static final ClientLogger LOGGER = new ClientLogger(BillingRequestsImpl.class); + + private final BillingRequestsClient innerClient; + + private final com.azure.resourcemanager.billing.BillingManager serviceManager; + + public BillingRequestsImpl( + BillingRequestsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByBillingAccount(String billingAccountName) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); + return Utils.mapPage(inner, inner1 -> new BillingRequestImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount( + String billingAccountName, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByBillingAccount(billingAccountName, filter, orderBy, top, skip, count, search, context); + return Utils.mapPage(inner, inner1 -> new BillingRequestImpl(inner1, this.manager())); + } + + public PagedIterable listByUser() { + PagedIterable inner = this.serviceClient().listByUser(); + return Utils.mapPage(inner, inner1 -> new BillingRequestImpl(inner1, this.manager())); + } + + public PagedIterable listByUser( + String filter, String orderBy, Long top, Long skip, Boolean count, String search, Context context) { + PagedIterable inner = + this.serviceClient().listByUser(filter, orderBy, top, skip, count, search, context); + return Utils.mapPage(inner, inner1 -> new BillingRequestImpl(inner1, this.manager())); + } + + public Response getWithResponse(String billingRequestName, Context context) { + Response inner = this.serviceClient().getWithResponse(billingRequestName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BillingRequestImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BillingRequest get(String billingRequestName) { + BillingRequestInner inner = this.serviceClient().get(billingRequestName); + if (inner != null) { + return new BillingRequestImpl(inner, this.manager()); + } else { + return null; + } + } + + public BillingRequest createOrUpdate(String billingRequestName) { + BillingRequestInner inner = this.serviceClient().createOrUpdate(billingRequestName); + if (inner != null) { + return new BillingRequestImpl(inner, this.manager()); + } else { + return null; + } + } + + public BillingRequest createOrUpdate(String billingRequestName, BillingRequestInner body, Context context) { + BillingRequestInner inner = this.serviceClient().createOrUpdate(billingRequestName, body, context); + if (inner != null) { + return new BillingRequestImpl(inner, this.manager()); + } else { + return null; + } + } + + private BillingRequestsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.billing.BillingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentImpl.java index ad7683a97484e..53b1f02da4020 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; import com.azure.resourcemanager.billing.models.BillingRoleAssignment; @@ -30,22 +31,26 @@ public String type() { return this.innerModel().type(); } - public String createdOn() { - return this.innerModel().createdOn(); - } - - public String createdByPrincipalTenantId() { - return this.innerModel().createdByPrincipalTenantId(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String createdByPrincipalId() { return this.innerModel().createdByPrincipalId(); } + public String createdByPrincipalTenantId() { + return this.innerModel().createdByPrincipalTenantId(); + } + public String createdByUserEmailAddress() { return this.innerModel().createdByUserEmailAddress(); } + public String createdOn() { + return this.innerModel().createdOn(); + } + public String principalId() { return this.innerModel().principalId(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java index f7fda1ead39c7..30e0a2f0c46ab 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java @@ -60,90 +60,85 @@ public final class BillingRoleAssignmentsClientImpl implements BillingRoleAssign public interface BillingRoleAssignmentsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments" - + "/{billingRoleAssignmentName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingAccount( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, + @PathParam("billingProfileName") String billingProfileName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments" - + "/{billingRoleAssignmentName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByBillingAccount( + Mono> deleteByBillingProfile( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByInvoiceSection( + Mono> getByBillingProfile( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByInvoiceSection( + Mono> listByInvoiceSection( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, @PathParam("invoiceSectionName") String invoiceSectionName, - @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleAssignments/{billingRoleAssignmentName}") + @Delete( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingProfile( + Mono> deleteByInvoiceSection( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, + @PathParam("invoiceSectionName") String invoiceSectionName, @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleAssignments/{billingRoleAssignmentName}") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByBillingProfile( + Mono> getByInvoiceSection( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, + @PathParam("invoiceSectionName") String invoiceSectionName, @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, @HeaderParam("Accept") String accept, Context context); @@ -160,31 +155,28 @@ Mono> listByBillingAccount( Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleAssignments") + @Delete( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSection( + Mono> deleteByBillingAccount( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, + @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleAssignments") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( + Mono> getByBillingAccount( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, + @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, @HeaderParam("Accept") String accept, Context context); @@ -192,7 +184,7 @@ Mono> listByBillingProfile( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( + Mono> listByBillingProfileNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -212,7 +204,7 @@ Mono> listByInvoiceSectionNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( + Mono> listByBillingAccountNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -220,20 +212,19 @@ Mono> listByBillingProfileNext( } /** - * 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 billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account along with {@link Response} on successful - * completion of {@link Mono}. + * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleAssignmentName) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -244,44 +235,49 @@ private Mono> getByBillingAccountWithRespon return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingRoleAssignmentName == null) { + if (billingProfileName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .getByBillingAccount( + .listByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingRoleAssignmentName, + billingProfileName, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account along with {@link Response} on successful - * completion of {@link Mono}. + * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleAssignmentName, Context context) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -292,77 +288,111 @@ private Mono> getByBillingAccountWithRespon return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingRoleAssignmentName == null) { + if (billingProfileName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, billingRoleAssignmentName, accept, context); + .listByBillingProfile( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingProfileName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * 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 billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account on successful completion of {@link Mono}. + * @return the list of role assignments as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingAccountAsync( - String billingAccountName, String billingRoleAssignmentName) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * 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 billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account along with {@link Response}. + * @return the list of role assignments as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName, Context context) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * 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 billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner getByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { - return getByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); } /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts + * Lists the role assignments for the caller on a billing profile. 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of role assignments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); + } + + /** + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -370,8 +400,8 @@ public BillingRoleAssignmentInner getByBillingAccount(String billingAccountName, * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleAssignmentName) { + private Mono> deleteByBillingProfileWithResponseAsync( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -382,22 +412,26 @@ private Mono> deleteByBillingAccountWithRes return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } if (billingRoleAssignmentName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .deleteByBillingAccount( + .deleteByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, + billingProfileName, billingRoleAssignmentName, accept, context)) @@ -405,10 +439,11 @@ private Mono> deleteByBillingAccountWithRes } /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts + * 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. * * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -417,8 +452,8 @@ private Mono> deleteByBillingAccountWithRes * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleAssignmentName, Context context) { + private Mono> deleteByBillingProfileWithResponseAsync( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -429,25 +464,35 @@ private Mono> deleteByBillingAccountWithRes return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } if (billingRoleAssignmentName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .deleteByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, billingRoleAssignmentName, accept, context); + .deleteByBillingProfile( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingProfileName, + billingRoleAssignmentName, + accept, + context); } /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -455,17 +500,19 @@ private Mono> deleteByBillingAccountWithRes * @return the role assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByBillingAccountAsync( - String billingAccountName, String billingRoleAssignmentName) { - return deleteByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName) + private Mono deleteByBillingProfileAsync( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + return deleteByBillingProfileWithResponseAsync( + billingAccountName, billingProfileName, billingRoleAssignmentName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts + * 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. * * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -474,16 +521,19 @@ private Mono deleteByBillingAccountAsync( * @return the role assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { - return deleteByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName, context).block(); + public Response deleteByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { + return deleteByBillingProfileWithResponseAsync( + billingAccountName, billingProfileName, billingRoleAssignmentName, context) + .block(); } /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -491,32 +541,29 @@ public Response deleteByBillingAccountWithResponse( * @return the role assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner deleteByBillingAccount( - String billingAccountName, String billingRoleAssignmentName) { - return deleteByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, Context.NONE) + public BillingRoleAssignmentInner deleteByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + return deleteByBillingProfileWithResponse( + billingAccountName, billingProfileName, billingRoleAssignmentName, Context.NONE) .getValue(); } /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section along with {@link Response} on successful + * @return a role assignment for the caller on a billing profile along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { + private Mono> getByBillingProfileWithResponseAsync( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -531,28 +578,22 @@ private Mono> getByInvoiceSectionWithRespon return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } if (billingRoleAssignmentName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .getByInvoiceSection( + .getByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, - invoiceSectionName, billingRoleAssignmentName, accept, context)) @@ -560,27 +601,22 @@ private Mono> getByInvoiceSectionWithRespon } /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section along with {@link Response} on successful + * @return a role assignment for the caller on a billing profile along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { + private Mono> getByBillingProfileWithResponseAsync( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -595,124 +631,100 @@ private Mono> getByInvoiceSectionWithRespon return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } if (billingRoleAssignmentName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByInvoiceSection( + .getByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, - invoiceSectionName, billingRoleAssignmentName, accept, context); } /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section on successful completion of {@link Mono}. + * @return a role assignment for the caller on a billing profile on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) + private Mono getByBillingProfileAsync( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section along with {@link Response}. + * @return a role assignment for the caller on a billing profile along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context) + public Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { + return getByBillingProfileWithResponseAsync( + billingAccountName, billingProfileName, billingRoleAssignmentName, context) .block(); } /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. + * @return a role assignment for the caller on a billing profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return getByInvoiceSectionWithResponse( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, Context.NONE) + public BillingRoleAssignmentInner getByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + return getByBillingProfileWithResponse( + billingAccountName, billingProfileName, billingRoleAssignmentName, Context.NONE) .getValue(); } /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { + private Mono> listByInvoiceSectionSinglePageAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -731,51 +743,47 @@ private Mono> deleteByInvoiceSectionWithRes return Mono .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .deleteByInvoiceSection( + .listByInvoiceSection( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, invoiceSectionName, - billingRoleAssignmentName, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { + private Mono> listByInvoiceSectionSinglePageAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -794,117 +802,129 @@ private Mono> deleteByInvoiceSectionWithRes return Mono .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .deleteByInvoiceSection( + .listByInvoiceSection( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, invoiceSectionName, - billingRoleAssignmentName, accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment on successful completion of {@link Mono}. + * @return the list of role assignments as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return deleteByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByInvoiceSectionAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName) { + return new PagedFlux<>( + () -> listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), + nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); } /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response}. + * @return the list of role assignments as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { - return deleteByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByInvoiceSectionAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + return new PagedFlux<>( + () -> + listByInvoiceSectionSinglePageAsync( + billingAccountName, billingProfileName, invoiceSectionName, context), + nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); } /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner deleteByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return deleteByInvoiceSectionWithResponse( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName) { + return new PagedIterable<>( + listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName)); } /** - * 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. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of role assignments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + return new PagedIterable<>( + listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); + } + + /** + * Deletes 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile along with {@link Response} on successful - * completion of {@link Mono}. + * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + private Mono> deleteByInvoiceSectionWithResponseAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -919,23 +939,27 @@ private Mono> getByBillingProfileWithRespon return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + } if (billingRoleAssignmentName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .getByBillingProfile( + .deleteByInvoiceSection( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, + invoiceSectionName, billingRoleAssignmentName, accept, context)) @@ -943,22 +967,26 @@ private Mono> getByBillingProfileWithRespon } /** - * 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. + * Deletes 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile along with {@link Response} on successful - * completion of {@link Mono}. + * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { + private Mono> deleteByInvoiceSectionWithResponseAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -973,101 +1001,124 @@ private Mono> getByBillingProfileWithRespon return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + } if (billingRoleAssignmentName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByBillingProfile( + .deleteByInvoiceSection( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, + invoiceSectionName, billingRoleAssignmentName, accept, context); } /** - * 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. + * Deletes 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile on successful completion of {@link Mono}. + * @return the role assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingProfileAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName) + private Mono deleteByInvoiceSectionAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName) { + return deleteByInvoiceSectionWithResponseAsync( + billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * 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. + * Deletes 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile along with {@link Response}. + * @return the role assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - return getByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, billingRoleAssignmentName, context) + public Response deleteByInvoiceSectionWithResponse( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName, + Context context) { + return deleteByInvoiceSectionWithResponseAsync( + billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context) .block(); } /** - * 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. + * Deletes 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. + * @return the role assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return getByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleAssignmentName, Context.NONE) + public BillingRoleAssignmentInner deleteByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName) { + return deleteByInvoiceSectionWithResponse( + billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, Context.NONE) .getValue(); } /** - * 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. + * 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. + * @return a role assignment for the caller on an invoice section along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + private Mono> getByInvoiceSectionWithResponseAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1082,23 +1133,27 @@ private Mono> deleteByBillingProfileWithRes return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + } if (billingRoleAssignmentName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .deleteByBillingProfile( + .getByInvoiceSection( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, + invoiceSectionName, billingRoleAssignmentName, accept, context)) @@ -1106,21 +1161,27 @@ private Mono> deleteByBillingProfileWithRes } /** - * 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. + * 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. + * @return a role assignment for the caller on an invoice section along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { + private Mono> getByInvoiceSectionWithResponseAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1135,84 +1196,101 @@ private Mono> deleteByBillingProfileWithRes return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + } if (billingRoleAssignmentName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .deleteByBillingProfile( + .getByInvoiceSection( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, + invoiceSectionName, billingRoleAssignmentName, accept, context); } /** - * 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. + * 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment on successful completion of {@link Mono}. + * @return a role assignment for the caller on an invoice section on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByBillingProfileAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return deleteByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, billingRoleAssignmentName) + private Mono getByInvoiceSectionAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName) { + return getByInvoiceSectionWithResponseAsync( + billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * 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. + * 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response}. + * @return a role assignment for the caller on an invoice section along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - return deleteByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, billingRoleAssignmentName, context) + public Response getByInvoiceSectionWithResponse( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName, + Context context) { + return getByInvoiceSectionWithResponseAsync( + billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context) .block(); } /** - * 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. + * 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. + * @return a role assignment for the caller on an invoice section. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner deleteByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return deleteByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleAssignmentName, Context.NONE) + public BillingRoleAssignmentInner getByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName) { + return getByInvoiceSectionWithResponse( + billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, Context.NONE) .getValue(); } @@ -1239,14 +1317,17 @@ private Mono> listByBillingAccountSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context)) + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -1283,11 +1364,11 @@ private Mono> listByBillingAccountSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, accept, context) + .listByBillingAccount( + this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, accept, context) .map( res -> new PagedResponseBase<>( @@ -1367,20 +1448,19 @@ public PagedIterable listByBillingAccount(String bil } /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { + private Mono> deleteByBillingAccountWithResponseAsync( + String billingAccountName, String billingRoleAssignmentName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1391,56 +1471,42 @@ private Mono> listByInvoiceSectionSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { + if (billingRoleAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByInvoiceSection( + .deleteByBillingAccount( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, - invoiceSectionName, + billingRoleAssignmentName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the role assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + private Mono> deleteByBillingAccountWithResponseAsync( + String billingAccountName, String billingRoleAssignmentName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1449,135 +1515,95 @@ private Mono> listByInvoiceSectionSing } if (billingAccountName == null) { return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (invoiceSectionName == null) { + if (billingRoleAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByInvoiceSection( + .deleteByBillingAccount( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, - invoiceSectionName, + billingRoleAssignmentName, accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedFlux}. + * @return the role assignment on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedFlux<>( - () -> listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteByBillingAccountAsync( + String billingAccountName, String billingRoleAssignmentName) { + return deleteByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync( - billingAccountName, billingProfileName, invoiceSectionName, context), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); - } - - /** - * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return the role assignment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteByBillingAccountWithResponse( + String billingAccountName, String billingRoleAssignmentName, Context context) { + return deleteByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName, context).block(); } /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return the role assignment. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingRoleAssignmentInner deleteByBillingAccount( + String billingAccountName, String billingRoleAssignmentName) { + return deleteByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, Context.NONE) + .getValue(); } /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a role assignment for the caller on a billing account along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { + private Mono> getByBillingAccountWithResponseAsync( + String billingAccountName, String billingRoleAssignmentName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1588,50 +1614,43 @@ private Mono> listByBillingProfileSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { + if (billingRoleAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingProfile( + .getByBillingAccount( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, + billingRoleAssignmentName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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. * * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a role assignment for the caller on a billing account along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { + private Mono> getByBillingAccountWithResponseAsync( + String billingAccountName, String billingRoleAssignmentName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1642,99 +1661,74 @@ private Mono> listByBillingProfileSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { + if (billingRoleAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter billingRoleAssignmentName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfile( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .getByBillingAccount( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingRoleAssignmentName, + accept, + context); } /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedFlux}. + * @return a role assignment for the caller on a billing account on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByBillingAccountAsync( + String billingAccountName, String billingRoleAssignmentName) { + return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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. * * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the role assignments for the caller on a billing profile. 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return a role assignment for the caller on a billing account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByBillingAccountWithResponse( + String billingAccountName, String billingRoleAssignmentName, Context context) { + return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName, context).block(); } /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return a role assignment for the caller on a billing account. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingRoleAssignmentInner getByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { + return getByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, Context.NONE).getValue(); } /** @@ -1748,7 +1742,7 @@ public PagedIterable listByBillingProfile( * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1761,7 +1755,7 @@ private Mono> listByBillingAccountNext final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1786,7 +1780,7 @@ private Mono> listByBillingAccountNext * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( + private Mono> listByBillingProfileNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1800,7 +1794,7 @@ private Mono> listByBillingAccountNext final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1898,7 +1892,7 @@ private Mono> listByInvoiceSectionNext * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1911,7 +1905,7 @@ private Mono> listByBillingProfileNext final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1936,7 +1930,7 @@ private Mono> listByBillingProfileNext * @return the list of role assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( + private Mono> listByBillingAccountNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1950,7 +1944,7 @@ private Mono> listByBillingProfileNext final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsImpl.java index 3e30ab4e79e71..c9ff95db61acb 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsImpl.java @@ -27,12 +27,27 @@ public BillingRoleAssignmentsImpl( this.serviceManager = serviceManager; } - public Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); + return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); + return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); + } + + public Response deleteByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { Response inner = this .serviceClient() - .getByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, context); + .deleteByBillingProfileWithResponse( + billingAccountName, billingProfileName, billingRoleAssignmentName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -44,9 +59,12 @@ public Response getByBillingAccountWithResponse( } } - public BillingRoleAssignment getByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { + public BillingRoleAssignment deleteByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { BillingRoleAssignmentInner inner = - this.serviceClient().getByBillingAccount(billingAccountName, billingRoleAssignmentName); + this + .serviceClient() + .deleteByBillingProfile(billingAccountName, billingProfileName, billingRoleAssignmentName); if (inner != null) { return new BillingRoleAssignmentImpl(inner, this.manager()); } else { @@ -54,12 +72,13 @@ public BillingRoleAssignment getByBillingAccount(String billingAccountName, Stri } } - public Response deleteByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { + public Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { Response inner = this .serviceClient() - .deleteByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, context); + .getByBillingProfileWithResponse( + billingAccountName, billingProfileName, billingRoleAssignmentName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -71,9 +90,10 @@ public Response deleteByBillingAccountWithResponse( } } - public BillingRoleAssignment deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { + public BillingRoleAssignment getByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { BillingRoleAssignmentInner inner = - this.serviceClient().deleteByBillingAccount(billingAccountName, billingRoleAssignmentName); + this.serviceClient().getByBillingProfile(billingAccountName, billingProfileName, billingRoleAssignmentName); if (inner != null) { return new BillingRoleAssignmentImpl(inner, this.manager()); } else { @@ -81,7 +101,23 @@ public BillingRoleAssignment deleteByBillingAccount(String billingAccountName, S } } - public Response getByInvoiceSectionWithResponse( + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName) { + PagedIterable inner = + this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); + return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, context); + return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); + } + + public Response deleteByInvoiceSectionWithResponse( String billingAccountName, String billingProfileName, String invoiceSectionName, @@ -90,7 +126,7 @@ public Response getByInvoiceSectionWithResponse( Response inner = this .serviceClient() - .getByInvoiceSectionWithResponse( + .deleteByInvoiceSectionWithResponse( billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context); if (inner != null) { return new SimpleResponse<>( @@ -103,7 +139,7 @@ public Response getByInvoiceSectionWithResponse( } } - public BillingRoleAssignment getByInvoiceSection( + public BillingRoleAssignment deleteByInvoiceSection( String billingAccountName, String billingProfileName, String invoiceSectionName, @@ -111,7 +147,7 @@ public BillingRoleAssignment getByInvoiceSection( BillingRoleAssignmentInner inner = this .serviceClient() - .getByInvoiceSection( + .deleteByInvoiceSection( billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName); if (inner != null) { return new BillingRoleAssignmentImpl(inner, this.manager()); @@ -120,7 +156,7 @@ public BillingRoleAssignment getByInvoiceSection( } } - public Response deleteByInvoiceSectionWithResponse( + public Response getByInvoiceSectionWithResponse( String billingAccountName, String billingProfileName, String invoiceSectionName, @@ -129,7 +165,7 @@ public Response deleteByInvoiceSectionWithResponse( Response inner = this .serviceClient() - .deleteByInvoiceSectionWithResponse( + .getByInvoiceSectionWithResponse( billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context); if (inner != null) { return new SimpleResponse<>( @@ -142,7 +178,7 @@ public Response deleteByInvoiceSectionWithResponse( } } - public BillingRoleAssignment deleteByInvoiceSection( + public BillingRoleAssignment getByInvoiceSection( String billingAccountName, String billingProfileName, String invoiceSectionName, @@ -150,7 +186,7 @@ public BillingRoleAssignment deleteByInvoiceSection( BillingRoleAssignmentInner inner = this .serviceClient() - .deleteByInvoiceSection( + .getByInvoiceSection( billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName); if (inner != null) { return new BillingRoleAssignmentImpl(inner, this.manager()); @@ -159,13 +195,23 @@ public BillingRoleAssignment deleteByInvoiceSection( } } - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { + public PagedIterable listByBillingAccount(String billingAccountName) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); + return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountName, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountName, context); + return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); + } + + public Response deleteByBillingAccountWithResponse( + String billingAccountName, String billingRoleAssignmentName, Context context) { Response inner = this .serviceClient() - .getByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleAssignmentName, context); + .deleteByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -177,10 +223,9 @@ public Response getByBillingProfileWithResponse( } } - public BillingRoleAssignment getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + public BillingRoleAssignment deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { BillingRoleAssignmentInner inner = - this.serviceClient().getByBillingProfile(billingAccountName, billingProfileName, billingRoleAssignmentName); + this.serviceClient().deleteByBillingAccount(billingAccountName, billingRoleAssignmentName); if (inner != null) { return new BillingRoleAssignmentImpl(inner, this.manager()); } else { @@ -188,13 +233,12 @@ public BillingRoleAssignment getByBillingProfile( } } - public Response deleteByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { + public Response getByBillingAccountWithResponse( + String billingAccountName, String billingRoleAssignmentName, Context context) { Response inner = this .serviceClient() - .deleteByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleAssignmentName, context); + .getByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -206,12 +250,9 @@ public Response deleteByBillingProfileWithResponse( } } - public BillingRoleAssignment deleteByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { + public BillingRoleAssignment getByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { BillingRoleAssignmentInner inner = - this - .serviceClient() - .deleteByBillingProfile(billingAccountName, billingProfileName, billingRoleAssignmentName); + this.serviceClient().getByBillingAccount(billingAccountName, billingRoleAssignmentName); if (inner != null) { return new BillingRoleAssignmentImpl(inner, this.manager()); } else { @@ -219,47 +260,6 @@ public BillingRoleAssignment deleteByBillingProfile( } } - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - PagedIterable inner = - this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - private BillingRoleAssignmentsClient serviceClient() { return this.innerClient; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionImpl.java index 76faed4c2ee18..b0fff8af63524 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; @@ -35,6 +36,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String description() { return this.innerModel().description(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java index 710bb76bafa21..0de11ca1a4c9d 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java @@ -59,86 +59,81 @@ public final class BillingRoleDefinitionsClientImpl implements BillingRoleDefini public interface BillingRoleDefinitionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions" - + "/{billingRoleDefinitionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingAccount( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingRoleDefinitionName") String billingRoleDefinitionName, + @PathParam("billingProfileName") String billingProfileName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByInvoiceSection( + Mono> getByBillingProfile( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, @PathParam("billingRoleDefinitionName") String billingRoleDefinitionName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleDefinitions/{billingRoleDefinitionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingProfile( + Mono> listByInvoiceSection( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, - @PathParam("billingRoleDefinitionName") String billingRoleDefinitionName, + @PathParam("invoiceSectionName") String invoiceSectionName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( + Mono> getByInvoiceSection( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, + @PathParam("invoiceSectionName") String invoiceSectionName, + @PathParam("billingRoleDefinitionName") String billingRoleDefinitionName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleDefinitions") + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSection( + Mono> listByBillingAccount( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleDefinitions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( + Mono> getByBillingAccount( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, + @PathParam("billingRoleDefinitionName") String billingRoleDefinitionName, @HeaderParam("Accept") String accept, Context context); @@ -146,7 +141,7 @@ Mono> listByBillingProfile( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( + Mono> listByBillingProfileNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -166,7 +161,7 @@ Mono> listByInvoiceSectionNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( + Mono> listByBillingAccountNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -174,20 +169,19 @@ Mono> listByBillingProfileNext( } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account along with {@link Response} on successful completion of - * {@link Mono}. + * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleDefinitionName) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -198,44 +192,49 @@ private Mono> getByBillingAccountWithRespon return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingRoleDefinitionName == null) { + if (billingProfileName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .getByBillingAccount( + .listByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingRoleDefinitionName, + billingProfileName, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account along with {@link Response} on successful completion of - * {@link Mono}. + * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleDefinitionName, Context context) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -246,92 +245,121 @@ private Mono> getByBillingAccountWithRespon return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingRoleDefinitionName == null) { + if (billingProfileName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, billingRoleDefinitionName, accept, context); + .listByBillingProfile( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingProfileName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account on successful completion of {@link Mono}. + * @return the list of role definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingAccountAsync( - String billingAccountName, String billingRoleDefinitionName) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleDefinitionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account along with {@link Response}. + * @return the list of role definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, Context context) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleDefinitionName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName, Context context) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. + * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleDefinitionInner getByBillingAccount(String billingAccountName, String billingRoleDefinitionName) { - return getByBillingAccountWithResponse(billingAccountName, billingRoleDefinitionName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); } /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of role definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); + } + + /** + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section along with {@link Response} on successful completion of + * @return the definition for a role on a billing profile along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName) { + private Mono> getByBillingProfileWithResponseAsync( + String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -346,28 +374,22 @@ private Mono> getByInvoiceSectionWithRespon return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } if (billingRoleDefinitionName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleDefinitionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .getByInvoiceSection( + .getByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, - invoiceSectionName, billingRoleDefinitionName, accept, context)) @@ -375,27 +397,22 @@ private Mono> getByInvoiceSectionWithRespon } /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section along with {@link Response} on successful completion of + * @return the definition for a role on a billing profile along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName, - Context context) { + private Mono> getByBillingProfileWithResponseAsync( + String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -410,121 +427,100 @@ private Mono> getByInvoiceSectionWithRespon return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } if (billingRoleDefinitionName == null) { return Mono .error( new IllegalArgumentException( "Parameter billingRoleDefinitionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByInvoiceSection( + .getByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, - invoiceSectionName, billingRoleDefinitionName, accept, context); } /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section on successful completion of {@link Mono}. + * @return the definition for a role on a billing profile on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName) + private Mono getByBillingProfileAsync( + String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { + return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, billingRoleDefinitionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section along with {@link Response}. + * @return the definition for a role on a billing profile along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName, - Context context) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, context) + public Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { + return getByBillingProfileWithResponseAsync( + billingAccountName, billingProfileName, billingRoleDefinitionName, context) .block(); } /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. + * @return the definition for a role on a billing profile. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleDefinitionInner getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName) { - return getByInvoiceSectionWithResponse( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, Context.NONE) + public BillingRoleDefinitionInner getByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { + return getByBillingProfileWithResponse( + billingAccountName, billingProfileName, billingRoleDefinitionName, Context.NONE) .getValue(); } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile along with {@link Response} on successful completion of - * {@link Mono}. + * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { + private Mono> listByInvoiceSectionSinglePageAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -539,46 +535,51 @@ private Mono> getByBillingProfileWithRespon return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - if (billingRoleDefinitionName == null) { + if (invoiceSectionName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .getByBillingProfile( + .listByInvoiceSection( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, - billingRoleDefinitionName, + invoiceSectionName, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile along with {@link Response} on successful completion of - * {@link Mono}. + * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { + private Mono> listByInvoiceSectionSinglePageAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -593,99 +594,134 @@ private Mono> getByBillingProfileWithRespon return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - if (billingRoleDefinitionName == null) { + if (invoiceSectionName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByBillingProfile( + .listByInvoiceSection( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, - billingRoleDefinitionName, + invoiceSectionName, accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile on successful completion of {@link Mono}. + * @return the list of role definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingProfileAsync( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, billingRoleDefinitionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByInvoiceSectionAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName) { + return new PagedFlux<>( + () -> listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), + nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile along with {@link Response}. + * @return the list of role definitions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { - return getByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, billingRoleDefinitionName, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByInvoiceSectionAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + return new PagedFlux<>( + () -> + listByInvoiceSectionSinglePageAsync( + billingAccountName, billingProfileName, invoiceSectionName, context), + nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); } /** - * 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. + * 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 billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. + * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleDefinitionInner getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { - return getByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleDefinitionName, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName) { + return new PagedIterable<>( + listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName)); } /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of role definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + return new PagedIterable<>( + listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the definition for a role on an invoice section along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName) { + private Mono> getByInvoiceSectionWithResponseAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleDefinitionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -696,40 +732,59 @@ private Mono> listByBillingAccountSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + } + if (billingRoleDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter billingRoleDefinitionName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .getByInvoiceSection( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingProfileName, + invoiceSectionName, + billingRoleDefinitionName, + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the definition for a role on an invoice section along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, Context context) { + private Mono> getByInvoiceSectionWithResponseAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleDefinitionName, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -740,104 +795,121 @@ private Mono> listByBillingAccountSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + } + if (billingRoleDefinitionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter billingRoleDefinitionName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .getByInvoiceSection( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingProfileName, + invoiceSectionName, + billingRoleDefinitionName, + accept, + context); } /** - * 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. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedFlux}. + * @return the definition for a role on an invoice section on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByInvoiceSectionAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleDefinitionName) { + return getByInvoiceSectionWithResponseAsync( + billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * 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. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedIterable}. + * @return the definition for a role on an invoice section along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByInvoiceSectionWithResponse( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleDefinitionName, + Context context) { + return getByInvoiceSectionWithResponseAsync( + billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, context) + .block(); } /** - * 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. + * 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 context The context to associate with this operation. + * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedIterable}. + * @return the definition for a role on an invoice section. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingRoleDefinitionInner getByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleDefinitionName) { + return getByInvoiceSectionWithResponse( + billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, Context.NONE) + .getValue(); } /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -848,26 +920,15 @@ private Mono> listByInvoiceSectionSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByInvoiceSection( + .listByBillingAccount( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, - invoiceSectionName, accept, context)) .>map( @@ -883,12 +944,10 @@ private Mono> listByInvoiceSectionSing } /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -896,8 +955,8 @@ private Mono> listByInvoiceSectionSing * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -908,26 +967,11 @@ private Mono> listByInvoiceSectionSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - accept, - context) + .listByBillingAccount( + this.client.getEndpoint(), this.client.getApiVersion(), billingAccountName, accept, context) .map( res -> new PagedResponseBase<>( @@ -940,32 +984,27 @@ private Mono> listByInvoiceSectionSing } /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of role definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { + private PagedFlux listByBillingAccountAsync(String billingAccountName) { return new PagedFlux<>( - () -> listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); + () -> listByBillingAccountSinglePageAsync(billingAccountName), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -973,41 +1012,33 @@ private PagedFlux listByInvoiceSectionAsync( * @return the list of role definitions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + private PagedFlux listByBillingAccountAsync( + String billingAccountName, Context context) { return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync( - billingAccountName, billingProfileName, invoiceSectionName, context), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); + () -> listByBillingAccountSinglePageAsync(billingAccountName, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of role definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName)); + public PagedIterable listByBillingAccount(String billingAccountName) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); } /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1015,26 +1046,25 @@ public PagedIterable listByInvoiceSection( * @return the list of role definitions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); + public PagedIterable listByBillingAccount(String billingAccountName, Context context) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); } /** - * 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. + * 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 billingProfileName The ID that uniquely identifies a billing profile. + * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the definition for a role on a billing account along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { + private Mono> getByBillingAccountWithResponseAsync( + String billingAccountName, String billingRoleDefinitionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1045,50 +1075,43 @@ private Mono> listByBillingProfileSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { + if (billingRoleDefinitionName == null) { return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter billingRoleDefinitionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingProfile( + .getByBillingAccount( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, + billingRoleDefinitionName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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. + * 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 billingProfileName The ID that uniquely identifies a billing profile. + * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the definition for a role on a billing account along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { + private Mono> getByBillingAccountWithResponseAsync( + String billingAccountName, String billingRoleDefinitionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1099,99 +1122,74 @@ private Mono> listByBillingProfileSing return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { + if (billingRoleDefinitionName == null) { return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter billingRoleDefinitionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfile( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .getByBillingAccount( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingRoleDefinitionName, + accept, + context); } /** - * 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. + * 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 billingProfileName The ID that uniquely identifies a billing profile. + * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedFlux}. + * @return the definition for a role on a billing account on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByBillingAccountAsync( + String billingAccountName, String billingRoleDefinitionName) { + return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleDefinitionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * 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. + * 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 billingProfileName The ID that uniquely identifies a billing profile. + * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedIterable}. + * @return the definition for a role on a billing account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByBillingAccountWithResponse( + String billingAccountName, String billingRoleDefinitionName, Context context) { + return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleDefinitionName, context).block(); } /** - * 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. + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. + * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedIterable}. + * @return the definition for a role on a billing account. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingRoleDefinitionInner getByBillingAccount(String billingAccountName, String billingRoleDefinitionName) { + return getByBillingAccountWithResponse(billingAccountName, billingRoleDefinitionName, Context.NONE).getValue(); } /** @@ -1205,7 +1203,7 @@ public PagedIterable listByBillingProfile( * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1218,7 +1216,7 @@ private Mono> listByBillingAccountNext final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1243,7 +1241,7 @@ private Mono> listByBillingAccountNext * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( + private Mono> listByBillingProfileNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1257,7 +1255,7 @@ private Mono> listByBillingAccountNext final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1355,7 +1353,7 @@ private Mono> listByInvoiceSectionNext * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1368,7 +1366,7 @@ private Mono> listByBillingProfileNext final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1393,7 +1391,7 @@ private Mono> listByBillingProfileNext * @return the list of role definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( + private Mono> listByBillingAccountNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1407,7 +1405,7 @@ private Mono> listByBillingProfileNext final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsImpl.java index 25e916f4eedb6..e4c5d1b03ccc7 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsImpl.java @@ -27,12 +27,27 @@ public BillingRoleDefinitionsImpl( this.serviceManager = serviceManager; } - public Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, Context context) { + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); + return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); + return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); + } + + public Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { Response inner = this .serviceClient() - .getByBillingAccountWithResponse(billingAccountName, billingRoleDefinitionName, context); + .getByBillingProfileWithResponse( + billingAccountName, billingProfileName, billingRoleDefinitionName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -44,9 +59,10 @@ public Response getByBillingAccountWithResponse( } } - public BillingRoleDefinition getByBillingAccount(String billingAccountName, String billingRoleDefinitionName) { + public BillingRoleDefinition getByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { BillingRoleDefinitionInner inner = - this.serviceClient().getByBillingAccount(billingAccountName, billingRoleDefinitionName); + this.serviceClient().getByBillingProfile(billingAccountName, billingProfileName, billingRoleDefinitionName); if (inner != null) { return new BillingRoleDefinitionImpl(inner, this.manager()); } else { @@ -54,6 +70,22 @@ public BillingRoleDefinition getByBillingAccount(String billingAccountName, Stri } } + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName) { + PagedIterable inner = + this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); + return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, context); + return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); + } + public Response getByInvoiceSectionWithResponse( String billingAccountName, String billingProfileName, @@ -93,13 +125,23 @@ public BillingRoleDefinition getByInvoiceSection( } } - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { + public PagedIterable listByBillingAccount(String billingAccountName) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); + return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountName, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountName, context); + return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); + } + + public Response getByBillingAccountWithResponse( + String billingAccountName, String billingRoleDefinitionName, Context context) { Response inner = this .serviceClient() - .getByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleDefinitionName, context); + .getByBillingAccountWithResponse(billingAccountName, billingRoleDefinitionName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -111,10 +153,9 @@ public Response getByBillingProfileWithResponse( } } - public BillingRoleDefinition getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { + public BillingRoleDefinition getByBillingAccount(String billingAccountName, String billingRoleDefinitionName) { BillingRoleDefinitionInner inner = - this.serviceClient().getByBillingProfile(billingAccountName, billingProfileName, billingRoleDefinitionName); + this.serviceClient().getByBillingAccount(billingAccountName, billingRoleDefinitionName); if (inner != null) { return new BillingRoleDefinitionImpl(inner, this.manager()); } else { @@ -122,47 +163,6 @@ public BillingRoleDefinition getByBillingProfile( } } - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - PagedIterable inner = - this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - private BillingRoleDefinitionsClient serviceClient() { return this.innerClient; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionImpl.java index 4c08299542778..b0381f5b5e77a 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; import com.azure.resourcemanager.billing.models.Amount; import com.azure.resourcemanager.billing.models.BillingSubscription; @@ -36,64 +37,68 @@ public String type() { return this.innerModel().type(); } - public String displayName() { - return this.innerModel().displayName(); - } - - public UUID subscriptionId() { - return this.innerModel().subscriptionId(); - } - - public BillingSubscriptionStatusType subscriptionBillingStatus() { - return this.innerModel().subscriptionBillingStatus(); - } - - public Amount lastMonthCharges() { - return this.innerModel().lastMonthCharges(); + public SystemData systemData() { + return this.innerModel().systemData(); } - public Amount monthToDateCharges() { - return this.innerModel().monthToDateCharges(); + public String billingProfileDisplayName() { + return this.innerModel().billingProfileDisplayName(); } public String billingProfileId() { return this.innerModel().billingProfileId(); } - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); - } - public String costCenter() { return this.innerModel().costCenter(); } + public String customerDisplayName() { + return this.innerModel().customerDisplayName(); + } + public String customerId() { return this.innerModel().customerId(); } - public String customerDisplayName() { - return this.innerModel().customerDisplayName(); + public String displayName() { + return this.innerModel().displayName(); + } + + public String invoiceSectionDisplayName() { + return this.innerModel().invoiceSectionDisplayName(); } public String invoiceSectionId() { return this.innerModel().invoiceSectionId(); } - public String invoiceSectionDisplayName() { - return this.innerModel().invoiceSectionDisplayName(); + public Amount lastMonthCharges() { + return this.innerModel().lastMonthCharges(); + } + + public Amount monthToDateCharges() { + return this.innerModel().monthToDateCharges(); } public Reseller reseller() { return this.innerModel().reseller(); } + public String skuDescription() { + return this.innerModel().skuDescription(); + } + public String skuId() { return this.innerModel().skuId(); } - public String skuDescription() { - return this.innerModel().skuDescription(); + public BillingSubscriptionStatusType subscriptionBillingStatus() { + return this.innerModel().subscriptionBillingStatus(); + } + + public UUID subscriptionId() { + return this.innerModel().subscriptionId(); } public List suspensionReasons() { diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java index a4f90ebb8fd18..e10ac7c40fd05 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java @@ -69,54 +69,38 @@ public final class BillingSubscriptionsClientImpl implements BillingSubscription public interface BillingSubscriptionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}" - + "/billingSubscriptions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomer( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("customerName") String customerName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingSubscriptions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( + Mono> listByInvoiceSection( @HostParam("$host") String endpoint, @PathParam("billingAccountName") String billingAccountName, @PathParam("billingProfileName") String billingProfileName, + @PathParam("invoiceSectionName") String invoiceSectionName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingSubscriptions") + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSection( + Mono> listByBillingAccount( @HostParam("$host") String endpoint, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -149,8 +133,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}" - + "/move") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/move") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> move( @@ -164,8 +147,7 @@ Mono>> move( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}" - + "/validateMoveEligibility") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/validateMoveEligibility") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> validateMove( @@ -177,11 +159,24 @@ Mono> validateMove( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCustomer( + @HostParam("$host") String endpoint, + @PathParam("billingAccountName") String billingAccountName, + @PathParam("customerName") String customerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomerNext( + Mono> listByBillingProfileNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -191,7 +186,7 @@ Mono> listByCustomerNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( + Mono> listByInvoiceSectionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -201,7 +196,7 @@ Mono> listByBillingAccountNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( + Mono> listByBillingAccountNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -211,7 +206,7 @@ Mono> listByBillingProfileNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSectionNext( + Mono> listByCustomerNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -219,11 +214,11 @@ Mono> listByInvoiceSectionNext( } /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. + * 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 customerName The ID that uniquely identifies a customer. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -231,8 +226,8 @@ Mono> listByInvoiceSectionNext( * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -243,17 +238,22 @@ private Mono> listByCustomerSinglePageAs return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByCustomer( - this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context)) + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + this.client.getApiVersion(), + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -267,136 +267,21 @@ private Mono> listByCustomerSinglePageAs } /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCustomer(this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync(String billingAccountName, String customerName) { - return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName), - nextLink -> listByCustomerNextSinglePageAsync(nextLink)); - } - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync( - String billingAccountName, String customerName, Context context) { - return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName, context), - nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer(String billingAccountName, String customerName) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName)); - } - - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. + * 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 customerName The ID that uniquely identifies a customer. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName, context)); - } - - /** - * Lists the subscriptions for a billing account. 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions along with {@link PagedResponse} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -407,56 +292,20 @@ private Mono> listByBillingAccountSingle return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), billingAccountName, apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the subscriptions for a billing account. 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { + if (billingProfileName == null) { return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount(this.client.getEndpoint(), billingAccountName, apiVersion, accept, context) + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + this.client.getApiVersion(), + accept, + context) .map( res -> new PagedResponseBase<>( @@ -469,27 +318,30 @@ private Mono> listByBillingAccountSingle } /** - * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName) { return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -497,32 +349,36 @@ private PagedFlux listByBillingAccountAsync(String bil * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName, Context context) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName, Context context) { return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); } /** - * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -530,16 +386,18 @@ public PagedIterable listByBillingAccount(String billi * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); } /** - * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -547,8 +405,8 @@ public PagedIterable listByBillingAccount(String billi * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { + private Mono> listByInvoiceSectionSinglePageAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -563,17 +421,21 @@ private Mono> listByBillingProfileSingle return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingProfile( + .listByInvoiceSection( this.client.getEndpoint(), billingAccountName, billingProfileName, - apiVersion, + invoiceSectionName, + this.client.getApiVersion(), accept, context)) .>map( @@ -589,11 +451,12 @@ private Mono> listByBillingProfileSingle } /** - * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -602,8 +465,8 @@ private Mono> listByBillingProfileSingle * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { + private Mono> listByInvoiceSectionSinglePageAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -618,12 +481,21 @@ private Mono> listByBillingProfileSingle return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfile( - this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, accept, context) + .listByInvoiceSection( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + invoiceSectionName, + this.client.getApiVersion(), + accept, + context) .map( res -> new PagedResponseBase<>( @@ -636,30 +508,32 @@ private Mono> listByBillingProfileSingle } /** - * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { + private PagedFlux listByInvoiceSectionAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName) { return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + () -> listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), + nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); } /** - * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -667,36 +541,41 @@ private PagedFlux listByBillingProfileAsync( * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { + private PagedFlux listByInvoiceSectionAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); + () -> + listByInvoiceSectionSinglePageAsync( + billingAccountName, billingProfileName, invoiceSectionName, context), + nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); } /** - * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName) { + return new PagedIterable<>( + listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName)); } /** - * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -704,18 +583,17 @@ public PagedIterable listByBillingProfile( * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + return new PagedIterable<>( + listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); } /** - * 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 billing account. 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -723,8 +601,8 @@ public PagedIterable listByBillingProfile( * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -735,26 +613,15 @@ private Mono> listByInvoiceSectionSingle return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByInvoiceSection( + .listByBillingAccount( this.client.getEndpoint(), billingAccountName, - billingProfileName, - invoiceSectionName, - apiVersion, + this.client.getApiVersion(), accept, context)) .>map( @@ -770,12 +637,10 @@ private Mono> listByInvoiceSectionSingle } /** - * 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 billing account. 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -784,8 +649,8 @@ private Mono> listByInvoiceSectionSingle * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -796,26 +661,11 @@ private Mono> listByInvoiceSectionSingle return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByInvoiceSection( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - invoiceSectionName, - apiVersion, - accept, - context) + .listByBillingAccount( + this.client.getEndpoint(), billingAccountName, this.client.getApiVersion(), accept, context) .map( res -> new PagedResponseBase<>( @@ -828,32 +678,27 @@ private Mono> listByInvoiceSectionSingle } /** - * 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 billing account. 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { + private PagedFlux listByBillingAccountAsync(String billingAccountName) { return new PagedFlux<>( - () -> listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); + () -> listByBillingAccountSinglePageAsync(billingAccountName), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * 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 billing account. 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -861,41 +706,32 @@ private PagedFlux listByInvoiceSectionAsync( * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { + private PagedFlux listByBillingAccountAsync(String billingAccountName, Context context) { return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync( - billingAccountName, billingProfileName, invoiceSectionName, context), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); + () -> listByBillingAccountSinglePageAsync(billingAccountName, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** - * 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 billing account. 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName)); + public PagedIterable listByBillingAccount(String billingAccountName) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); } /** - * 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 billing account. 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -903,10 +739,8 @@ public PagedIterable listByInvoiceSection( * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); + public PagedIterable listByBillingAccount(String billingAccountName, Context context) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); } /** @@ -914,13 +748,15 @@ public PagedIterable listByInvoiceSection( * Customer Agreement and Microsoft Partner Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a subscription by its ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingAccountName) { + private Mono> getWithResponseAsync( + String billingAccountName, String subscriptionId) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -931,13 +767,9 @@ private Mono> getWithResponseAsync(String bil return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -946,8 +778,8 @@ private Mono> getWithResponseAsync(String bil .get( this.client.getEndpoint(), billingAccountName, - this.client.getSubscriptionId(), - apiVersion, + subscriptionId, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -958,6 +790,7 @@ private Mono> getWithResponseAsync(String bil * Customer Agreement and Microsoft Partner Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -965,7 +798,8 @@ private Mono> getWithResponseAsync(String bil * @return a subscription by its ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingAccountName, Context context) { + private Mono> getWithResponseAsync( + String billingAccountName, String subscriptionId, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -976,21 +810,17 @@ private Mono> getWithResponseAsync(String bil return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), billingAccountName, - this.client.getSubscriptionId(), - apiVersion, + subscriptionId, + this.client.getApiVersion(), accept, context); } @@ -1000,14 +830,16 @@ private Mono> getWithResponseAsync(String bil * Customer Agreement and Microsoft Partner Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a subscription by its ID on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName) { - return getWithResponseAsync(billingAccountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String billingAccountName, String subscriptionId) { + return getWithResponseAsync(billingAccountName, subscriptionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1015,6 +847,7 @@ private Mono getAsync(String billingAccountName) { * Customer Agreement and Microsoft Partner Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1022,8 +855,9 @@ private Mono getAsync(String billingAccountName) { * @return a subscription by its ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingAccountName, Context context) { - return getWithResponseAsync(billingAccountName, context).block(); + public Response getWithResponse( + String billingAccountName, String subscriptionId, Context context) { + return getWithResponseAsync(billingAccountName, subscriptionId, context).block(); } /** @@ -1031,14 +865,15 @@ public Response getWithResponse(String billingAccountN * Customer Agreement and Microsoft Partner Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a subscription by its ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingSubscriptionInner get(String billingAccountName) { - return getWithResponse(billingAccountName, Context.NONE).getValue(); + public BillingSubscriptionInner get(String billingAccountName, String subscriptionId) { + return getWithResponse(billingAccountName, subscriptionId, Context.NONE).getValue(); } /** @@ -1046,6 +881,7 @@ public BillingSubscriptionInner get(String billingAccountName) { * supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1054,7 +890,7 @@ public BillingSubscriptionInner get(String billingAccountName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String billingAccountName, BillingSubscriptionInner parameters) { + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1065,18 +901,14 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1085,8 +917,8 @@ private Mono> updateWithResponseAsync( .update( this.client.getEndpoint(), billingAccountName, - this.client.getSubscriptionId(), - apiVersion, + subscriptionId, + this.client.getApiVersion(), parameters, accept, context)) @@ -1098,6 +930,7 @@ private Mono> updateWithResponseAsync( * supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1107,7 +940,7 @@ private Mono> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String billingAccountName, BillingSubscriptionInner parameters, Context context) { + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1118,26 +951,22 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), billingAccountName, - this.client.getSubscriptionId(), - apiVersion, + subscriptionId, + this.client.getApiVersion(), parameters, accept, context); @@ -1148,6 +977,7 @@ private Mono> updateWithResponseAsync( * supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1155,8 +985,10 @@ private Mono> updateWithResponseAsync( * @return a billing subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String billingAccountName, BillingSubscriptionInner parameters) { - return updateWithResponseAsync(billingAccountName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono updateAsync( + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters) { + return updateWithResponseAsync(billingAccountName, subscriptionId, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1164,6 +996,7 @@ private Mono updateAsync(String billingAccountName, Bi * supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1173,8 +1006,8 @@ private Mono updateAsync(String billingAccountName, Bi */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, Context context) { - return updateWithResponseAsync(billingAccountName, parameters, context).block(); + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters, Context context) { + return updateWithResponseAsync(billingAccountName, subscriptionId, parameters, context).block(); } /** @@ -1182,6 +1015,7 @@ public Response updateWithResponse( * supported only for billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1189,8 +1023,9 @@ public Response updateWithResponse( * @return a billing subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BillingSubscriptionInner update(String billingAccountName, BillingSubscriptionInner parameters) { - return updateWithResponse(billingAccountName, parameters, Context.NONE).getValue(); + public BillingSubscriptionInner update( + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters) { + return updateWithResponse(billingAccountName, subscriptionId, parameters, Context.NONE).getValue(); } /** @@ -1199,6 +1034,7 @@ public BillingSubscriptionInner update(String billingAccountName, BillingSubscri * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1207,7 +1043,7 @@ public BillingSubscriptionInner update(String billingAccountName, BillingSubscri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> moveWithResponseAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1218,18 +1054,14 @@ private Mono>> moveWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1238,8 +1070,8 @@ private Mono>> moveWithResponseAsync( .move( this.client.getEndpoint(), billingAccountName, - this.client.getSubscriptionId(), - apiVersion, + subscriptionId, + this.client.getApiVersion(), parameters, accept, context)) @@ -1252,6 +1084,7 @@ private Mono>> moveWithResponseAsync( * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1261,7 +1094,10 @@ private Mono>> moveWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> moveWithResponseAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1272,26 +1108,22 @@ private Mono>> moveWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .move( this.client.getEndpoint(), billingAccountName, - this.client.getSubscriptionId(), - apiVersion, + subscriptionId, + this.client.getApiVersion(), parameters, accept, context); @@ -1303,6 +1135,7 @@ private Mono>> moveWithResponseAsync( * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1311,8 +1144,8 @@ private Mono>> moveWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BillingSubscriptionInner> beginMoveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - Mono>> mono = moveWithResponseAsync(billingAccountName, parameters); + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { + Mono>> mono = moveWithResponseAsync(billingAccountName, subscriptionId, parameters); return this .client .getLroResult( @@ -1329,6 +1162,7 @@ private PollerFlux, BillingSubscriptionInne * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1338,9 +1172,13 @@ private PollerFlux, BillingSubscriptionInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BillingSubscriptionInner> beginMoveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = moveWithResponseAsync(billingAccountName, parameters, context); + Mono>> mono = + moveWithResponseAsync(billingAccountName, subscriptionId, parameters, context); return this .client .getLroResult( @@ -1357,6 +1195,7 @@ private PollerFlux, BillingSubscriptionInne * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1365,8 +1204,8 @@ private PollerFlux, BillingSubscriptionInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return this.beginMoveAsync(billingAccountName, parameters).getSyncPoller(); + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { + return this.beginMoveAsync(billingAccountName, subscriptionId, parameters).getSyncPoller(); } /** @@ -1375,6 +1214,7 @@ public SyncPoller, BillingSubscriptionInner * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1384,8 +1224,11 @@ public SyncPoller, BillingSubscriptionInner */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return this.beginMoveAsync(billingAccountName, parameters, context).getSyncPoller(); + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context) { + return this.beginMoveAsync(billingAccountName, subscriptionId, parameters, context).getSyncPoller(); } /** @@ -1394,6 +1237,7 @@ public SyncPoller, BillingSubscriptionInner * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1402,8 +1246,10 @@ public SyncPoller, BillingSubscriptionInner */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono moveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return beginMoveAsync(billingAccountName, parameters).last().flatMap(this.client::getLroFinalResultOrError); + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { + return beginMoveAsync(billingAccountName, subscriptionId, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1412,6 +1258,7 @@ private Mono moveAsync( * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1421,8 +1268,11 @@ private Mono moveAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono moveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return beginMoveAsync(billingAccountName, parameters, context) + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context) { + return beginMoveAsync(billingAccountName, subscriptionId, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1433,6 +1283,7 @@ private Mono moveAsync( * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1441,8 +1292,8 @@ private Mono moveAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public BillingSubscriptionInner move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return moveAsync(billingAccountName, parameters).block(); + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { + return moveAsync(billingAccountName, subscriptionId, parameters).block(); } /** @@ -1451,6 +1302,7 @@ public BillingSubscriptionInner move( * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1460,8 +1312,11 @@ public BillingSubscriptionInner move( */ @ServiceMethod(returns = ReturnType.SINGLE) public BillingSubscriptionInner move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return moveAsync(billingAccountName, parameters, context).block(); + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context) { + return moveAsync(billingAccountName, subscriptionId, parameters, context).block(); } /** @@ -1469,6 +1324,7 @@ public BillingSubscriptionInner move( * billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the validate move eligibility operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1478,7 +1334,7 @@ public BillingSubscriptionInner move( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> validateMoveWithResponseAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1489,18 +1345,14 @@ private Mono> valid return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1509,8 +1361,8 @@ private Mono> valid .validateMove( this.client.getEndpoint(), billingAccountName, - this.client.getSubscriptionId(), - apiVersion, + subscriptionId, + this.client.getApiVersion(), parameters, accept, context)) @@ -1522,6 +1374,7 @@ private Mono> valid * billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the validate move eligibility operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1532,7 +1385,10 @@ private Mono> valid */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> validateMoveWithResponseAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1543,26 +1399,22 @@ private Mono> valid return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .validateMove( this.client.getEndpoint(), billingAccountName, - this.client.getSubscriptionId(), - apiVersion, + subscriptionId, + this.client.getApiVersion(), parameters, accept, context); @@ -1573,6 +1425,7 @@ private Mono> valid * billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the validate move eligibility operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1581,8 +1434,8 @@ private Mono> valid */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateMoveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return validateMoveWithResponseAsync(billingAccountName, parameters) + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { + return validateMoveWithResponseAsync(billingAccountName, subscriptionId, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -1591,6 +1444,7 @@ private Mono validateMoveAsy * billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the validate move eligibility operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1600,8 +1454,11 @@ private Mono validateMoveAsy */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validateMoveWithResponse( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return validateMoveWithResponseAsync(billingAccountName, parameters, context).block(); + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context) { + return validateMoveWithResponseAsync(billingAccountName, subscriptionId, parameters, context).block(); } /** @@ -1609,6 +1466,7 @@ public Response validateMove * billing accounts with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the validate move eligibility operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1617,8 +1475,182 @@ public Response validateMove */ @ServiceMethod(returns = ReturnType.SINGLE) public ValidateSubscriptionTransferEligibilityResultInner validateMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return validateMoveWithResponse(billingAccountName, parameters, Context.NONE).getValue(); + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { + return validateMoveWithResponse(billingAccountName, subscriptionId, parameters, Context.NONE).getValue(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCustomerSinglePageAsync( + String billingAccountName, String customerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (customerName == null) { + return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCustomer( + this.client.getEndpoint(), + billingAccountName, + customerName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCustomerSinglePageAsync( + String billingAccountName, String customerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (customerName == null) { + return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCustomer( + this.client.getEndpoint(), + billingAccountName, + customerName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCustomerAsync(String billingAccountName, String customerName) { + return new PagedFlux<>( + () -> listByCustomerSinglePageAsync(billingAccountName, customerName), + nextLink -> listByCustomerNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCustomerAsync( + String billingAccountName, String customerName, Context context) { + return new PagedFlux<>( + () -> listByCustomerSinglePageAsync(billingAccountName, customerName, context), + nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCustomer(String billingAccountName, String customerName) { + return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCustomer( + String billingAccountName, String customerName, Context context) { + return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName, context)); } /** @@ -1633,7 +1665,7 @@ public ValidateSubscriptionTransferEligibilityResultInner validateMove( * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1645,7 +1677,8 @@ private Mono> listByCustomerNextSinglePa } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext( + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1671,7 +1704,7 @@ private Mono> listByCustomerNextSinglePa * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync( + private Mono> listByBillingProfileNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1685,7 +1718,7 @@ private Mono> listByCustomerNextSinglePa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1709,7 +1742,7 @@ private Mono> listByCustomerNextSinglePa * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + private Mono> listByInvoiceSectionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1722,7 +1755,7 @@ private Mono> listByBillingAccountNextSi final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1748,7 +1781,7 @@ private Mono> listByBillingAccountNextSi * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( + private Mono> listByInvoiceSectionNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1762,7 +1795,7 @@ private Mono> listByBillingAccountNextSi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1786,7 +1819,7 @@ private Mono> listByBillingAccountNextSi * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1799,7 +1832,7 @@ private Mono> listByBillingProfileNextSi final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1825,7 +1858,7 @@ private Mono> listByBillingProfileNextSi * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( + private Mono> listByBillingAccountNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1839,7 +1872,7 @@ private Mono> listByBillingProfileNextSi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1863,7 +1896,7 @@ private Mono> listByBillingProfileNextSi * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync(String nextLink) { + private Mono> listByCustomerNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1875,8 +1908,7 @@ private Mono> listByInvoiceSectionNextSi } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1902,7 +1934,7 @@ private Mono> listByInvoiceSectionNextSi * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync( + private Mono> listByCustomerNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1916,7 +1948,7 @@ private Mono> listByInvoiceSectionNextSi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context) + .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsImpl.java index 2594b8c47e868..f2522b87864a1 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsImpl.java @@ -30,30 +30,6 @@ public BillingSubscriptionsImpl( this.serviceManager = serviceManager; } - public PagedIterable listByCustomer(String billingAccountName, String customerName) { - PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context) { - PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName, context); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, context); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - public PagedIterable listByBillingProfile( String billingAccountName, String billingProfileName) { PagedIterable inner = @@ -84,8 +60,21 @@ public PagedIterable listByInvoiceSection( return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); } - public Response getWithResponse(String billingAccountName, Context context) { - Response inner = this.serviceClient().getWithResponse(billingAccountName, context); + public PagedIterable listByBillingAccount(String billingAccountName) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); + return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountName, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountName, context); + return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String billingAccountName, String subscriptionId, Context context) { + Response inner = + this.serviceClient().getWithResponse(billingAccountName, subscriptionId, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -97,8 +86,8 @@ public Response getWithResponse(String billingAccountName, } } - public BillingSubscription get(String billingAccountName) { - BillingSubscriptionInner inner = this.serviceClient().get(billingAccountName); + public BillingSubscription get(String billingAccountName, String subscriptionId) { + BillingSubscriptionInner inner = this.serviceClient().get(billingAccountName, subscriptionId); if (inner != null) { return new BillingSubscriptionImpl(inner, this.manager()); } else { @@ -107,9 +96,9 @@ public BillingSubscription get(String billingAccountName) { } public Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, Context context) { + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters, Context context) { Response inner = - this.serviceClient().updateWithResponse(billingAccountName, parameters, context); + this.serviceClient().updateWithResponse(billingAccountName, subscriptionId, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -121,8 +110,9 @@ public Response updateWithResponse( } } - public BillingSubscription update(String billingAccountName, BillingSubscriptionInner parameters) { - BillingSubscriptionInner inner = this.serviceClient().update(billingAccountName, parameters); + public BillingSubscription update( + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters) { + BillingSubscriptionInner inner = this.serviceClient().update(billingAccountName, subscriptionId, parameters); if (inner != null) { return new BillingSubscriptionImpl(inner, this.manager()); } else { @@ -131,8 +121,8 @@ public BillingSubscription update(String billingAccountName, BillingSubscription } public BillingSubscription move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - BillingSubscriptionInner inner = this.serviceClient().move(billingAccountName, parameters); + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { + BillingSubscriptionInner inner = this.serviceClient().move(billingAccountName, subscriptionId, parameters); if (inner != null) { return new BillingSubscriptionImpl(inner, this.manager()); } else { @@ -141,8 +131,12 @@ public BillingSubscription move( } public BillingSubscription move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - BillingSubscriptionInner inner = this.serviceClient().move(billingAccountName, parameters, context); + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context) { + BillingSubscriptionInner inner = + this.serviceClient().move(billingAccountName, subscriptionId, parameters, context); if (inner != null) { return new BillingSubscriptionImpl(inner, this.manager()); } else { @@ -151,9 +145,12 @@ public BillingSubscription move( } public Response validateMoveWithResponse( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context) { Response inner = - this.serviceClient().validateMoveWithResponse(billingAccountName, parameters, context); + this.serviceClient().validateMoveWithResponse(billingAccountName, subscriptionId, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -166,9 +163,9 @@ public Response validateMoveWithR } public ValidateSubscriptionTransferEligibilityResult validateMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters) { ValidateSubscriptionTransferEligibilityResultInner inner = - this.serviceClient().validateMove(billingAccountName, parameters); + this.serviceClient().validateMove(billingAccountName, subscriptionId, parameters); if (inner != null) { return new ValidateSubscriptionTransferEligibilityResultImpl(inner, this.manager()); } else { @@ -176,6 +173,19 @@ public ValidateSubscriptionTransferEligibilityResult validateMove( } } + public PagedIterable listByCustomer(String billingAccountName, String customerName) { + PagedIterable inner = + this.serviceClient().listByCustomer(billingAccountName, customerName); + return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByCustomer( + String billingAccountName, String customerName, Context context) { + PagedIterable inner = + this.serviceClient().listByCustomer(billingAccountName, customerName, context); + return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); + } + private BillingSubscriptionsClient serviceClient() { return this.innerClient; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerImpl.java index 666146064b57e..92b1efb823328 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.CustomerInner; import com.azure.resourcemanager.billing.models.AzurePlan; import com.azure.resourcemanager.billing.models.Customer; @@ -33,14 +34,18 @@ public String type() { return this.innerModel().type(); } - public String billingProfileId() { - return this.innerModel().billingProfileId(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String billingProfileDisplayName() { return this.innerModel().billingProfileDisplayName(); } + public String billingProfileId() { + return this.innerModel().billingProfileId(); + } + public String displayName() { return this.innerModel().displayName(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerPolicyImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerPolicyImpl.java index ab8405cf3917d..a3c39e6f85fdd 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerPolicyImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerPolicyImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; import com.azure.resourcemanager.billing.models.CustomerPolicy; import com.azure.resourcemanager.billing.models.ViewCharges; @@ -31,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public ViewCharges viewCharges() { return this.innerModel().viewCharges(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java index 438edd7d782a8..ed16c26d0ca4e 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java @@ -58,8 +58,7 @@ public final class CustomersClientImpl implements CustomersClient { public interface CustomersService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/customers") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -150,7 +149,6 @@ private Mono> listByBillingProfileSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -158,7 +156,7 @@ private Mono> listByBillingProfileSinglePageAsync( service .listByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, search, @@ -209,13 +207,12 @@ private Mono> listByBillingProfileSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, search, @@ -364,14 +361,19 @@ private Mono> listByBillingAccountSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, search, filter, accept, context)) + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + search, + filter, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -411,12 +413,17 @@ private Mono> listByBillingAccountSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, search, filter, accept, context) + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + search, + filter, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -555,7 +562,6 @@ private Mono> getWithResponseAsync( if (customerName == null) { return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -563,7 +569,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, customerName, expand, @@ -601,11 +607,17 @@ private Mono> getWithResponseAsync( if (customerName == null) { return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get(this.client.getEndpoint(), apiVersion, billingAccountName, customerName, expand, accept, context); + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + customerName, + expand, + accept, + context); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountSummaryImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountSummaryImpl.java deleted file mode 100644 index d369fe44c1a8c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountSummaryImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; - -public final class EnrollmentAccountSummaryImpl implements EnrollmentAccountSummary { - private EnrollmentAccountSummaryInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - EnrollmentAccountSummaryImpl( - EnrollmentAccountSummaryInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String principalName() { - return this.innerModel().principalName(); - } - - public EnrollmentAccountSummaryInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsClientImpl.java deleted file mode 100644 index 27401e60f7373..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsClientImpl.java +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.billing.fluent.EnrollmentAccountsClient; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; -import com.azure.resourcemanager.billing.models.EnrollmentAccountListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in EnrollmentAccountsClient. */ -public final class EnrollmentAccountsClientImpl implements EnrollmentAccountsClient { - /** The proxy service used to perform REST calls. */ - private final EnrollmentAccountsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of EnrollmentAccountsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - EnrollmentAccountsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(EnrollmentAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientEnrollmentAccounts to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - public interface EnrollmentAccountsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/enrollmentAccounts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/enrollmentAccounts/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), name, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), name, apiVersion, accept, context); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String name) { - return getWithResponseAsync(name).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String name, Context context) { - return getWithResponseAsync(name, context).block(); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnrollmentAccountSummaryInner get(String name) { - return getWithResponse(name, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsImpl.java deleted file mode 100644 index f0d85d2464f8a..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.EnrollmentAccountsClient; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; -import com.azure.resourcemanager.billing.models.EnrollmentAccounts; - -public final class EnrollmentAccountsImpl implements EnrollmentAccounts { - private static final ClientLogger LOGGER = new ClientLogger(EnrollmentAccountsImpl.class); - - private final EnrollmentAccountsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public EnrollmentAccountsImpl( - EnrollmentAccountsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new EnrollmentAccountSummaryImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new EnrollmentAccountSummaryImpl(inner1, this.manager())); - } - - public Response getWithResponse(String name, Context context) { - Response inner = this.serviceClient().getWithResponse(name, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EnrollmentAccountSummaryImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public EnrollmentAccountSummary get(String name) { - EnrollmentAccountSummaryInner inner = this.serviceClient().get(name); - if (inner != null) { - return new EnrollmentAccountSummaryImpl(inner, this.manager()); - } else { - return null; - } - } - - private EnrollmentAccountsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionImpl.java index 34c17330dbea8..f49bdde280e41 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.InstructionInner; import com.azure.resourcemanager.billing.models.Instruction; import java.time.OffsetDateTime; @@ -30,20 +31,24 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public float amount() { return this.innerModel().amount(); } - public OffsetDateTime startDate() { - return this.innerModel().startDate(); + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); } public OffsetDateTime endDate() { return this.innerModel().endDate(); } - public OffsetDateTime creationDate() { - return this.innerModel().creationDate(); + public OffsetDateTime startDate() { + return this.innerModel().startDate(); } public InstructionInner innerModel() { diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java index 5f094a9168754..624d3ff738ef9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java @@ -60,8 +60,7 @@ public final class InstructionsClientImpl implements InstructionsClient { public interface InstructionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/instructions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -74,8 +73,7 @@ Mono> listByBillingProfile( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/instructions/{instructionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -89,8 +87,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/instructions/{instructionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> put( @@ -142,7 +139,6 @@ private Mono> listByBillingProfileSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -152,7 +148,7 @@ private Mono> listByBillingProfileSinglePageAsyn this.client.getEndpoint(), billingAccountName, billingProfileName, - apiVersion, + this.client.getApiVersion(), accept, context)) .>map( @@ -196,12 +192,16 @@ private Mono> listByBillingProfileSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByBillingProfile( - this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, accept, context) + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + this.client.getApiVersion(), + accept, + context) .map( res -> new PagedResponseBase<>( @@ -318,7 +318,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter instructionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -326,7 +325,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, instructionName, @@ -368,13 +367,12 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter instructionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, instructionName, @@ -473,7 +471,6 @@ private Mono> putWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -481,7 +478,7 @@ private Mono> putWithResponseAsync( service .put( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, instructionName, @@ -535,13 +532,12 @@ private Mono> putWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .put( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, instructionName, diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceImpl.java index 0b4a038252070..9c19e5a254f85 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; import com.azure.resourcemanager.billing.models.Amount; import com.azure.resourcemanager.billing.models.Document; @@ -40,16 +41,8 @@ public String type() { return this.innerModel().type(); } - public OffsetDateTime dueDate() { - return this.innerModel().dueDate(); - } - - public OffsetDateTime invoiceDate() { - return this.innerModel().invoiceDate(); - } - - public InvoiceStatus status() { - return this.innerModel().status(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Amount amountDue() { @@ -64,61 +57,65 @@ public Amount billedAmount() { return this.innerModel().billedAmount(); } - public Amount creditAmount() { - return this.innerModel().creditAmount(); + public String billedDocumentId() { + return this.innerModel().billedDocumentId(); } - public Amount freeAzureCreditApplied() { - return this.innerModel().freeAzureCreditApplied(); + public String billingProfileDisplayName() { + return this.innerModel().billingProfileDisplayName(); } - public Amount subTotal() { - return this.innerModel().subTotal(); + public String billingProfileId() { + return this.innerModel().billingProfileId(); } - public Amount taxAmount() { - return this.innerModel().taxAmount(); + public Amount creditAmount() { + return this.innerModel().creditAmount(); } - public Amount totalAmount() { - return this.innerModel().totalAmount(); + public String creditForDocumentId() { + return this.innerModel().creditForDocumentId(); } - public OffsetDateTime invoicePeriodStartDate() { - return this.innerModel().invoicePeriodStartDate(); + public List documents() { + List inner = this.innerModel().documents(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } - public OffsetDateTime invoicePeriodEndDate() { - return this.innerModel().invoicePeriodEndDate(); + public InvoiceDocumentType documentType() { + return this.innerModel().documentType(); } - public InvoiceType invoiceType() { - return this.innerModel().invoiceType(); + public OffsetDateTime dueDate() { + return this.innerModel().dueDate(); } - public Boolean isMonthlyInvoice() { - return this.innerModel().isMonthlyInvoice(); + public Amount freeAzureCreditApplied() { + return this.innerModel().freeAzureCreditApplied(); } - public String billingProfileId() { - return this.innerModel().billingProfileId(); + public OffsetDateTime invoiceDate() { + return this.innerModel().invoiceDate(); } - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); + public OffsetDateTime invoicePeriodEndDate() { + return this.innerModel().invoicePeriodEndDate(); } - public String purchaseOrderNumber() { - return this.innerModel().purchaseOrderNumber(); + public OffsetDateTime invoicePeriodStartDate() { + return this.innerModel().invoicePeriodStartDate(); } - public List documents() { - List inner = this.innerModel().documents(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public InvoiceType invoiceType() { + return this.innerModel().invoiceType(); + } + + public Boolean isMonthlyInvoice() { + return this.innerModel().isMonthlyInvoice(); } public List payments() { @@ -130,6 +127,10 @@ public List payments() { } } + public String purchaseOrderNumber() { + return this.innerModel().purchaseOrderNumber(); + } + public Map rebillDetails() { Map inner = this.innerModel().rebillDetails(); if (inner != null) { @@ -139,20 +140,24 @@ public Map rebillDetails() { } } - public InvoiceDocumentType documentType() { - return this.innerModel().documentType(); + public InvoiceStatus status() { + return this.innerModel().status(); } - public String billedDocumentId() { - return this.innerModel().billedDocumentId(); + public String subscriptionId() { + return this.innerModel().subscriptionId(); } - public String creditForDocumentId() { - return this.innerModel().creditForDocumentId(); + public Amount subTotal() { + return this.innerModel().subTotal(); } - public String subscriptionId() { - return this.innerModel().subscriptionId(); + public Amount taxAmount() { + return this.innerModel().taxAmount(); + } + + public Amount totalAmount() { + return this.innerModel().totalAmount(); } public InvoiceInner innerModel() { diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionImpl.java index 3015965629c07..cf873f1140440 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; import com.azure.resourcemanager.billing.models.InvoiceSection; import com.azure.resourcemanager.billing.models.InvoiceSectionState; @@ -34,6 +35,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String displayName() { return this.innerModel().displayName(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionWithCreateSubPermissionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionWithCreateSubPermissionImpl.java index 97779e42498ea..1cd2a4dcfa8f2 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionWithCreateSubPermissionImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionWithCreateSubPermissionImpl.java @@ -25,24 +25,16 @@ public final class InvoiceSectionWithCreateSubPermissionImpl implements InvoiceS this.serviceManager = serviceManager; } - public String invoiceSectionId() { - return this.innerModel().invoiceSectionId(); - } - - public String invoiceSectionDisplayName() { - return this.innerModel().invoiceSectionDisplayName(); - } - - public String invoiceSectionSystemId() { - return this.innerModel().invoiceSectionSystemId(); + public String billingProfileDisplayName() { + return this.innerModel().billingProfileDisplayName(); } public String billingProfileId() { return this.innerModel().billingProfileId(); } - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); + public SpendingLimitForBillingProfile billingProfileSpendingLimit() { + return this.innerModel().billingProfileSpendingLimit(); } public BillingProfileStatus billingProfileStatus() { @@ -53,10 +45,6 @@ public StatusReasonCodeForBillingProfile billingProfileStatusReasonCode() { return this.innerModel().billingProfileStatusReasonCode(); } - public SpendingLimitForBillingProfile billingProfileSpendingLimit() { - return this.innerModel().billingProfileSpendingLimit(); - } - public String billingProfileSystemId() { return this.innerModel().billingProfileSystemId(); } @@ -70,6 +58,18 @@ public List enabledAzurePlans() { } } + public String invoiceSectionDisplayName() { + return this.innerModel().invoiceSectionDisplayName(); + } + + public String invoiceSectionId() { + return this.innerModel().invoiceSectionId(); + } + + public String invoiceSectionSystemId() { + return this.innerModel().invoiceSectionSystemId(); + } + public InvoiceSectionWithCreateSubPermissionInner innerModel() { return this.innerObject; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java index 52223c1c5260b..6ebbf2a40f431 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java @@ -65,8 +65,7 @@ public final class InvoiceSectionsClientImpl implements InvoiceSectionsClient { public interface InvoiceSectionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -79,8 +78,7 @@ Mono> listByBillingProfile( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -94,8 +92,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @@ -147,7 +144,6 @@ private Mono> listByBillingProfileSinglePageA return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -155,7 +151,7 @@ private Mono> listByBillingProfileSinglePageA service .listByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, accept, @@ -201,12 +197,16 @@ private Mono> listByBillingProfileSinglePageA return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByBillingProfile( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, accept, context) + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + billingProfileName, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -325,7 +325,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -333,7 +332,7 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, invoiceSectionName, @@ -376,13 +375,12 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, invoiceSectionName, @@ -487,7 +485,6 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -495,7 +492,7 @@ private Mono>> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, invoiceSectionName, @@ -549,13 +546,12 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, invoiceSectionName, diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java index a3744a74d3287..022a23341cc15 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java @@ -65,53 +65,53 @@ public final class InvoicesClientImpl implements InvoicesClient { @ServiceInterface(name = "BillingManagementCli") public interface InvoicesService { @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, @QueryParam("periodStartDate") String periodStartDate, @QueryParam("periodEndDate") String periodEndDate, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoices") - @ExpectedResponses({200}) + @Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( + Mono>> downloadMultipleBillingProfileInvoices( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("periodStartDate") String periodStartDate, - @QueryParam("periodEndDate") String periodEndDate, + @BodyParam("application/json") List downloadUrls, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}") + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> listByBillingAccount( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("invoiceName") String invoiceName, + @QueryParam("periodStartDate") String periodStartDate, + @QueryParam("periodEndDate") String periodEndDate, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/default/invoices/{invoiceName}") + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getById( + Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("billingAccountName") String billingAccountName, @PathParam("invoiceName") String invoiceName, @HeaderParam("Accept") String accept, Context context); @@ -130,13 +130,14 @@ Mono>> downloadInvoice( Context context); @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments") + @Post( + "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadMultipleBillingProfileInvoices( + Mono>> downloadMultipleBillingSubscriptionInvoices( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, + @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") List downloadUrls, @HeaderParam("Accept") String accept, Context context); @@ -156,8 +157,7 @@ Mono> listByBillingSubscription( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices" - + "/{invoiceName}") + "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getBySubscriptionAndInvoiceId( @@ -170,8 +170,7 @@ Mono> getBySubscriptionAndInvoiceId( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices" - + "/{invoiceName}/download") + "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> downloadBillingSubscriptionInvoice( @@ -184,16 +183,13 @@ Mono>> downloadBillingSubscriptionInvoice( Context context); @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}" - + "/downloadDocuments") - @ExpectedResponses({200, 202}) + @Get("/providers/Microsoft.Billing/billingAccounts/default/invoices/{invoiceName}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadMultipleBillingSubscriptionInvoices( + Mono> getById( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") List downloadUrls, + @PathParam("invoiceName") String invoiceName, @HeaderParam("Accept") String accept, Context context); @@ -201,7 +197,7 @@ Mono>> downloadMultipleBillingSubscriptionInvoices( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( + Mono> listByBillingProfileNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -211,7 +207,7 @@ Mono> listByBillingAccountNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( + Mono> listByBillingAccountNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -229,10 +225,11 @@ Mono> listByBillingSubscriptionNext( } /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -241,8 +238,8 @@ Mono> listByBillingSubscriptionNext( * @return the list of invoices along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String periodStartDate, String periodEndDate) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -253,6 +250,10 @@ private Mono> listByBillingAccountSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } if (periodStartDate == null) { return Mono .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); @@ -260,16 +261,16 @@ private Mono> listByBillingAccountSinglePageAsync( if (periodEndDate == null) { return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingAccount( + .listByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, + billingProfileName, periodStartDate, periodEndDate, accept, @@ -287,10 +288,11 @@ private Mono> listByBillingAccountSinglePageAsync( } /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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 context The context to associate with this operation. @@ -300,8 +302,12 @@ private Mono> listByBillingAccountSinglePageAsync( * @return the list of invoices along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String periodStartDate, String periodEndDate, Context context) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, + String billingProfileName, + String periodStartDate, + String periodEndDate, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -312,6 +318,10 @@ private Mono> listByBillingAccountSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } if (periodStartDate == null) { return Mono .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); @@ -319,14 +329,14 @@ private Mono> listByBillingAccountSinglePageAsync( if (periodEndDate == null) { return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount( + .listByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, + billingProfileName, periodStartDate, periodEndDate, accept, @@ -343,10 +353,11 @@ private Mono> listByBillingAccountSinglePageAsync( } /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -355,18 +366,21 @@ private Mono> listByBillingAccountSinglePageAsync( * @return the list of invoices as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String periodStartDate, String periodEndDate) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, periodStartDate, periodEndDate), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + () -> + listByBillingProfileSinglePageAsync( + billingAccountName, billingProfileName, periodStartDate, periodEndDate), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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 context The context to associate with this operation. @@ -376,18 +390,25 @@ private PagedFlux listByBillingAccountAsync( * @return the list of invoices as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String periodStartDate, String periodEndDate, Context context) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, + String billingProfileName, + String periodStartDate, + String periodEndDate, + Context context) { return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, periodStartDate, periodEndDate, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + () -> + listByBillingProfileSinglePageAsync( + billingAccountName, billingProfileName, periodStartDate, periodEndDate, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -396,16 +417,18 @@ private PagedFlux listByBillingAccountAsync( * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate)); + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { + return new PagedIterable<>( + listByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate)); } /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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 context The context to associate with this operation. @@ -415,18 +438,282 @@ public PagedIterable listByBillingAccount( * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate, Context context) { + public PagedIterable listByBillingProfile( + String billingAccountName, + String billingProfileName, + String periodStartDate, + String periodEndDate, + Context context) { return new PagedIterable<>( - listByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate, context)); + listByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate, context)); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadMultipleBillingProfileInvoicesWithResponseAsync( + String billingAccountName, List downloadUrls) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (downloadUrls == null) { + return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .downloadMultipleBillingProfileInvoices( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + downloadUrls, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadMultipleBillingProfileInvoicesWithResponseAsync( + String billingAccountName, List downloadUrls, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (downloadUrls == null) { + return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .downloadMultipleBillingProfileInvoices( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + downloadUrls, + accept, + context); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a URL to download multiple invoice documents (invoice pdf, tax + * receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoicesAsync( + String billingAccountName, List downloadUrls) { + Mono>> mono = + downloadMultipleBillingProfileInvoicesWithResponseAsync(billingAccountName, downloadUrls); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DownloadUrlInner.class, + DownloadUrlInner.class, + this.client.getContext()); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a URL to download multiple invoice documents (invoice pdf, tax + * receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoicesAsync( + String billingAccountName, List downloadUrls, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + downloadMultipleBillingProfileInvoicesWithResponseAsync(billingAccountName, downloadUrls, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, context); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a URL to download multiple invoice documents (invoice pdf, tax + * receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( + String billingAccountName, List downloadUrls) { + return this.beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls).getSyncPoller(); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a URL to download multiple invoice documents (invoice pdf, tax + * receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( + String billingAccountName, List downloadUrls, Context context) { + return this + .beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls, context) + .getSyncPoller(); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadMultipleBillingProfileInvoicesAsync( + String billingAccountName, List downloadUrls) { + return beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadMultipleBillingProfileInvoicesAsync( + String billingAccountName, List downloadUrls, Context context) { + return beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadMultipleBillingProfileInvoices( + String billingAccountName, List downloadUrls) { + return downloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls).block(); + } + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadMultipleBillingProfileInvoices( + String billingAccountName, List downloadUrls, Context context) { + return downloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls, context).block(); } /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -435,8 +722,8 @@ public PagedIterable listByBillingAccount( * @return the list of invoices along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, String periodStartDate, String periodEndDate) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -447,10 +734,6 @@ private Mono> listByBillingProfileSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } if (periodStartDate == null) { return Mono .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); @@ -458,17 +741,15 @@ private Mono> listByBillingProfileSinglePageAsync( if (periodEndDate == null) { return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingProfile( + .listByBillingAccount( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, periodStartDate, periodEndDate, accept, @@ -486,11 +767,10 @@ private Mono> listByBillingProfileSinglePageAsync( } /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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. * * @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 context The context to associate with this operation. @@ -500,12 +780,8 @@ private Mono> listByBillingProfileSinglePageAsync( * @return the list of invoices along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, String periodStartDate, String periodEndDate, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -516,10 +792,6 @@ private Mono> listByBillingProfileSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } if (periodStartDate == null) { return Mono .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); @@ -527,15 +799,13 @@ private Mono> listByBillingProfileSinglePageAsync( if (periodEndDate == null) { return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfile( + .listByBillingAccount( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, periodStartDate, periodEndDate, accept, @@ -552,11 +822,10 @@ private Mono> listByBillingProfileSinglePageAsync( } /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -565,21 +834,18 @@ private Mono> listByBillingProfileSinglePageAsync( * @return the list of invoices as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { + private PagedFlux listByBillingAccountAsync( + String billingAccountName, String periodStartDate, String periodEndDate) { return new PagedFlux<>( - () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, periodStartDate, periodEndDate), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + () -> listByBillingAccountSinglePageAsync(billingAccountName, periodStartDate, periodEndDate), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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. * * @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 context The context to associate with this operation. @@ -589,25 +855,18 @@ private PagedFlux listByBillingProfileAsync( * @return the list of invoices as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context) { + private PagedFlux listByBillingAccountAsync( + String billingAccountName, String periodStartDate, String periodEndDate, Context context) { return new PagedFlux<>( - () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, periodStartDate, periodEndDate, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); + () -> listByBillingAccountSinglePageAsync(billingAccountName, periodStartDate, periodEndDate, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -616,18 +875,16 @@ private PagedFlux listByBillingProfileAsync( * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { - return new PagedIterable<>( - listByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate)); + public PagedIterable listByBillingAccount( + String billingAccountName, String periodStartDate, String periodEndDate) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate)); } /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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. * * @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 context The context to associate with this operation. @@ -637,14 +894,10 @@ public PagedIterable listByBillingProfile( * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context) { + public PagedIterable listByBillingAccount( + String billingAccountName, String periodStartDate, String periodEndDate, Context context) { return new PagedIterable<>( - listByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate, context)); + listByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate, context)); } /** @@ -674,13 +927,18 @@ private Mono> getWithResponseAsync(String billingAccountN if (invoiceName == null) { return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get(this.client.getEndpoint(), apiVersion, billingAccountName, invoiceName, accept, context)) + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + invoiceName, + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -713,10 +971,16 @@ private Mono> getWithResponseAsync( if (invoiceName == null) { return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, billingAccountName, invoiceName, accept, context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + invoiceName, + accept, + context); } /** @@ -768,109 +1032,6 @@ public InvoiceInner get(String billingAccountName, String invoiceName) { return getWithResponse(billingAccountName, invoiceName, Context.NONE).getValue(); } - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync(String invoiceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getById(this.client.getEndpoint(), apiVersion, invoiceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync(String invoiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getById(this.client.getEndpoint(), apiVersion, invoiceName, accept, context); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByIdAsync(String invoiceName) { - return getByIdWithResponseAsync(invoiceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByIdWithResponse(String invoiceName, Context context) { - return getByIdWithResponseAsync(invoiceName, context).block(); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InvoiceInner getById(String invoiceName) { - return getByIdWithResponse(invoiceName, Context.NONE).getValue(); - } - /** * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft * Partner Agreement or Microsoft Customer Agreement. @@ -902,7 +1063,6 @@ private Mono>> downloadInvoiceWithResponseAsync( if (downloadToken == null) { return Mono.error(new IllegalArgumentException("Parameter downloadToken is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -910,7 +1070,7 @@ private Mono>> downloadInvoiceWithResponseAsync( service .downloadInvoice( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, invoiceName, downloadToken, @@ -951,12 +1111,17 @@ private Mono>> downloadInvoiceWithResponseAsync( if (downloadToken == null) { return Mono.error(new IllegalArgumentException("Parameter downloadToken is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .downloadInvoice( - this.client.getEndpoint(), apiVersion, billingAccountName, invoiceName, downloadToken, accept, context); + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + invoiceName, + downloadToken, + accept, + context); } /** @@ -1126,11 +1291,9 @@ public DownloadUrlInner downloadInvoice( } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1139,38 +1302,39 @@ public DownloadUrlInner downloadInvoice( * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadMultipleBillingProfileInvoicesWithResponseAsync( - String billingAccountName, List downloadUrls) { + private Mono>> downloadMultipleBillingSubscriptionInvoicesWithResponseAsync( + String subscriptionId, List downloadUrls) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (downloadUrls == null) { return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .downloadMultipleBillingProfileInvoices( - this.client.getEndpoint(), apiVersion, billingAccountName, downloadUrls, accept, context)) + .downloadMultipleBillingSubscriptionInvoices( + this.client.getEndpoint(), + this.client.getApiVersion(), + subscriptionId, + downloadUrls, + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1180,35 +1344,31 @@ private Mono>> downloadMultipleBillingProfileInvoicesW * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadMultipleBillingProfileInvoicesWithResponseAsync( - String billingAccountName, List downloadUrls, Context context) { + private Mono>> downloadMultipleBillingSubscriptionInvoicesWithResponseAsync( + String subscriptionId, List downloadUrls, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (downloadUrls == null) { return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .downloadMultipleBillingProfileInvoices( - this.client.getEndpoint(), apiVersion, billingAccountName, downloadUrls, accept, context); + .downloadMultipleBillingSubscriptionInvoices( + this.client.getEndpoint(), this.client.getApiVersion(), subscriptionId, downloadUrls, accept, context); } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1217,10 +1377,10 @@ private Mono>> downloadMultipleBillingProfileInvoicesW * receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoicesAsync( - String billingAccountName, List downloadUrls) { + private PollerFlux, DownloadUrlInner> + beginDownloadMultipleBillingSubscriptionInvoicesAsync(String subscriptionId, List downloadUrls) { Mono>> mono = - downloadMultipleBillingProfileInvoicesWithResponseAsync(billingAccountName, downloadUrls); + downloadMultipleBillingSubscriptionInvoicesWithResponseAsync(subscriptionId, downloadUrls); return this .client .getLroResult( @@ -1232,11 +1392,9 @@ private PollerFlux, DownloadUrlInner> beginDownload } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1246,11 +1404,12 @@ private PollerFlux, DownloadUrlInner> beginDownload * receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoicesAsync( - String billingAccountName, List downloadUrls, Context context) { + private PollerFlux, DownloadUrlInner> + beginDownloadMultipleBillingSubscriptionInvoicesAsync( + String subscriptionId, List downloadUrls, Context context) { context = this.client.mergeContext(context); Mono>> mono = - downloadMultipleBillingProfileInvoicesWithResponseAsync(billingAccountName, downloadUrls, context); + downloadMultipleBillingSubscriptionInvoicesWithResponseAsync(subscriptionId, downloadUrls, context); return this .client .getLroResult( @@ -1258,11 +1417,9 @@ private PollerFlux, DownloadUrlInner> beginDownload } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1271,17 +1428,15 @@ private PollerFlux, DownloadUrlInner> beginDownload * receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls) { - return this.beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls).getSyncPoller(); + public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( + String subscriptionId, List downloadUrls) { + return this.beginDownloadMultipleBillingSubscriptionInvoicesAsync(subscriptionId, downloadUrls).getSyncPoller(); } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1291,19 +1446,17 @@ public SyncPoller, DownloadUrlInner> beginDownloadM * receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context) { + public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( + String subscriptionId, List downloadUrls, Context context) { return this - .beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls, context) + .beginDownloadMultipleBillingSubscriptionInvoicesAsync(subscriptionId, downloadUrls, context) .getSyncPoller(); } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1312,19 +1465,17 @@ public SyncPoller, DownloadUrlInner> beginDownloadM * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadMultipleBillingProfileInvoicesAsync( - String billingAccountName, List downloadUrls) { - return beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls) + private Mono downloadMultipleBillingSubscriptionInvoicesAsync( + String subscriptionId, List downloadUrls) { + return beginDownloadMultipleBillingSubscriptionInvoicesAsync(subscriptionId, downloadUrls) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1334,19 +1485,17 @@ private Mono downloadMultipleBillingProfileInvoicesAsync( * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadMultipleBillingProfileInvoicesAsync( - String billingAccountName, List downloadUrls, Context context) { - return beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls, context) + private Mono downloadMultipleBillingSubscriptionInvoicesAsync( + String subscriptionId, List downloadUrls, Context context) { + return beginDownloadMultipleBillingSubscriptionInvoicesAsync(subscriptionId, downloadUrls, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1354,17 +1503,15 @@ private Mono downloadMultipleBillingProfileInvoicesAsync( * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls) { - return downloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls).block(); + public DownloadUrlInner downloadMultipleBillingSubscriptionInvoices( + String subscriptionId, List downloadUrls) { + return downloadMultipleBillingSubscriptionInvoicesAsync(subscriptionId, downloadUrls).block(); } /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1373,14 +1520,15 @@ public DownloadUrlInner downloadMultipleBillingProfileInvoices( * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context) { - return downloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls, context).block(); + public DownloadUrlInner downloadMultipleBillingSubscriptionInvoices( + String subscriptionId, List downloadUrls, Context context) { + return downloadMultipleBillingSubscriptionInvoicesAsync(subscriptionId, downloadUrls, context).block(); } /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1390,18 +1538,15 @@ public DownloadUrlInner downloadMultipleBillingProfileInvoices( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingSubscriptionSinglePageAsync( - String periodStartDate, String periodEndDate) { + String subscriptionId, String periodStartDate, String periodEndDate) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (periodStartDate == null) { return Mono @@ -1410,7 +1555,6 @@ private Mono> listByBillingSubscriptionSinglePageAsy if (periodEndDate == null) { return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1418,10 +1562,10 @@ private Mono> listByBillingSubscriptionSinglePageAsy service .listByBillingSubscription( this.client.getEndpoint(), - this.client.getSubscriptionId(), + subscriptionId, periodStartDate, periodEndDate, - apiVersion, + this.client.getApiVersion(), accept, context)) .>map( @@ -1439,6 +1583,7 @@ private Mono> listByBillingSubscriptionSinglePageAsy /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @param context The context to associate with this operation. @@ -1449,18 +1594,15 @@ private Mono> listByBillingSubscriptionSinglePageAsy */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingSubscriptionSinglePageAsync( - String periodStartDate, String periodEndDate, Context context) { + String subscriptionId, String periodStartDate, String periodEndDate, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (periodStartDate == null) { return Mono @@ -1469,16 +1611,15 @@ private Mono> listByBillingSubscriptionSinglePageAsy if (periodEndDate == null) { return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByBillingSubscription( this.client.getEndpoint(), - this.client.getSubscriptionId(), + subscriptionId, periodStartDate, periodEndDate, - apiVersion, + this.client.getApiVersion(), accept, context) .map( @@ -1495,6 +1636,7 @@ private Mono> listByBillingSubscriptionSinglePageAsy /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1503,15 +1645,17 @@ private Mono> listByBillingSubscriptionSinglePageAsy * @return the list of invoices as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingSubscriptionAsync(String periodStartDate, String periodEndDate) { + private PagedFlux listByBillingSubscriptionAsync( + String subscriptionId, String periodStartDate, String periodEndDate) { return new PagedFlux<>( - () -> listByBillingSubscriptionSinglePageAsync(periodStartDate, periodEndDate), + () -> listByBillingSubscriptionSinglePageAsync(subscriptionId, periodStartDate, periodEndDate), nextLink -> listByBillingSubscriptionNextSinglePageAsync(nextLink)); } /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @param context The context to associate with this operation. @@ -1522,15 +1666,16 @@ private PagedFlux listByBillingSubscriptionAsync(String periodStar */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingSubscriptionAsync( - String periodStartDate, String periodEndDate, Context context) { + String subscriptionId, String periodStartDate, String periodEndDate, Context context) { return new PagedFlux<>( - () -> listByBillingSubscriptionSinglePageAsync(periodStartDate, periodEndDate, context), + () -> listByBillingSubscriptionSinglePageAsync(subscriptionId, periodStartDate, periodEndDate, context), nextLink -> listByBillingSubscriptionNextSinglePageAsync(nextLink, context)); } /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1539,13 +1684,15 @@ private PagedFlux listByBillingSubscriptionAsync( * @return the list of invoices as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate) { - return new PagedIterable<>(listByBillingSubscriptionAsync(periodStartDate, periodEndDate)); + public PagedIterable listByBillingSubscription( + String subscriptionId, String periodStartDate, String periodEndDate) { + return new PagedIterable<>(listByBillingSubscriptionAsync(subscriptionId, periodStartDate, periodEndDate)); } /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @param context The context to associate with this operation. @@ -1556,13 +1703,15 @@ public PagedIterable listByBillingSubscription(String periodStartD */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingSubscription( - String periodStartDate, String periodEndDate, Context context) { - return new PagedIterable<>(listByBillingSubscriptionAsync(periodStartDate, periodEndDate, context)); + String subscriptionId, String periodStartDate, String periodEndDate, Context context) { + return new PagedIterable<>( + listByBillingSubscriptionAsync(subscriptionId, periodStartDate, periodEndDate, context)); } /** * Gets an invoice by subscription ID and invoice ID. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1571,23 +1720,20 @@ public PagedIterable listByBillingSubscription( * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBySubscriptionAndInvoiceIdWithResponseAsync(String invoiceName) { + private Mono> getBySubscriptionAndInvoiceIdWithResponseAsync( + String subscriptionId, String invoiceName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (invoiceName == null) { return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1595,9 +1741,9 @@ private Mono> getBySubscriptionAndInvoiceIdWithResponseAs service .getBySubscriptionAndInvoiceId( this.client.getEndpoint(), - this.client.getSubscriptionId(), + subscriptionId, invoiceName, - apiVersion, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1606,6 +1752,7 @@ private Mono> getBySubscriptionAndInvoiceIdWithResponseAs /** * Gets an invoice by subscription ID and invoice ID. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1616,33 +1763,30 @@ private Mono> getBySubscriptionAndInvoiceIdWithResponseAs */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getBySubscriptionAndInvoiceIdWithResponseAsync( - String invoiceName, Context context) { + String subscriptionId, String invoiceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (invoiceName == null) { return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .getBySubscriptionAndInvoiceId( - this.client.getEndpoint(), this.client.getSubscriptionId(), invoiceName, apiVersion, accept, context); + this.client.getEndpoint(), subscriptionId, invoiceName, this.client.getApiVersion(), accept, context); } /** * Gets an invoice by subscription ID and invoice ID. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1650,14 +1794,15 @@ private Mono> getBySubscriptionAndInvoiceIdWithResponseAs * @return an invoice by subscription ID and invoice ID on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getBySubscriptionAndInvoiceIdAsync(String invoiceName) { - return getBySubscriptionAndInvoiceIdWithResponseAsync(invoiceName) + private Mono getBySubscriptionAndInvoiceIdAsync(String subscriptionId, String invoiceName) { + return getBySubscriptionAndInvoiceIdWithResponseAsync(subscriptionId, invoiceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets an invoice by subscription ID and invoice ID. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1666,13 +1811,15 @@ private Mono getBySubscriptionAndInvoiceIdAsync(String invoiceName * @return an invoice by subscription ID and invoice ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, Context context) { - return getBySubscriptionAndInvoiceIdWithResponseAsync(invoiceName, context).block(); + public Response getBySubscriptionAndInvoiceIdWithResponse( + String subscriptionId, String invoiceName, Context context) { + return getBySubscriptionAndInvoiceIdWithResponseAsync(subscriptionId, invoiceName, context).block(); } /** * Gets an invoice by subscription ID and invoice ID. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1680,13 +1827,14 @@ public Response getBySubscriptionAndInvoiceIdWithResponse(String i * @return an invoice by subscription ID and invoice ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - public InvoiceInner getBySubscriptionAndInvoiceId(String invoiceName) { - return getBySubscriptionAndInvoiceIdWithResponse(invoiceName, Context.NONE).getValue(); + public InvoiceInner getBySubscriptionAndInvoiceId(String subscriptionId, String invoiceName) { + return getBySubscriptionAndInvoiceIdWithResponse(subscriptionId, invoiceName, Context.NONE).getValue(); } /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1696,18 +1844,15 @@ public InvoiceInner getBySubscriptionAndInvoiceId(String invoiceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> downloadBillingSubscriptionInvoiceWithResponseAsync( - String invoiceName, String downloadToken) { + String subscriptionId, String invoiceName, String downloadToken) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (invoiceName == null) { return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); @@ -1715,7 +1860,6 @@ private Mono>> downloadBillingSubscriptionInvoiceWithR if (downloadToken == null) { return Mono.error(new IllegalArgumentException("Parameter downloadToken is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1723,8 +1867,8 @@ private Mono>> downloadBillingSubscriptionInvoiceWithR service .downloadBillingSubscriptionInvoice( this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), + this.client.getApiVersion(), + subscriptionId, invoiceName, downloadToken, accept, @@ -1735,6 +1879,7 @@ private Mono>> downloadBillingSubscriptionInvoiceWithR /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @param context The context to associate with this operation. @@ -1745,18 +1890,15 @@ private Mono>> downloadBillingSubscriptionInvoiceWithR */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> downloadBillingSubscriptionInvoiceWithResponseAsync( - String invoiceName, String downloadToken, Context context) { + String subscriptionId, String invoiceName, String downloadToken, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } if (invoiceName == null) { return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); @@ -1764,14 +1906,13 @@ private Mono>> downloadBillingSubscriptionInvoiceWithR if (downloadToken == null) { return Mono.error(new IllegalArgumentException("Parameter downloadToken is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .downloadBillingSubscriptionInvoice( this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), + this.client.getApiVersion(), + subscriptionId, invoiceName, downloadToken, accept, @@ -1781,6 +1922,7 @@ private Mono>> downloadBillingSubscriptionInvoiceWithR /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1790,9 +1932,9 @@ private Mono>> downloadBillingSubscriptionInvoiceWithR */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DownloadUrlInner> beginDownloadBillingSubscriptionInvoiceAsync( - String invoiceName, String downloadToken) { + String subscriptionId, String invoiceName, String downloadToken) { Mono>> mono = - downloadBillingSubscriptionInvoiceWithResponseAsync(invoiceName, downloadToken); + downloadBillingSubscriptionInvoiceWithResponseAsync(subscriptionId, invoiceName, downloadToken); return this .client .getLroResult( @@ -1806,6 +1948,7 @@ private PollerFlux, DownloadUrlInner> beginDownload /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @param context The context to associate with this operation. @@ -1816,10 +1959,10 @@ private PollerFlux, DownloadUrlInner> beginDownload */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DownloadUrlInner> beginDownloadBillingSubscriptionInvoiceAsync( - String invoiceName, String downloadToken, Context context) { + String subscriptionId, String invoiceName, String downloadToken, Context context) { context = this.client.mergeContext(context); Mono>> mono = - downloadBillingSubscriptionInvoiceWithResponseAsync(invoiceName, downloadToken, context); + downloadBillingSubscriptionInvoiceWithResponseAsync(subscriptionId, invoiceName, downloadToken, context); return this .client .getLroResult( @@ -1829,6 +1972,7 @@ private PollerFlux, DownloadUrlInner> beginDownload /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1838,13 +1982,16 @@ private PollerFlux, DownloadUrlInner> beginDownload */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken) { - return this.beginDownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken).getSyncPoller(); + String subscriptionId, String invoiceName, String downloadToken) { + return this + .beginDownloadBillingSubscriptionInvoiceAsync(subscriptionId, invoiceName, downloadToken) + .getSyncPoller(); } /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @param context The context to associate with this operation. @@ -1855,13 +2002,16 @@ public SyncPoller, DownloadUrlInner> beginDownloadB */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken, Context context) { - return this.beginDownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken, context).getSyncPoller(); + String subscriptionId, String invoiceName, String downloadToken, Context context) { + return this + .beginDownloadBillingSubscriptionInvoiceAsync(subscriptionId, invoiceName, downloadToken, context) + .getSyncPoller(); } /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1870,8 +2020,9 @@ public SyncPoller, DownloadUrlInner> beginDownloadB * @return a URL to download an invoice on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadBillingSubscriptionInvoiceAsync(String invoiceName, String downloadToken) { - return beginDownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken) + private Mono downloadBillingSubscriptionInvoiceAsync( + String subscriptionId, String invoiceName, String downloadToken) { + return beginDownloadBillingSubscriptionInvoiceAsync(subscriptionId, invoiceName, downloadToken) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1879,6 +2030,7 @@ private Mono downloadBillingSubscriptionInvoiceAsync(String in /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @param context The context to associate with this operation. @@ -1889,8 +2041,8 @@ private Mono downloadBillingSubscriptionInvoiceAsync(String in */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono downloadBillingSubscriptionInvoiceAsync( - String invoiceName, String downloadToken, Context context) { - return beginDownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken, context) + String subscriptionId, String invoiceName, String downloadToken, Context context) { + return beginDownloadBillingSubscriptionInvoiceAsync(subscriptionId, invoiceName, downloadToken, context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1898,6 +2050,7 @@ private Mono downloadBillingSubscriptionInvoiceAsync( /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1906,13 +2059,15 @@ private Mono downloadBillingSubscriptionInvoiceAsync( * @return a URL to download an invoice. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken) { - return downloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken).block(); + public DownloadUrlInner downloadBillingSubscriptionInvoice( + String subscriptionId, String invoiceName, String downloadToken) { + return downloadBillingSubscriptionInvoiceAsync(subscriptionId, invoiceName, downloadToken).block(); } /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @param context The context to associate with this operation. @@ -1923,235 +2078,111 @@ public DownloadUrlInner downloadBillingSubscriptionInvoice(String invoiceName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public DownloadUrlInner downloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken, Context context) { - return downloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken, context).block(); + String subscriptionId, String invoiceName, String downloadToken, Context context) { + return downloadBillingSubscriptionInvoiceAsync(subscriptionId, invoiceName, downloadToken, context).block(); } /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * - * @param downloadUrls An array of download urls for individual documents. + * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file - * along with {@link Response} on successful completion of {@link Mono}. + * @return an invoice by ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadMultipleBillingSubscriptionInvoicesWithResponseAsync( - List downloadUrls) { + private Mono> getByIdWithResponseAsync(String invoiceName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (downloadUrls == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); + if (invoiceName == null) { + return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .downloadMultipleBillingSubscriptionInvoices( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - downloadUrls, - accept, - context)) + .getById(this.client.getEndpoint(), this.client.getApiVersion(), invoiceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * - * @param downloadUrls An array of download urls for individual documents. + * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file - * along with {@link Response} on successful completion of {@link Mono}. + * @return an invoice by ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadMultipleBillingSubscriptionInvoicesWithResponseAsync( - List downloadUrls, Context context) { + private Mono> getByIdWithResponseAsync(String invoiceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (downloadUrls == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); + if (invoiceName == null) { + return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .downloadMultipleBillingSubscriptionInvoices( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), downloadUrls, accept, context); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a URL to download multiple invoice documents (invoice pdf, tax - * receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> - beginDownloadMultipleBillingSubscriptionInvoicesAsync(List downloadUrls) { - Mono>> mono = - downloadMultipleBillingSubscriptionInvoicesWithResponseAsync(downloadUrls); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DownloadUrlInner.class, - DownloadUrlInner.class, - this.client.getContext()); - } - - /** - * 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a URL to download multiple invoice documents (invoice pdf, tax - * receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> - beginDownloadMultipleBillingSubscriptionInvoicesAsync(List downloadUrls, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - downloadMultipleBillingSubscriptionInvoicesWithResponseAsync(downloadUrls, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, context); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a URL to download multiple invoice documents (invoice pdf, tax - * receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( - List downloadUrls) { - return this.beginDownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls).getSyncPoller(); - } - - /** - * 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a URL to download multiple invoice documents (invoice pdf, tax - * receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( - List downloadUrls, Context context) { - return this.beginDownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls, context).getSyncPoller(); + return service.getById(this.client.getEndpoint(), this.client.getApiVersion(), invoiceName, accept, context); } /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * - * @param downloadUrls An array of download urls for individual documents. + * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file on - * successful completion of {@link Mono}. + * @return an invoice by ID on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadMultipleBillingSubscriptionInvoicesAsync(List downloadUrls) { - return beginDownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono getByIdAsync(String invoiceName) { + return getByIdWithResponseAsync(invoiceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * - * @param downloadUrls An array of download urls for individual documents. + * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadMultipleBillingSubscriptionInvoicesAsync( - List downloadUrls, Context context) { - return beginDownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * @return an invoice by ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(List downloadUrls) { - return downloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls).block(); + public Response getByIdWithResponse(String invoiceName, Context context) { + return getByIdWithResponseAsync(invoiceName, context).block(); } /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. + * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * @return an invoice by ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(List downloadUrls, Context context) { - return downloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls, context).block(); + public InvoiceInner getById(String invoiceName) { + return getByIdWithResponse(invoiceName, Context.NONE).getValue(); } /** @@ -2165,7 +2196,7 @@ public DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(List * @return the list of invoices along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2178,7 +2209,7 @@ private Mono> listByBillingAccountNextSinglePageAsyn final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -2203,7 +2234,7 @@ private Mono> listByBillingAccountNextSinglePageAsyn * @return the list of invoices along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( + private Mono> listByBillingProfileNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -2217,7 +2248,7 @@ private Mono> listByBillingAccountNextSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -2240,7 +2271,7 @@ private Mono> listByBillingAccountNextSinglePageAsyn * @return the list of invoices along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2253,7 +2284,7 @@ private Mono> listByBillingProfileNextSinglePageAsyn final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -2278,7 +2309,7 @@ private Mono> listByBillingProfileNextSinglePageAsyn * @return the list of invoices along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( + private Mono> listByBillingAccountNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -2292,7 +2323,7 @@ private Mono> listByBillingProfileNextSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesImpl.java index 451e916158308..852417e5779db 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesImpl.java @@ -29,20 +29,6 @@ public InvoicesImpl(InvoicesClient innerClient, com.azure.resourcemanager.billin this.serviceManager = serviceManager; } - public PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, periodStartDate, periodEndDate); - return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, periodStartDate, periodEndDate, context); - return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); - } - public PagedIterable listByBillingProfile( String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { PagedIterable inner = @@ -65,30 +51,43 @@ public PagedIterable listByBillingProfile( return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); } - public Response getWithResponse(String billingAccountName, String invoiceName, Context context) { - Response inner = this.serviceClient().getWithResponse(billingAccountName, invoiceName, context); + public DownloadUrl downloadMultipleBillingProfileInvoices(String billingAccountName, List downloadUrls) { + DownloadUrlInner inner = + this.serviceClient().downloadMultipleBillingProfileInvoices(billingAccountName, downloadUrls); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new InvoiceImpl(inner.getValue(), this.manager())); + return new DownloadUrlImpl(inner, this.manager()); } else { return null; } } - public Invoice get(String billingAccountName, String invoiceName) { - InvoiceInner inner = this.serviceClient().get(billingAccountName, invoiceName); + public DownloadUrl downloadMultipleBillingProfileInvoices( + String billingAccountName, List downloadUrls, Context context) { + DownloadUrlInner inner = + this.serviceClient().downloadMultipleBillingProfileInvoices(billingAccountName, downloadUrls, context); if (inner != null) { - return new InvoiceImpl(inner, this.manager()); + return new DownloadUrlImpl(inner, this.manager()); } else { return null; } } - public Response getByIdWithResponse(String invoiceName, Context context) { - Response inner = this.serviceClient().getByIdWithResponse(invoiceName, context); + public PagedIterable listByBillingAccount( + String billingAccountName, String periodStartDate, String periodEndDate) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountName, periodStartDate, periodEndDate); + return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount( + String billingAccountName, String periodStartDate, String periodEndDate, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountName, periodStartDate, periodEndDate, context); + return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String billingAccountName, String invoiceName, Context context) { + Response inner = this.serviceClient().getWithResponse(billingAccountName, invoiceName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -100,8 +99,8 @@ public Response getByIdWithResponse(String invoiceName, Context context } } - public Invoice getById(String invoiceName) { - InvoiceInner inner = this.serviceClient().getById(invoiceName); + public Invoice get(String billingAccountName, String invoiceName) { + InvoiceInner inner = this.serviceClient().get(billingAccountName, invoiceName); if (inner != null) { return new InvoiceImpl(inner, this.manager()); } else { @@ -129,9 +128,9 @@ public DownloadUrl downloadInvoice( } } - public DownloadUrl downloadMultipleBillingProfileInvoices(String billingAccountName, List downloadUrls) { + public DownloadUrl downloadMultipleBillingSubscriptionInvoices(String subscriptionId, List downloadUrls) { DownloadUrlInner inner = - this.serviceClient().downloadMultipleBillingProfileInvoices(billingAccountName, downloadUrls); + this.serviceClient().downloadMultipleBillingSubscriptionInvoices(subscriptionId, downloadUrls); if (inner != null) { return new DownloadUrlImpl(inner, this.manager()); } else { @@ -139,10 +138,10 @@ public DownloadUrl downloadMultipleBillingProfileInvoices(String billingAccountN } } - public DownloadUrl downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context) { + public DownloadUrl downloadMultipleBillingSubscriptionInvoices( + String subscriptionId, List downloadUrls, Context context) { DownloadUrlInner inner = - this.serviceClient().downloadMultipleBillingProfileInvoices(billingAccountName, downloadUrls, context); + this.serviceClient().downloadMultipleBillingSubscriptionInvoices(subscriptionId, downloadUrls, context); if (inner != null) { return new DownloadUrlImpl(inner, this.manager()); } else { @@ -150,22 +149,24 @@ public DownloadUrl downloadMultipleBillingProfileInvoices( } } - public PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate) { + public PagedIterable listByBillingSubscription( + String subscriptionId, String periodStartDate, String periodEndDate) { PagedIterable inner = - this.serviceClient().listByBillingSubscription(periodStartDate, periodEndDate); + this.serviceClient().listByBillingSubscription(subscriptionId, periodStartDate, periodEndDate); return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); } public PagedIterable listByBillingSubscription( - String periodStartDate, String periodEndDate, Context context) { + String subscriptionId, String periodStartDate, String periodEndDate, Context context) { PagedIterable inner = - this.serviceClient().listByBillingSubscription(periodStartDate, periodEndDate, context); + this.serviceClient().listByBillingSubscription(subscriptionId, periodStartDate, periodEndDate, context); return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); } - public Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, Context context) { + public Response getBySubscriptionAndInvoiceIdWithResponse( + String subscriptionId, String invoiceName, Context context) { Response inner = - this.serviceClient().getBySubscriptionAndInvoiceIdWithResponse(invoiceName, context); + this.serviceClient().getBySubscriptionAndInvoiceIdWithResponse(subscriptionId, invoiceName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -177,8 +178,8 @@ public Response getBySubscriptionAndInvoiceIdWithResponse(String invoic } } - public Invoice getBySubscriptionAndInvoiceId(String invoiceName) { - InvoiceInner inner = this.serviceClient().getBySubscriptionAndInvoiceId(invoiceName); + public Invoice getBySubscriptionAndInvoiceId(String subscriptionId, String invoiceName) { + InvoiceInner inner = this.serviceClient().getBySubscriptionAndInvoiceId(subscriptionId, invoiceName); if (inner != null) { return new InvoiceImpl(inner, this.manager()); } else { @@ -186,8 +187,10 @@ public Invoice getBySubscriptionAndInvoiceId(String invoiceName) { } } - public DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken) { - DownloadUrlInner inner = this.serviceClient().downloadBillingSubscriptionInvoice(invoiceName, downloadToken); + public DownloadUrl downloadBillingSubscriptionInvoice( + String subscriptionId, String invoiceName, String downloadToken) { + DownloadUrlInner inner = + this.serviceClient().downloadBillingSubscriptionInvoice(subscriptionId, invoiceName, downloadToken); if (inner != null) { return new DownloadUrlImpl(inner, this.manager()); } else { @@ -195,9 +198,12 @@ public DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String } } - public DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken, Context context) { + public DownloadUrl downloadBillingSubscriptionInvoice( + String subscriptionId, String invoiceName, String downloadToken, Context context) { DownloadUrlInner inner = - this.serviceClient().downloadBillingSubscriptionInvoice(invoiceName, downloadToken, context); + this + .serviceClient() + .downloadBillingSubscriptionInvoice(subscriptionId, invoiceName, downloadToken, context); if (inner != null) { return new DownloadUrlImpl(inner, this.manager()); } else { @@ -205,20 +211,23 @@ public DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String } } - public DownloadUrl downloadMultipleBillingSubscriptionInvoices(List downloadUrls) { - DownloadUrlInner inner = this.serviceClient().downloadMultipleBillingSubscriptionInvoices(downloadUrls); + public Response getByIdWithResponse(String invoiceName, Context context) { + Response inner = this.serviceClient().getByIdWithResponse(invoiceName, context); if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new InvoiceImpl(inner.getValue(), this.manager())); } else { return null; } } - public DownloadUrl downloadMultipleBillingSubscriptionInvoices(List downloadUrls, Context context) { - DownloadUrlInner inner = - this.serviceClient().downloadMultipleBillingSubscriptionInvoices(downloadUrls, context); + public Invoice getById(String invoiceName) { + InvoiceInner inner = this.serviceClient().getById(invoiceName); if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); + return new InvoiceImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationImpl.java index 3c68be9db33eb..99e54f5eed969 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationImpl.java @@ -18,16 +18,16 @@ public final class OperationImpl implements Operation { this.serviceManager = serviceManager; } - public String name() { - return this.innerModel().name(); + public OperationDisplay display() { + return this.innerModel().display(); } public Boolean isDataAction() { return this.innerModel().isDataAction(); } - public OperationDisplay display() { - return this.innerModel().display(); + public String name() { + return this.innerModel().name(); } public OperationInner innerModel() { diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsClientImpl.java index 50522ff957bd9..7c52d0c0b2eca 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsClientImpl.java @@ -93,10 +93,10 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -127,11 +127,10 @@ private Mono> listSinglePageAsync(Context context) new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodImpl.java new file mode 100644 index 0000000000000..dc99db50dd8f5 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodImpl.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodInner; +import com.azure.resourcemanager.billing.models.PaymentMethod; +import com.azure.resourcemanager.billing.models.PaymentMethodFamily; +import com.azure.resourcemanager.billing.models.PaymentMethodLogo; +import com.azure.resourcemanager.billing.models.PaymentMethodStatus; +import java.util.Collections; +import java.util.List; + +public final class PaymentMethodImpl implements PaymentMethod { + private PaymentMethodInner innerObject; + + private final com.azure.resourcemanager.billing.BillingManager serviceManager; + + PaymentMethodImpl(PaymentMethodInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String accountHolderName() { + return this.innerModel().accountHolderName(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String expiration() { + return this.innerModel().expiration(); + } + + public PaymentMethodFamily family() { + return this.innerModel().family(); + } + + public String lastFourDigits() { + return this.innerModel().lastFourDigits(); + } + + public List logos() { + List inner = this.innerModel().logos(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PaymentMethodStatus status() { + return this.innerModel().status(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public PaymentMethodInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.billing.BillingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodLinkImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodLinkImpl.java new file mode 100644 index 0000000000000..69d7b3115edd0 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodLinkImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodLinkInner; +import com.azure.resourcemanager.billing.models.PaymentMethodLink; +import com.azure.resourcemanager.billing.models.PaymentMethodProjectionProperties; + +public final class PaymentMethodLinkImpl implements PaymentMethodLink { + private PaymentMethodLinkInner innerObject; + + private final com.azure.resourcemanager.billing.BillingManager serviceManager; + + PaymentMethodLinkImpl( + PaymentMethodLinkInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PaymentMethodProjectionProperties paymentMethod() { + return this.innerModel().paymentMethod(); + } + + public PaymentMethodLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.billing.BillingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodsClientImpl.java new file mode 100644 index 0000000000000..ee54bc58d2c53 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodsClientImpl.java @@ -0,0 +1,1348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.billing.fluent.PaymentMethodsClient; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodInner; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodLinkInner; +import com.azure.resourcemanager.billing.models.PaymentMethodLinksListResult; +import com.azure.resourcemanager.billing.models.PaymentMethodsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PaymentMethodsClient. */ +public final class PaymentMethodsClientImpl implements PaymentMethodsClient { + /** The proxy service used to perform REST calls. */ + private final PaymentMethodsService service; + + /** The service client containing this operation class. */ + private final BillingManagementClientImpl client; + + /** + * Initializes an instance of PaymentMethodsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PaymentMethodsClientImpl(BillingManagementClientImpl client) { + this.service = + RestProxy.create(PaymentMethodsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BillingManagementClientPaymentMethods to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BillingManagementCli") + public interface PaymentMethodsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethodLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingProfile( + @HostParam("$host") String endpoint, + @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethodLinks/{paymentMethodName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByBillingProfile( + @HostParam("$host") String endpoint, + @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, + @PathParam("paymentMethodName") String paymentMethodName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccount( + @HostParam("$host") String endpoint, + @PathParam("billingAccountName") String billingAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods/{paymentMethodName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByBillingAccount( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("billingAccountName") String billingAccountName, + @PathParam("paymentMethodName") String paymentMethodName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/paymentMethods") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByUser( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/providers/Microsoft.Billing/paymentMethods/{paymentMethodName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteByUser( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("paymentMethodName") String paymentMethodName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/paymentMethods/{paymentMethodName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByUser( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("paymentMethodName") String paymentMethodName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingProfileNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByUserNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName, Context context) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method linked with a billing profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByBillingProfileWithResponseAsync( + String billingAccountName, String billingProfileName, String paymentMethodName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } + if (paymentMethodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paymentMethodName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByBillingProfile( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + paymentMethodName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method linked with a billing profile along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByBillingProfileWithResponseAsync( + String billingAccountName, String billingProfileName, String paymentMethodName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } + if (paymentMethodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paymentMethodName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByBillingProfile( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + paymentMethodName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method linked with a billing profile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByBillingProfileAsync( + String billingAccountName, String billingProfileName, String paymentMethodName) { + return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, paymentMethodName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method linked with a billing profile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String paymentMethodName, Context context) { + return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, paymentMethodName, context) + .block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method linked with a billing profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PaymentMethodLinkInner getByBillingProfile( + String billingAccountName, String billingProfileName, String paymentMethodName) { + return getByBillingProfileWithResponse(billingAccountName, billingProfileName, paymentMethodName, Context.NONE) + .getValue(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync(String billingAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByBillingAccount( + this.client.getEndpoint(), + billingAccountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingAccount( + this.client.getEndpoint(), billingAccountName, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountName) { + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountName), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountName, Context context) { + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountName, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount(String billingAccountName) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount(String billingAccountName, Context context) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method available for a billing account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByBillingAccountWithResponseAsync( + String billingAccountName, String paymentMethodName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (paymentMethodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paymentMethodName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByBillingAccount( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + paymentMethodName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method available for a billing account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByBillingAccountWithResponseAsync( + String billingAccountName, String paymentMethodName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); + } + if (paymentMethodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paymentMethodName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByBillingAccount( + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + paymentMethodName, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method available for a billing account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByBillingAccountAsync(String billingAccountName, String paymentMethodName) { + return getByBillingAccountWithResponseAsync(billingAccountName, paymentMethodName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method available for a billing account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByBillingAccountWithResponse( + String billingAccountName, String paymentMethodName, Context context) { + return getByBillingAccountWithResponseAsync(billingAccountName, paymentMethodName, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method available for a billing account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PaymentMethodInner getByBillingAccount(String billingAccountName, String paymentMethodName) { + return getByBillingAccountWithResponse(billingAccountName, paymentMethodName, Context.NONE).getValue(); + } + + /** + * Lists the payment methods owned by the caller. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByUser(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the payment methods owned by the caller. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByUser(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the payment methods owned by the caller. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByUserAsync() { + return new PagedFlux<>(() -> listByUserSinglePageAsync(), nextLink -> listByUserNextSinglePageAsync(nextLink)); + } + + /** + * Lists the payment methods owned by the caller. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByUserAsync(Context context) { + return new PagedFlux<>( + () -> listByUserSinglePageAsync(context), nextLink -> listByUserNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the payment methods owned by the caller. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByUser() { + return new PagedIterable<>(listByUserAsync()); + } + + /** + * Lists the payment methods owned by the caller. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByUser(Context context) { + return new PagedIterable<>(listByUserAsync(context)); + } + + /** + * Deletes a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByUserWithResponseAsync(String paymentMethodName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (paymentMethodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paymentMethodName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteByUser( + this.client.getEndpoint(), this.client.getApiVersion(), paymentMethodName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByUserWithResponseAsync(String paymentMethodName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (paymentMethodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paymentMethodName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteByUser(this.client.getEndpoint(), this.client.getApiVersion(), paymentMethodName, accept, context); + } + + /** + * Deletes a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteByUserAsync(String paymentMethodName) { + return deleteByUserWithResponseAsync(paymentMethodName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteByUserWithResponse(String paymentMethodName, Context context) { + return deleteByUserWithResponseAsync(paymentMethodName, context).block(); + } + + /** + * Deletes a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteByUser(String paymentMethodName) { + deleteByUserWithResponse(paymentMethodName, Context.NONE); + } + + /** + * Gets a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method owned by the caller along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByUserWithResponseAsync(String paymentMethodName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (paymentMethodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paymentMethodName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByUser( + this.client.getEndpoint(), this.client.getApiVersion(), paymentMethodName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method owned by the caller along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByUserWithResponseAsync(String paymentMethodName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (paymentMethodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter paymentMethodName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByUser(this.client.getEndpoint(), this.client.getApiVersion(), paymentMethodName, accept, context); + } + + /** + * Gets a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method owned by the caller on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByUserAsync(String paymentMethodName) { + return getByUserWithResponseAsync(paymentMethodName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method owned by the caller along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByUserWithResponse(String paymentMethodName, Context context) { + return getByUserWithResponseAsync(paymentMethodName, context).block(); + } + + /** + * Gets a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method owned by the caller. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PaymentMethodInner getByUser(String paymentMethodName) { + return getByUserWithResponse(paymentMethodName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByUserNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByUserNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodsImpl.java new file mode 100644 index 0000000000000..c8d7c971c1b24 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PaymentMethodsImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.billing.fluent.PaymentMethodsClient; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodInner; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodLinkInner; +import com.azure.resourcemanager.billing.models.PaymentMethod; +import com.azure.resourcemanager.billing.models.PaymentMethodLink; +import com.azure.resourcemanager.billing.models.PaymentMethods; + +public final class PaymentMethodsImpl implements PaymentMethods { + private static final ClientLogger LOGGER = new ClientLogger(PaymentMethodsImpl.class); + + private final PaymentMethodsClient innerClient; + + private final com.azure.resourcemanager.billing.BillingManager serviceManager; + + public PaymentMethodsImpl( + PaymentMethodsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); + return Utils.mapPage(inner, inner1 -> new PaymentMethodLinkImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); + return Utils.mapPage(inner, inner1 -> new PaymentMethodLinkImpl(inner1, this.manager())); + } + + public Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String paymentMethodName, Context context) { + Response inner = + this + .serviceClient() + .getByBillingProfileWithResponse(billingAccountName, billingProfileName, paymentMethodName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PaymentMethodLinkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PaymentMethodLink getByBillingProfile( + String billingAccountName, String billingProfileName, String paymentMethodName) { + PaymentMethodLinkInner inner = + this.serviceClient().getByBillingProfile(billingAccountName, billingProfileName, paymentMethodName); + if (inner != null) { + return new PaymentMethodLinkImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByBillingAccount(String billingAccountName) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); + return Utils.mapPage(inner, inner1 -> new PaymentMethodImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountName, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountName, context); + return Utils.mapPage(inner, inner1 -> new PaymentMethodImpl(inner1, this.manager())); + } + + public Response getByBillingAccountWithResponse( + String billingAccountName, String paymentMethodName, Context context) { + Response inner = + this.serviceClient().getByBillingAccountWithResponse(billingAccountName, paymentMethodName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PaymentMethodImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PaymentMethod getByBillingAccount(String billingAccountName, String paymentMethodName) { + PaymentMethodInner inner = this.serviceClient().getByBillingAccount(billingAccountName, paymentMethodName); + if (inner != null) { + return new PaymentMethodImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByUser() { + PagedIterable inner = this.serviceClient().listByUser(); + return Utils.mapPage(inner, inner1 -> new PaymentMethodImpl(inner1, this.manager())); + } + + public PagedIterable listByUser(Context context) { + PagedIterable inner = this.serviceClient().listByUser(context); + return Utils.mapPage(inner, inner1 -> new PaymentMethodImpl(inner1, this.manager())); + } + + public Response deleteByUserWithResponse(String paymentMethodName, Context context) { + return this.serviceClient().deleteByUserWithResponse(paymentMethodName, context); + } + + public void deleteByUser(String paymentMethodName) { + this.serviceClient().deleteByUser(paymentMethodName); + } + + public Response getByUserWithResponse(String paymentMethodName, Context context) { + Response inner = this.serviceClient().getByUserWithResponse(paymentMethodName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PaymentMethodImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PaymentMethod getByUser(String paymentMethodName) { + PaymentMethodInner inner = this.serviceClient().getByUser(paymentMethodName); + if (inner != null) { + return new PaymentMethodImpl(inner, this.manager()); + } else { + return null; + } + } + + private PaymentMethodsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.billing.BillingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java index b4434dc1de790..68943a1bddc7b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java @@ -55,8 +55,7 @@ public final class PoliciesClientImpl implements PoliciesClient { public interface PoliciesService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/policies/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByBillingProfile( @@ -69,8 +68,7 @@ Mono> getByBillingProfile( @Headers({"Content-Type: application/json"}) @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/policies/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -84,8 +82,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies" - + "/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByCustomer( @@ -98,8 +95,7 @@ Mono> getByCustomer( @Headers({"Content-Type: application/json"}) @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies" - + "/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> updateCustomer( @@ -140,7 +136,6 @@ private Mono> getByBillingProfileWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -150,7 +145,7 @@ private Mono> getByBillingProfileWithResponseAsync( this.client.getEndpoint(), billingAccountName, billingProfileName, - apiVersion, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -185,12 +180,16 @@ private Mono> getByBillingProfileWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByBillingProfile( - this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, accept, context); + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + this.client.getApiVersion(), + accept, + context); } /** @@ -278,7 +277,6 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -286,7 +284,7 @@ private Mono> updateWithResponseAsync( service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, parameters, @@ -330,13 +328,12 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, billingProfileName, parameters, @@ -426,14 +423,18 @@ private Mono> getByCustomerWithResponseAsync( if (customerName == null) { return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service .getByCustomer( - this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context)) + this.client.getEndpoint(), + billingAccountName, + customerName, + this.client.getApiVersion(), + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -465,11 +466,16 @@ private Mono> getByCustomerWithResponseAsync( if (customerName == null) { return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByCustomer(this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context); + .getByCustomer( + this.client.getEndpoint(), + billingAccountName, + customerName, + this.client.getApiVersion(), + accept, + context); } /** @@ -556,7 +562,6 @@ private Mono> updateCustomerWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -564,7 +569,7 @@ private Mono> updateCustomerWithResponseAsync( service .updateCustomer( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, customerName, parameters, @@ -607,12 +612,17 @@ private Mono> updateCustomerWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .updateCustomer( - this.client.getEndpoint(), apiVersion, billingAccountName, customerName, parameters, accept, context); + this.client.getEndpoint(), + this.client.getApiVersion(), + billingAccountName, + customerName, + parameters, + accept, + context); } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PolicyImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PolicyImpl.java index 082c8eb531013..f0ef97720296e 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PolicyImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PolicyImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.PolicyInner; import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; import com.azure.resourcemanager.billing.models.Policy; @@ -32,6 +33,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public MarketplacePurchasesPolicy marketplacePurchases() { return this.innerModel().marketplacePurchases(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductImpl.java index fc58f601ea94d..8cdec04d3340d 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.ProductInner; import com.azure.resourcemanager.billing.models.Amount; import com.azure.resourcemanager.billing.models.AutoRenew; @@ -35,92 +36,96 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public AutoRenew autoRenew() { return this.innerModel().autoRenew(); } - public String displayName() { - return this.innerModel().displayName(); + public String availabilityId() { + return this.innerModel().availabilityId(); } - public OffsetDateTime purchaseDate() { - return this.innerModel().purchaseDate(); + public BillingFrequency billingFrequency() { + return this.innerModel().billingFrequency(); } - public String productTypeId() { - return this.innerModel().productTypeId(); + public String billingProfileDisplayName() { + return this.innerModel().billingProfileDisplayName(); } - public String productType() { - return this.innerModel().productType(); + public String billingProfileId() { + return this.innerModel().billingProfileId(); } - public ProductStatusType status() { - return this.innerModel().status(); + public String customerDisplayName() { + return this.innerModel().customerDisplayName(); } - public OffsetDateTime endDate() { - return this.innerModel().endDate(); + public String customerId() { + return this.innerModel().customerId(); } - public BillingFrequency billingFrequency() { - return this.innerModel().billingFrequency(); + public String displayName() { + return this.innerModel().displayName(); } - public Amount lastCharge() { - return this.innerModel().lastCharge(); + public OffsetDateTime endDate() { + return this.innerModel().endDate(); } - public OffsetDateTime lastChargeDate() { - return this.innerModel().lastChargeDate(); + public String invoiceSectionDisplayName() { + return this.innerModel().invoiceSectionDisplayName(); } - public Float quantity() { - return this.innerModel().quantity(); + public String invoiceSectionId() { + return this.innerModel().invoiceSectionId(); } - public String skuId() { - return this.innerModel().skuId(); + public Amount lastCharge() { + return this.innerModel().lastCharge(); } - public String skuDescription() { - return this.innerModel().skuDescription(); + public OffsetDateTime lastChargeDate() { + return this.innerModel().lastChargeDate(); } - public String tenantId() { - return this.innerModel().tenantId(); + public String productType() { + return this.innerModel().productType(); } - public String availabilityId() { - return this.innerModel().availabilityId(); + public String productTypeId() { + return this.innerModel().productTypeId(); } - public String invoiceSectionId() { - return this.innerModel().invoiceSectionId(); + public OffsetDateTime purchaseDate() { + return this.innerModel().purchaseDate(); } - public String invoiceSectionDisplayName() { - return this.innerModel().invoiceSectionDisplayName(); + public Float quantity() { + return this.innerModel().quantity(); } - public String billingProfileId() { - return this.innerModel().billingProfileId(); + public Reseller reseller() { + return this.innerModel().reseller(); } - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); + public String skuDescription() { + return this.innerModel().skuDescription(); } - public String customerId() { - return this.innerModel().customerId(); + public String skuId() { + return this.innerModel().skuId(); } - public String customerDisplayName() { - return this.innerModel().customerDisplayName(); + public ProductStatusType status() { + return this.innerModel().status(); } - public Reseller reseller() { - return this.innerModel().reseller(); + public String tenantId() { + return this.innerModel().tenantId(); } public ProductInner innerModel() { diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java index 6dbdf32dc329e..888dd5939bfbd 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java @@ -62,55 +62,53 @@ public final class ProductsClientImpl implements ProductsClient { @ServiceInterface(name = "BillingManagementCli") public interface ProductsService { @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomer( + Mono> listByInvoiceSection( @HostParam("$host") String endpoint, @PathParam("billingAccountName") String billingAccountName, - @PathParam("customerName") String customerName, + @PathParam("billingProfileName") String billingProfileName, + @PathParam("invoiceSectionName") String invoiceSectionName, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/products") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/products") + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( + Mono> listByCustomer( @HostParam("$host") String endpoint, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, + @PathParam("customerName") String customerName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/products") + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSection( + Mono> listByBillingAccount( @HostParam("$host") String endpoint, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, @@ -156,8 +154,7 @@ Mono move( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}" - + "/validateMoveEligibility") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/validateMoveEligibility") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> validateMove( @@ -173,7 +170,7 @@ Mono> validateMove( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomerNext( + Mono> listByInvoiceSectionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -183,7 +180,7 @@ Mono> listByCustomerNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( + Mono> listByBillingProfileNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -193,7 +190,7 @@ Mono> listByBillingAccountNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( + Mono> listByCustomerNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -203,7 +200,7 @@ Mono> listByBillingProfileNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSectionNext( + Mono> listByBillingAccountNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -211,19 +208,23 @@ Mono> listByInvoiceSectionNext( } /** - * 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 filter 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 (:). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName) { + private Mono> listByInvoiceSectionSinglePageAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName, String filter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -234,17 +235,28 @@ private Mono> listByCustomerSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByCustomer( - this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context)) + .listByInvoiceSection( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + invoiceSectionName, + this.client.getApiVersion(), + filter, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -258,11 +270,15 @@ private Mono> listByCustomerSinglePageAsync( } /** - * 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 filter 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 (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -270,8 +286,12 @@ private Mono> listByCustomerSinglePageAsync( * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName, Context context) { + private Mono> listByInvoiceSectionSinglePageAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String filter, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -282,14 +302,26 @@ private Mono> listByCustomerSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } + if (invoiceSectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByCustomer(this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context) + .listByInvoiceSection( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + invoiceSectionName, + this.client.getApiVersion(), + filter, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -302,29 +334,61 @@ private Mono> listByCustomerSinglePageAsync( } /** - * 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 filter 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 (:). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync(String billingAccountName, String customerName) { + private PagedFlux listByInvoiceSectionAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName, String filter) { return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName), - nextLink -> listByCustomerNextSinglePageAsync(nextLink)); + () -> + listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName, filter), + nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); } /** - * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of products as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByInvoiceSectionAsync( + String billingAccountName, String billingProfileName, String invoiceSectionName) { + final String filter = null; + return new PagedFlux<>( + () -> + listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName, filter), + nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); + } + + /** + * 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 filter 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 (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -332,35 +396,49 @@ private PagedFlux listByCustomerAsync(String billingAccountName, S * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync( - String billingAccountName, String customerName, Context context) { + private PagedFlux listByInvoiceSectionAsync( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String filter, + Context context) { return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName, context), - nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); + () -> + listByInvoiceSectionSinglePageAsync( + billingAccountName, billingProfileName, invoiceSectionName, filter, context), + nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer(String billingAccountName, String customerName) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName)); + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName) { + final String filter = null; + return new PagedIterable<>( + listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, filter)); } /** - * 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 filter 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 (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -368,15 +446,22 @@ public PagedIterable listByCustomer(String billingAccountName, Str * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer(String billingAccountName, String customerName, Context context) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName, context)); + public PagedIterable listByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String filter, + Context context) { + return new PagedIterable<>( + listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, filter, context)); } /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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 filter 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 (:). @@ -386,8 +471,8 @@ public PagedIterable listByCustomer(String billingAccountName, Str * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String filter) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName, String filter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -398,14 +483,23 @@ private Mono> listByBillingAccountSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingAccount( - this.client.getEndpoint(), billingAccountName, apiVersion, filter, accept, context)) + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + this.client.getApiVersion(), + filter, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -419,10 +513,11 @@ private Mono> listByBillingAccountSinglePageAsync( } /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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 filter 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 (:). @@ -433,8 +528,8 @@ private Mono> listByBillingAccountSinglePageAsync( * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String filter, Context context) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, String billingProfileName, String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -445,11 +540,21 @@ private Mono> listByBillingAccountSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount(this.client.getEndpoint(), billingAccountName, apiVersion, filter, accept, context) + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountName, + billingProfileName, + this.client.getApiVersion(), + filter, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -462,10 +567,11 @@ private Mono> listByBillingAccountSinglePageAsync( } /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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 filter 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 (:). @@ -475,35 +581,38 @@ private Mono> listByBillingAccountSinglePageAsync( * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName, String filter) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName, String filter) { return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, filter), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { + private PagedFlux listByBillingProfileAsync(String billingAccountName, String billingProfileName) { final String filter = null; return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, filter), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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 filter 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 (:). @@ -514,34 +623,36 @@ private PagedFlux listByBillingAccountAsync(String billingAccountN * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String filter, Context context) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName, String filter, Context context) { return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, filter, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { + public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { final String filter = null; - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, filter)); + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, filter)); } /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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 filter 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 (:). @@ -552,27 +663,25 @@ public PagedIterable listByBillingAccount(String billingAccountNam * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, filter, context)); + public PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, String filter, Context context) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, filter, context)); } /** - * 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 filter 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 (:). + * @param customerName The ID that uniquely identifies a customer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, String filter) { + private Mono> listByCustomerSinglePageAsync( + String billingAccountName, String customerName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -583,22 +692,19 @@ private Mono> listByBillingProfileSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + if (customerName == null) { + return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingProfile( + .listByCustomer( this.client.getEndpoint(), billingAccountName, - billingProfileName, - apiVersion, - filter, + customerName, + this.client.getApiVersion(), accept, context)) .>map( @@ -614,14 +720,11 @@ private Mono> listByBillingProfileSinglePageAsync( } /** - * 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 filter 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 (:). + * @param customerName The ID that uniquely identifies a customer. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -629,8 +732,8 @@ private Mono> listByBillingProfileSinglePageAsync( * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, String filter, Context context) { + private Mono> listByCustomerSinglePageAsync( + String billingAccountName, String customerName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -641,77 +744,54 @@ private Mono> listByBillingProfileSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * 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 filter 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 (:). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, String filter) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + if (customerName == null) { + return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCustomer( + this.client.getEndpoint(), + billingAccountName, + customerName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync(String billingAccountName, String billingProfileName) { - final String filter = null; + private PagedFlux listByCustomerAsync(String billingAccountName, String customerName) { return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + () -> listByCustomerSinglePageAsync(billingAccountName, customerName), + nextLink -> listByCustomerNextSinglePageAsync(nextLink)); } /** - * 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 filter 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 (:). + * @param customerName The ID that uniquely identifies a customer. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -719,39 +799,35 @@ private PagedFlux listByBillingProfileAsync(String billingAccountN * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, String filter, Context context) { + private PagedFlux listByCustomerAsync( + String billingAccountName, String customerName, Context context) { return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); + () -> listByCustomerSinglePageAsync(billingAccountName, customerName, context), + nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - final String filter = null; - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, filter)); + public PagedIterable listByCustomer(String billingAccountName, String customerName) { + return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName)); } /** - * 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 filter 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 (:). + * @param customerName The ID that uniquely identifies a customer. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -759,18 +835,15 @@ public PagedIterable listByBillingProfile(String billingAccountNam * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String filter, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, filter, context)); + public PagedIterable listByCustomer(String billingAccountName, String customerName, Context context) { + return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName, context)); } /** - * 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 filter 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 (:). @@ -780,8 +853,8 @@ public PagedIterable listByBillingProfile( * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, String filter) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, String filter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -792,26 +865,15 @@ private Mono> listByInvoiceSectionSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByInvoiceSection( + .listByBillingAccount( this.client.getEndpoint(), billingAccountName, - billingProfileName, - invoiceSectionName, - apiVersion, + this.client.getApiVersion(), filter, accept, context)) @@ -828,12 +890,10 @@ private Mono> listByInvoiceSectionSinglePageAsync( } /** - * 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 filter 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 (:). @@ -844,12 +904,8 @@ private Mono> listByInvoiceSectionSinglePageAsync( * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -860,27 +916,11 @@ private Mono> listByInvoiceSectionSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByInvoiceSection( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - invoiceSectionName, - apiVersion, - filter, - accept, - context) + .listByBillingAccount( + this.client.getEndpoint(), billingAccountName, this.client.getApiVersion(), filter, accept, context) .map( res -> new PagedResponseBase<>( @@ -893,12 +933,10 @@ private Mono> listByInvoiceSectionSinglePageAsync( } /** - * 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 filter 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 (:). @@ -908,43 +946,35 @@ private Mono> listByInvoiceSectionSinglePageAsync( * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, String filter) { + private PagedFlux listByBillingAccountAsync(String billingAccountName, String filter) { return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName, filter), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); + () -> listByBillingAccountSinglePageAsync(billingAccountName, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { + private PagedFlux listByBillingAccountAsync(String billingAccountName) { final String filter = null; return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName, filter), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); + () -> listByBillingAccountSinglePageAsync(billingAccountName, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * 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 filter 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 (:). @@ -955,46 +985,34 @@ private PagedFlux listByInvoiceSectionAsync( * @return the list of products as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context) { + private PagedFlux listByBillingAccountAsync( + String billingAccountName, String filter, Context context) { return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync( - billingAccountName, billingProfileName, invoiceSectionName, filter, context), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); + () -> listByBillingAccountSinglePageAsync(billingAccountName, filter, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { + public PagedIterable listByBillingAccount(String billingAccountName) { final String filter = null; - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, filter)); + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, filter)); } /** - * 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 filter 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 (:). @@ -1005,14 +1023,8 @@ public PagedIterable listByInvoiceSection( * @return the list of products as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, filter, context)); + public PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, filter, context)); } /** @@ -1041,13 +1053,18 @@ private Mono> getWithResponseAsync(String billingAccountN if (productName == null) { return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .get(this.client.getEndpoint(), billingAccountName, productName, apiVersion, accept, context)) + .get( + this.client.getEndpoint(), + billingAccountName, + productName, + this.client.getApiVersion(), + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1079,10 +1096,16 @@ private Mono> getWithResponseAsync( if (productName == null) { return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), billingAccountName, productName, apiVersion, accept, context); + return service + .get( + this.client.getEndpoint(), + billingAccountName, + productName, + this.client.getApiVersion(), + accept, + context); } /** @@ -1167,7 +1190,6 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1177,7 +1199,7 @@ private Mono> updateWithResponseAsync( this.client.getEndpoint(), billingAccountName, productName, - apiVersion, + this.client.getApiVersion(), parameters, accept, context)) @@ -1218,12 +1240,17 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( - this.client.getEndpoint(), billingAccountName, productName, apiVersion, parameters, accept, context); + this.client.getEndpoint(), + billingAccountName, + productName, + this.client.getApiVersion(), + parameters, + accept, + context); } /** @@ -1314,7 +1341,6 @@ private Mono moveWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1324,7 +1350,7 @@ private Mono moveWithResponseAsync( this.client.getEndpoint(), billingAccountName, productName, - apiVersion, + this.client.getApiVersion(), parameters, accept, context)) @@ -1366,11 +1392,17 @@ private Mono moveWithResponseAsync( } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .move(this.client.getEndpoint(), billingAccountName, productName, apiVersion, parameters, accept, context); + .move( + this.client.getEndpoint(), + billingAccountName, + productName, + this.client.getApiVersion(), + parameters, + accept, + context); } /** @@ -1467,7 +1499,6 @@ private Mono> validateMo } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1477,7 +1508,7 @@ private Mono> validateMo this.client.getEndpoint(), billingAccountName, productName, - apiVersion, + this.client.getApiVersion(), parameters, accept, context)) @@ -1520,12 +1551,17 @@ private Mono> validateMo } else { parameters.validate(); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .validateMove( - this.client.getEndpoint(), billingAccountName, productName, apiVersion, parameters, accept, context); + this.client.getEndpoint(), + billingAccountName, + productName, + this.client.getApiVersion(), + parameters, + accept, + context); } /** @@ -1598,7 +1634,7 @@ public ValidateProductTransferEligibilityResultInner validateMove( * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync(String nextLink) { + private Mono> listByInvoiceSectionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1610,7 +1646,8 @@ private Mono> listByCustomerNextSinglePageAsync(Stri } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext( + context -> service.listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1635,7 +1672,8 @@ private Mono> listByCustomerNextSinglePageAsync(Stri * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByInvoiceSectionNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1648,7 +1686,7 @@ private Mono> listByCustomerNextSinglePageAsync(Stri final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) + .listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1671,7 +1709,7 @@ private Mono> listByCustomerNextSinglePageAsync(Stri * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1684,7 +1722,7 @@ private Mono> listByBillingAccountNextSinglePageAsyn final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1709,7 +1747,7 @@ private Mono> listByBillingAccountNextSinglePageAsyn * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( + private Mono> listByBillingProfileNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1723,7 +1761,7 @@ private Mono> listByBillingAccountNextSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1746,7 +1784,7 @@ private Mono> listByBillingAccountNextSinglePageAsyn * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { + private Mono> listByCustomerNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1758,8 +1796,7 @@ private Mono> listByBillingProfileNextSinglePageAsyn } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1784,8 +1821,7 @@ private Mono> listByBillingProfileNextSinglePageAsyn * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByCustomerNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1798,7 +1834,7 @@ private Mono> listByBillingProfileNextSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -1821,7 +1857,7 @@ private Mono> listByBillingProfileNextSinglePageAsyn * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync(String nextLink) { + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1834,7 +1870,7 @@ private Mono> listByInvoiceSectionNextSinglePageAsyn final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1859,7 +1895,7 @@ private Mono> listByInvoiceSectionNextSinglePageAsyn * @return the list of products along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync( + private Mono> listByBillingAccountNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -1873,7 +1909,7 @@ private Mono> listByInvoiceSectionNextSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsImpl.java index 0b370b87e728e..9788fe8aded1c 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsImpl.java @@ -30,25 +30,23 @@ public ProductsImpl(ProductsClient innerClient, com.azure.resourcemanager.billin this.serviceManager = serviceManager; } - public PagedIterable listByCustomer(String billingAccountName, String customerName) { - PagedIterable inner = this.serviceClient().listByCustomer(billingAccountName, customerName); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByCustomer(String billingAccountName, String customerName, Context context) { + public PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName) { PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName, context); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); + this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); } - public PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context) { + public PagedIterable listByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String filter, + Context context) { PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, filter, context); + this + .serviceClient() + .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, filter, context); return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); } @@ -65,23 +63,25 @@ public PagedIterable listByBillingProfile( return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); } - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { + public PagedIterable listByCustomer(String billingAccountName, String customerName) { + PagedIterable inner = this.serviceClient().listByCustomer(billingAccountName, customerName); + return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); + } + + public PagedIterable listByCustomer(String billingAccountName, String customerName, Context context) { PagedIterable inner = - this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); + this.serviceClient().listByCustomer(billingAccountName, customerName, context); return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); } - public PagedIterable listByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context) { + public PagedIterable listByBillingAccount(String billingAccountName) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); + return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context) { PagedIterable inner = - this - .serviceClient() - .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, filter, context); + this.serviceClient().listByBillingAccount(billingAccountName, filter, context); return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationImpl.java index 69d3939218821..a6d465fba6799 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationImpl.java @@ -25,22 +25,22 @@ public String id() { return this.innerModel().id(); } - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - public String location() { return this.innerModel().location(); } + public String name() { + return this.innerModel().name(); + } + public ReservationSkuProperty sku() { return this.innerModel().sku(); } + public String type() { + return this.innerModel().type(); + } + public List appliedScopes() { List inner = this.innerModel().appliedScopes(); if (inner != null) { @@ -54,44 +54,44 @@ public String appliedScopeType() { return this.innerModel().appliedScopeType(); } - public String reservedResourceType() { - return this.innerModel().reservedResourceType(); + public String displayName() { + return this.innerModel().displayName(); } - public Float quantity() { - return this.innerModel().quantity(); + public String displayProvisioningState() { + return this.innerModel().displayProvisioningState(); } - public String provisioningState() { - return this.innerModel().provisioningState(); + public String effectiveDateTime() { + return this.innerModel().effectiveDateTime(); } public String expiryDate() { return this.innerModel().expiryDate(); } - public String provisioningSubState() { - return this.innerModel().provisioningSubState(); + public String provisioningState() { + return this.innerModel().provisioningState(); } - public String displayName() { - return this.innerModel().displayName(); + public String provisioningSubState() { + return this.innerModel().provisioningSubState(); } - public String displayProvisioningState() { - return this.innerModel().displayProvisioningState(); + public Float quantity() { + return this.innerModel().quantity(); } - public String userFriendlyRenewState() { - return this.innerModel().userFriendlyRenewState(); + public Boolean renew() { + return this.innerModel().renew(); } - public String userFriendlyAppliedScopeType() { - return this.innerModel().userFriendlyAppliedScopeType(); + public String renewSource() { + return this.innerModel().renewSource(); } - public String effectiveDateTime() { - return this.innerModel().effectiveDateTime(); + public String reservedResourceType() { + return this.innerModel().reservedResourceType(); } public String skuDescription() { @@ -102,12 +102,12 @@ public String term() { return this.innerModel().term(); } - public Boolean renew() { - return this.innerModel().renew(); + public String userFriendlyAppliedScopeType() { + return this.innerModel().userFriendlyAppliedScopeType(); } - public String renewSource() { - return this.innerModel().renewSource(); + public String userFriendlyRenewState() { + return this.innerModel().userFriendlyRenewState(); } public ReservationPropertyUtilization utilization() { diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java index 63a7793a8cf7a..0278cf691a9ce 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java @@ -57,13 +57,15 @@ public final class ReservationsClientImpl implements ReservationsClient { @ServiceInterface(name = "BillingManagementCli") public interface ReservationsService { @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservations") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/reservations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, + @PathParam("billingProfileName") String billingProfileName, @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, @QueryParam("refreshSummary") String refreshSummary, @@ -72,16 +74,13 @@ Mono> listByBillingAccount( Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/reservations") + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( + Mono> listByBillingAccount( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, @QueryParam("$filter") String filter, @QueryParam("$orderby") String orderby, @QueryParam("refreshSummary") String refreshSummary, @@ -93,7 +92,7 @@ Mono> listByBillingProfile( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( + Mono> listByBillingProfileNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -103,7 +102,7 @@ Mono> listByBillingAccountNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( + Mono> listByBillingAccountNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -111,14 +110,15 @@ Mono> listByBillingProfileNext( } /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. + * state. * @param selectedState The selected provisioning state. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -127,8 +127,13 @@ Mono> listByBillingProfileNext( * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String filter, String orderby, String refreshSummary, String selectedState) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountName, + String billingProfileName, + String filter, + String orderby, + String refreshSummary, + String selectedState) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -139,16 +144,20 @@ private Mono> listByBillingAccountSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingAccount( + .listByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, + billingProfileName, filter, orderby, refreshSummary, @@ -168,14 +177,15 @@ private Mono> listByBillingAccountSinglePageAsyn } /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. + * state. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -185,8 +195,9 @@ private Mono> listByBillingAccountSinglePageAsyn * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( + private Mono> listByBillingProfileSinglePageAsync( String billingAccountName, + String billingProfileName, String filter, String orderby, String refreshSummary, @@ -202,14 +213,18 @@ private Mono> listByBillingAccountSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; + if (billingProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount( + .listByBillingProfile( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, + billingProfileName, filter, orderby, refreshSummary, @@ -228,14 +243,15 @@ private Mono> listByBillingAccountSinglePageAsyn } /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. + * state. * @param selectedState The selected provisioning state. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -244,18 +260,25 @@ private Mono> listByBillingAccountSinglePageAsyn * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String filter, String orderby, String refreshSummary, String selectedState) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, + String billingProfileName, + String filter, + String orderby, + String refreshSummary, + String selectedState) { return new PagedFlux<>( () -> - listByBillingAccountSinglePageAsync(billingAccountName, filter, orderby, refreshSummary, selectedState), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + listByBillingProfileSinglePageAsync( + billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -263,26 +286,29 @@ private PagedFlux listByBillingAccountAsync( * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { + private PagedFlux listByBillingProfileAsync( + String billingAccountName, String billingProfileName) { final String filter = null; final String orderby = null; final String refreshSummary = null; final String selectedState = null; return new PagedFlux<>( () -> - listByBillingAccountSinglePageAsync(billingAccountName, filter, orderby, refreshSummary, selectedState), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + listByBillingProfileSinglePageAsync( + billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. + * state. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -292,8 +318,9 @@ private PagedFlux listByBillingAccountAsync(String billingAcco * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( + private PagedFlux listByBillingProfileAsync( String billingAccountName, + String billingProfileName, String filter, String orderby, String refreshSummary, @@ -301,15 +328,16 @@ private PagedFlux listByBillingAccountAsync( Context context) { return new PagedFlux<>( () -> - listByBillingAccountSinglePageAsync( - billingAccountName, filter, orderby, refreshSummary, selectedState, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + listByBillingProfileSinglePageAsync( + billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -317,24 +345,26 @@ private PagedFlux listByBillingAccountAsync( * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { + public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { final String filter = null; final String orderby = null; final String refreshSummary = null; final String selectedState = null; return new PagedIterable<>( - listByBillingAccountAsync(billingAccountName, filter, orderby, refreshSummary, selectedState)); + listByBillingProfileAsync( + billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState)); } /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. + * state. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -344,27 +374,28 @@ public PagedIterable listByBillingAccount(String billingAccoun * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( + public PagedIterable listByBillingProfile( String billingAccountName, + String billingProfileName, String filter, String orderby, String refreshSummary, String selectedState, Context context) { return new PagedIterable<>( - listByBillingAccountAsync(billingAccountName, filter, orderby, refreshSummary, selectedState, context)); + listByBillingProfileAsync( + billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, context)); } /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. + * states. * @param selectedState The selected provisioning state. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -373,13 +404,8 @@ public PagedIterable listByBillingAccount( * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountName, String filter, String orderby, String refreshSummary, String selectedState) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -390,21 +416,15 @@ private Mono> listByBillingProfileSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .listByBillingProfile( + .listByBillingAccount( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, filter, orderby, refreshSummary, @@ -424,15 +444,14 @@ private Mono> listByBillingProfileSinglePageAsyn } /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. + * states. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -442,9 +461,8 @@ private Mono> listByBillingProfileSinglePageAsyn * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( + private Mono> listByBillingAccountSinglePageAsync( String billingAccountName, - String billingProfileName, String filter, String orderby, String refreshSummary, @@ -460,19 +478,13 @@ private Mono> listByBillingProfileSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfile( + .listByBillingAccount( this.client.getEndpoint(), - apiVersion, + this.client.getApiVersion(), billingAccountName, - billingProfileName, filter, orderby, refreshSummary, @@ -491,15 +503,14 @@ private Mono> listByBillingProfileSinglePageAsyn } /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. + * states. * @param selectedState The selected provisioning state. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -508,25 +519,18 @@ private Mono> listByBillingProfileSinglePageAsyn * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState) { + private PagedFlux listByBillingAccountAsync( + String billingAccountName, String filter, String orderby, String refreshSummary, String selectedState) { return new PagedFlux<>( () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + listByBillingAccountSinglePageAsync(billingAccountName, filter, orderby, refreshSummary, selectedState), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -534,29 +538,26 @@ private PagedFlux listByBillingProfileAsync( * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { + private PagedFlux listByBillingAccountAsync(String billingAccountName) { final String filter = null; final String orderby = null; final String refreshSummary = null; final String selectedState = null; return new PagedFlux<>( () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + listByBillingAccountSinglePageAsync(billingAccountName, filter, orderby, refreshSummary, selectedState), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. + * states. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -566,9 +567,8 @@ private PagedFlux listByBillingProfileAsync( * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( + private PagedFlux listByBillingAccountAsync( String billingAccountName, - String billingProfileName, String filter, String orderby, String refreshSummary, @@ -576,16 +576,15 @@ private PagedFlux listByBillingProfileAsync( Context context) { return new PagedFlux<>( () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); + listByBillingAccountSinglePageAsync( + billingAccountName, filter, orderby, refreshSummary, selectedState, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -593,26 +592,24 @@ private PagedFlux listByBillingProfileAsync( * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { + public PagedIterable listByBillingAccount(String billingAccountName) { final String filter = null; final String orderby = null; final String refreshSummary = null; final String selectedState = null; return new PagedIterable<>( - listByBillingProfileAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState)); + listByBillingAccountAsync(billingAccountName, filter, orderby, refreshSummary, selectedState)); } /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. + * states. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -622,17 +619,15 @@ public PagedIterable listByBillingProfile(String billingAccoun * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( + public PagedIterable listByBillingAccount( String billingAccountName, - String billingProfileName, String filter, String orderby, String refreshSummary, String selectedState, Context context) { return new PagedIterable<>( - listByBillingProfileAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, context)); + listByBillingAccountAsync(billingAccountName, filter, orderby, refreshSummary, selectedState, context)); } /** @@ -647,7 +642,7 @@ public PagedIterable listByBillingProfile( * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -660,7 +655,7 @@ private Mono> listByBillingAccountNextSinglePage final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -686,7 +681,7 @@ private Mono> listByBillingAccountNextSinglePage * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( + private Mono> listByBillingProfileNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -700,7 +695,7 @@ private Mono> listByBillingAccountNextSinglePage final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -724,7 +719,7 @@ private Mono> listByBillingAccountNextSinglePage * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -737,7 +732,7 @@ private Mono> listByBillingProfileNextSinglePage final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -763,7 +758,7 @@ private Mono> listByBillingProfileNextSinglePage * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( + private Mono> listByBillingAccountNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -777,7 +772,7 @@ private Mono> listByBillingProfileNextSinglePage final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsImpl.java index 9c1c5969fe4a0..7aa56d8b05086 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsImpl.java @@ -25,13 +25,15 @@ public ReservationsImpl( this.serviceManager = serviceManager; } - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); + public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); return Utils.mapPage(inner, inner1 -> new ReservationImpl(inner1, this.manager())); } - public PagedIterable listByBillingAccount( + public PagedIterable listByBillingProfile( String billingAccountName, + String billingProfileName, String filter, String orderby, String refreshSummary, @@ -40,19 +42,18 @@ public PagedIterable listByBillingAccount( PagedIterable inner = this .serviceClient() - .listByBillingAccount(billingAccountName, filter, orderby, refreshSummary, selectedState, context); + .listByBillingProfile( + billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, context); return Utils.mapPage(inner, inner1 -> new ReservationImpl(inner1, this.manager())); } - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); + public PagedIterable listByBillingAccount(String billingAccountName) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); return Utils.mapPage(inner, inner1 -> new ReservationImpl(inner1, this.manager())); } - public PagedIterable listByBillingProfile( + public PagedIterable listByBillingAccount( String billingAccountName, - String billingProfileName, String filter, String orderby, String refreshSummary, @@ -61,8 +62,7 @@ public PagedIterable listByBillingProfile( PagedIterable inner = this .serviceClient() - .listByBillingProfile( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, context); + .listByBillingAccount(billingAccountName, filter, orderby, refreshSummary, selectedState, context); return Utils.mapPage(inner, inner1 -> new ReservationImpl(inner1, this.manager())); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionImpl.java index 0727972df9c85..2a3d6f0accfa0 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.TransactionInner; import com.azure.resourcemanager.billing.models.Amount; import com.azure.resourcemanager.billing.models.ReservationType; @@ -33,128 +34,124 @@ public String type() { return this.innerModel().type(); } - public TransactionTypeKind kind() { - return this.innerModel().kind(); + public SystemData systemData() { + return this.innerModel().systemData(); } - public OffsetDateTime date() { - return this.innerModel().date(); + public Amount azureCreditApplied() { + return this.innerModel().azureCreditApplied(); } - public String invoice() { - return this.innerModel().invoice(); + public String azurePlan() { + return this.innerModel().azurePlan(); } - public String invoiceId() { - return this.innerModel().invoiceId(); + public String billingCurrency() { + return this.innerModel().billingCurrency(); } - public String orderId() { - return this.innerModel().orderId(); + public String billingProfileDisplayName() { + return this.innerModel().billingProfileDisplayName(); } - public String orderName() { - return this.innerModel().orderName(); + public String billingProfileId() { + return this.innerModel().billingProfileId(); } - public String productFamily() { - return this.innerModel().productFamily(); + public String customerDisplayName() { + return this.innerModel().customerDisplayName(); } - public String productTypeId() { - return this.innerModel().productTypeId(); + public String customerId() { + return this.innerModel().customerId(); } - public String productType() { - return this.innerModel().productType(); + public OffsetDateTime date() { + return this.innerModel().date(); } - public String productDescription() { - return this.innerModel().productDescription(); + public Float discount() { + return this.innerModel().discount(); } - public ReservationType transactionType() { - return this.innerModel().transactionType(); + public Amount effectivePrice() { + return this.innerModel().effectivePrice(); } - public Amount transactionAmount() { - return this.innerModel().transactionAmount(); + public Float exchangeRate() { + return this.innerModel().exchangeRate(); } - public Integer quantity() { - return this.innerModel().quantity(); + public String invoice() { + return this.innerModel().invoice(); } - public String invoiceSectionId() { - return this.innerModel().invoiceSectionId(); + public String invoiceId() { + return this.innerModel().invoiceId(); } public String invoiceSectionDisplayName() { return this.innerModel().invoiceSectionDisplayName(); } - public String billingProfileId() { - return this.innerModel().billingProfileId(); - } - - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); - } - - public String customerId() { - return this.innerModel().customerId(); + public String invoiceSectionId() { + return this.innerModel().invoiceSectionId(); } - public String customerDisplayName() { - return this.innerModel().customerDisplayName(); + public TransactionTypeKind kind() { + return this.innerModel().kind(); } - public String subscriptionId() { - return this.innerModel().subscriptionId(); + public Amount marketPrice() { + return this.innerModel().marketPrice(); } - public String subscriptionName() { - return this.innerModel().subscriptionName(); + public String orderId() { + return this.innerModel().orderId(); } - public String azurePlan() { - return this.innerModel().azurePlan(); + public String orderName() { + return this.innerModel().orderName(); } - public Amount azureCreditApplied() { - return this.innerModel().azureCreditApplied(); + public String pricingCurrency() { + return this.innerModel().pricingCurrency(); } - public String billingCurrency() { - return this.innerModel().billingCurrency(); + public String productDescription() { + return this.innerModel().productDescription(); } - public Float discount() { - return this.innerModel().discount(); + public String productFamily() { + return this.innerModel().productFamily(); } - public Amount effectivePrice() { - return this.innerModel().effectivePrice(); + public String productType() { + return this.innerModel().productType(); } - public Float exchangeRate() { - return this.innerModel().exchangeRate(); + public String productTypeId() { + return this.innerModel().productTypeId(); } - public Amount marketPrice() { - return this.innerModel().marketPrice(); + public Integer quantity() { + return this.innerModel().quantity(); } - public String pricingCurrency() { - return this.innerModel().pricingCurrency(); + public OffsetDateTime servicePeriodEndDate() { + return this.innerModel().servicePeriodEndDate(); } public OffsetDateTime servicePeriodStartDate() { return this.innerModel().servicePeriodStartDate(); } - public OffsetDateTime servicePeriodEndDate() { - return this.innerModel().servicePeriodEndDate(); + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public String subscriptionName() { + return this.innerModel().subscriptionName(); } public Amount subTotal() { @@ -165,6 +162,14 @@ public Amount tax() { return this.innerModel().tax(); } + public Amount transactionAmount() { + return this.innerModel().transactionAmount(); + } + + public ReservationType transactionType() { + return this.innerModel().transactionType(); + } + public String unitOfMeasure() { return this.innerModel().unitOfMeasure(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsClientImpl.java index ff53b98e4d200..835f6efababe0 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsClientImpl.java @@ -105,14 +105,18 @@ private Mono> listByInvoiceSinglePageAsync( if (invoiceName == null) { return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service .listByInvoice( - this.client.getEndpoint(), billingAccountName, invoiceName, apiVersion, accept, context)) + this.client.getEndpoint(), + billingAccountName, + invoiceName, + this.client.getApiVersion(), + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -152,11 +156,16 @@ private Mono> listByInvoiceSinglePageAsync( if (invoiceName == null) { return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); } - final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByInvoice(this.client.getEndpoint(), billingAccountName, invoiceName, apiVersion, accept, context) + .listByInvoice( + this.client.getEndpoint(), + billingAccountName, + invoiceName, + this.client.getApiVersion(), + accept, + context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateProductTransferEligibilityResultImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateProductTransferEligibilityResultImpl.java index 294dfa24f0f74..75d5440215a45 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateProductTransferEligibilityResultImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateProductTransferEligibilityResultImpl.java @@ -20,14 +20,14 @@ public final class ValidateProductTransferEligibilityResultImpl implements Valid this.serviceManager = serviceManager; } - public Boolean isMoveEligible() { - return this.innerModel().isMoveEligible(); - } - public ValidateProductTransferEligibilityError errorDetails() { return this.innerModel().errorDetails(); } + public Boolean isMoveEligible() { + return this.innerModel().isMoveEligible(); + } + public ValidateProductTransferEligibilityResultInner innerModel() { return this.innerObject; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java index de1a9d1016898..aacf60ed24460 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java @@ -21,14 +21,14 @@ public final class ValidateSubscriptionTransferEligibilityResultImpl this.serviceManager = serviceManager; } - public Boolean isMoveEligible() { - return this.innerModel().isMoveEligible(); - } - public ValidateSubscriptionTransferEligibilityError errorDetails() { return this.innerModel().errorDetails(); } + public Boolean isMoveEligible() { + return this.innerModel().isMoveEligible(); + } + public ValidateSubscriptionTransferEligibilityResultInner innerModel() { return this.innerObject; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/package-info.java index 067b2a6a57ccb..edcfbd310be55 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/package-info.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/package-info.java @@ -2,8 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** - * Package containing the implementations for BillingManagementClient. Billing client provides access to billing - * resources for Azure subscriptions. - */ +/** Package containing the implementations for BillingManagementClient. Billing Client. */ package com.azure.resourcemanager.billing.implementation; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressDetails.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressDetails.java index ff2c4453802d2..a30b02df0d2fe 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressDetails.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressDetails.java @@ -11,30 +11,6 @@ /** Address details. */ @Fluent public final class AddressDetails { - /* - * First name. - */ - @JsonProperty(value = "firstName") - private String firstName; - - /* - * Middle name. - */ - @JsonProperty(value = "middleName") - private String middleName; - - /* - * Last name. - */ - @JsonProperty(value = "lastName") - private String lastName; - - /* - * Company name. - */ - @JsonProperty(value = "companyName") - private String companyName; - /* * Address line 1. */ @@ -59,6 +35,18 @@ public final class AddressDetails { @JsonProperty(value = "city") private String city; + /* + * Company name. + */ + @JsonProperty(value = "companyName") + private String companyName; + + /* + * Country code uses IS02, 2-digit format. + */ + @JsonProperty(value = "country", required = true) + private String country; + /* * Address district. */ @@ -66,28 +54,28 @@ public final class AddressDetails { private String district; /* - * Address region. + * Email address. */ - @JsonProperty(value = "region") - private String region; + @JsonProperty(value = "email") + private String email; /* - * Country code uses ISO2, 2-digit format. + * First name. */ - @JsonProperty(value = "country", required = true) - private String country; + @JsonProperty(value = "firstName") + private String firstName; /* - * Postal code. + * Last name. */ - @JsonProperty(value = "postalCode") - private String postalCode; + @JsonProperty(value = "lastName") + private String lastName; /* - * Email address. + * Middle name. */ - @JsonProperty(value = "email") - private String email; + @JsonProperty(value = "middleName") + private String middleName; /* * Phone number. @@ -95,67 +83,105 @@ public final class AddressDetails { @JsonProperty(value = "phoneNumber") private String phoneNumber; + /* + * Postal code. + */ + @JsonProperty(value = "postalCode") + private String postalCode; + + /* + * Address region. + */ + @JsonProperty(value = "region") + private String region; + + /* + * Indicates if the address is incomplete. + */ + @JsonProperty(value = "isValidAddress") + private Boolean isValidAddress; + /** Creates an instance of AddressDetails class. */ public AddressDetails() { } /** - * Get the firstName property: First name. + * Get the addressLine1 property: Address line 1. * - * @return the firstName value. + * @return the addressLine1 value. */ - public String firstName() { - return this.firstName; + public String addressLine1() { + return this.addressLine1; } /** - * Set the firstName property: First name. + * Set the addressLine1 property: Address line 1. * - * @param firstName the firstName value to set. + * @param addressLine1 the addressLine1 value to set. * @return the AddressDetails object itself. */ - public AddressDetails withFirstName(String firstName) { - this.firstName = firstName; + public AddressDetails withAddressLine1(String addressLine1) { + this.addressLine1 = addressLine1; return this; } /** - * Get the middleName property: Middle name. + * Get the addressLine2 property: Address line 2. * - * @return the middleName value. + * @return the addressLine2 value. */ - public String middleName() { - return this.middleName; + public String addressLine2() { + return this.addressLine2; } /** - * Set the middleName property: Middle name. + * Set the addressLine2 property: Address line 2. * - * @param middleName the middleName value to set. + * @param addressLine2 the addressLine2 value to set. * @return the AddressDetails object itself. */ - public AddressDetails withMiddleName(String middleName) { - this.middleName = middleName; + public AddressDetails withAddressLine2(String addressLine2) { + this.addressLine2 = addressLine2; return this; } /** - * Get the lastName property: Last name. + * Get the addressLine3 property: Address line 3. * - * @return the lastName value. + * @return the addressLine3 value. */ - public String lastName() { - return this.lastName; + public String addressLine3() { + return this.addressLine3; } /** - * Set the lastName property: Last name. + * Set the addressLine3 property: Address line 3. * - * @param lastName the lastName value to set. + * @param addressLine3 the addressLine3 value to set. * @return the AddressDetails object itself. */ - public AddressDetails withLastName(String lastName) { - this.lastName = lastName; + public AddressDetails withAddressLine3(String addressLine3) { + this.addressLine3 = addressLine3; + return this; + } + + /** + * Get the city property: Address city. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: Address city. + * + * @param city the city value to set. + * @return the AddressDetails object itself. + */ + public AddressDetails withCity(String city) { + this.city = city; return this; } @@ -180,142 +206,142 @@ public AddressDetails withCompanyName(String companyName) { } /** - * Get the addressLine1 property: Address line 1. + * Get the country property: Country code uses IS02, 2-digit format. * - * @return the addressLine1 value. + * @return the country value. */ - public String addressLine1() { - return this.addressLine1; + public String country() { + return this.country; } /** - * Set the addressLine1 property: Address line 1. + * Set the country property: Country code uses IS02, 2-digit format. * - * @param addressLine1 the addressLine1 value to set. + * @param country the country value to set. * @return the AddressDetails object itself. */ - public AddressDetails withAddressLine1(String addressLine1) { - this.addressLine1 = addressLine1; + public AddressDetails withCountry(String country) { + this.country = country; return this; } /** - * Get the addressLine2 property: Address line 2. + * Get the district property: Address district. * - * @return the addressLine2 value. + * @return the district value. */ - public String addressLine2() { - return this.addressLine2; + public String district() { + return this.district; } /** - * Set the addressLine2 property: Address line 2. + * Set the district property: Address district. * - * @param addressLine2 the addressLine2 value to set. + * @param district the district value to set. * @return the AddressDetails object itself. */ - public AddressDetails withAddressLine2(String addressLine2) { - this.addressLine2 = addressLine2; + public AddressDetails withDistrict(String district) { + this.district = district; return this; } /** - * Get the addressLine3 property: Address line 3. + * Get the email property: Email address. * - * @return the addressLine3 value. + * @return the email value. */ - public String addressLine3() { - return this.addressLine3; + public String email() { + return this.email; } /** - * Set the addressLine3 property: Address line 3. + * Set the email property: Email address. * - * @param addressLine3 the addressLine3 value to set. + * @param email the email value to set. * @return the AddressDetails object itself. */ - public AddressDetails withAddressLine3(String addressLine3) { - this.addressLine3 = addressLine3; + public AddressDetails withEmail(String email) { + this.email = email; return this; } /** - * Get the city property: Address city. + * Get the firstName property: First name. * - * @return the city value. + * @return the firstName value. */ - public String city() { - return this.city; + public String firstName() { + return this.firstName; } /** - * Set the city property: Address city. + * Set the firstName property: First name. * - * @param city the city value to set. + * @param firstName the firstName value to set. * @return the AddressDetails object itself. */ - public AddressDetails withCity(String city) { - this.city = city; + public AddressDetails withFirstName(String firstName) { + this.firstName = firstName; return this; } /** - * Get the district property: Address district. + * Get the lastName property: Last name. * - * @return the district value. + * @return the lastName value. */ - public String district() { - return this.district; + public String lastName() { + return this.lastName; } /** - * Set the district property: Address district. + * Set the lastName property: Last name. * - * @param district the district value to set. + * @param lastName the lastName value to set. * @return the AddressDetails object itself. */ - public AddressDetails withDistrict(String district) { - this.district = district; + public AddressDetails withLastName(String lastName) { + this.lastName = lastName; return this; } /** - * Get the region property: Address region. + * Get the middleName property: Middle name. * - * @return the region value. + * @return the middleName value. */ - public String region() { - return this.region; + public String middleName() { + return this.middleName; } /** - * Set the region property: Address region. + * Set the middleName property: Middle name. * - * @param region the region value to set. + * @param middleName the middleName value to set. * @return the AddressDetails object itself. */ - public AddressDetails withRegion(String region) { - this.region = region; + public AddressDetails withMiddleName(String middleName) { + this.middleName = middleName; return this; } /** - * Get the country property: Country code uses ISO2, 2-digit format. + * Get the phoneNumber property: Phone number. * - * @return the country value. + * @return the phoneNumber value. */ - public String country() { - return this.country; + public String phoneNumber() { + return this.phoneNumber; } /** - * Set the country property: Country code uses ISO2, 2-digit format. + * Set the phoneNumber property: Phone number. * - * @param country the country value to set. + * @param phoneNumber the phoneNumber value to set. * @return the AddressDetails object itself. */ - public AddressDetails withCountry(String country) { - this.country = country; + public AddressDetails withPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; return this; } @@ -340,42 +366,42 @@ public AddressDetails withPostalCode(String postalCode) { } /** - * Get the email property: Email address. + * Get the region property: Address region. * - * @return the email value. + * @return the region value. */ - public String email() { - return this.email; + public String region() { + return this.region; } /** - * Set the email property: Email address. + * Set the region property: Address region. * - * @param email the email value to set. + * @param region the region value to set. * @return the AddressDetails object itself. */ - public AddressDetails withEmail(String email) { - this.email = email; + public AddressDetails withRegion(String region) { + this.region = region; return this; } /** - * Get the phoneNumber property: Phone number. + * Get the isValidAddress property: Indicates if the address is incomplete. * - * @return the phoneNumber value. + * @return the isValidAddress value. */ - public String phoneNumber() { - return this.phoneNumber; + public Boolean isValidAddress() { + return this.isValidAddress; } /** - * Set the phoneNumber property: Phone number. + * Set the isValidAddress property: Indicates if the address is incomplete. * - * @param phoneNumber the phoneNumber value to set. + * @param isValidAddress the isValidAddress value to set. * @return the AddressDetails object itself. */ - public AddressDetails withPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; + public AddressDetails withIsValidAddress(Boolean isValidAddress) { + this.isValidAddress = isValidAddress; return this; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreement.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreement.java index fde5b5b32687d..91f07d66bb336 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreement.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreement.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.AgreementInner; import java.time.OffsetDateTime; import java.util.List; @@ -11,7 +12,8 @@ /** An immutable client-side representation of Agreement. */ public interface Agreement { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -25,32 +27,32 @@ public interface Agreement { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the agreementLink property: The URL to download the agreement. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the agreementLink value. + * @return the systemData value. */ - String agreementLink(); + SystemData systemData(); /** - * Gets the category property: The category of the agreement signed by a customer. + * Gets the acceptanceMode property: The mode of acceptance for an agreement. * - * @return the category value. + * @return the acceptanceMode value. */ - Category category(); + AcceptanceMode acceptanceMode(); /** - * Gets the acceptanceMode property: The mode of acceptance for an agreement. + * Gets the agreementLink property: The URL to download the agreement. * - * @return the acceptanceMode value. + * @return the agreementLink value. */ - AcceptanceMode acceptanceMode(); + String agreementLink(); /** * Gets the billingProfileInfo property: The list of billing profiles associated with agreement and present only for @@ -60,6 +62,13 @@ public interface Agreement { */ BillingProfileInfo billingProfileInfo(); + /** + * Gets the category property: The category of the agreement signed by a customer. + * + * @return the category value. + */ + Category category(); + /** * Gets the effectiveDate property: The date from which the agreement is effective. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementListResult.java index 6a55ec05b7bea..fd43952081b28 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementListResult.java @@ -12,38 +12,38 @@ /** Result of listing agreements. */ @Immutable public final class AgreementListResult { - /* - * The list of agreements. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - /* * The link (url) to the next page of results. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /* + * The list of agreements. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + /** Creates an instance of AgreementListResult class. */ public AgreementListResult() { } /** - * Get the value property: The list of agreements. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of agreements. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Amount.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Amount.java index 81a8d20b9d293..be5bed33e7e6a 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Amount.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Amount.java @@ -20,7 +20,7 @@ public final class Amount { * Amount value. */ @JsonProperty(value = "value") - private Float value; + private Double value; /** Creates an instance of Amount class. */ public Amount() { @@ -40,7 +40,7 @@ public String currency() { * * @return the value value. */ - public Float value() { + public Double value() { return this.value; } @@ -50,7 +50,7 @@ public Float value() { * @param value the value value to set. * @return the Amount object itself. */ - public Amount withValue(Float value) { + public Amount withValue(Double value) { this.value = value; return this; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ArmResource.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ArmResource.java new file mode 100644 index 0000000000000..9646968d44b26 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ArmResource.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common fields that are returned in the response for all Azure Resource Manager resources. */ +@Immutable +public class ArmResource { + /* + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ArmResource class. */ + public ArmResource() { + } + + /** + * Get the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenant.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenant.java new file mode 100644 index 0000000000000..8004a990bce39 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenant.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.billing.fluent.models.AssociatedTenantInner; + +/** An immutable client-side representation of AssociatedTenant. */ +public interface AssociatedTenant { + /** + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the friendlyName property: The friendly name assigned to the associated tenant. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the tenantId property: The ID that uniquely identifies a tenant. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the billingManagementState property: 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. + * + * @return the billingManagementState value. + */ + BillingManagementTenantState billingManagementState(); + + /** + * Gets the provisioningState property: The state determines whether subscriptions and licenses can be provisioned + * in the associated tenant. It can be set as 'Pending' from null, null from 'Pending', or null from 'Active'. + * + * @return the provisioningState value. + */ + ProvisioningTenantState provisioningState(); + + /** + * Gets the provisioningBillingRequestId property: The unique identifier for the billing request that is created + * when enabling provisioning for an associated tenant. + * + * @return the provisioningBillingRequestId value. + */ + String provisioningBillingRequestId(); + + /** + * Gets the inner com.azure.resourcemanager.billing.fluent.models.AssociatedTenantInner object. + * + * @return the inner object. + */ + AssociatedTenantInner innerModel(); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenantListResult.java similarity index 69% rename from sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountListResult.java rename to sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenantListResult.java index e27dab10a0af7..d4a3f78aa1147 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenantListResult.java @@ -5,36 +5,27 @@ package com.azure.resourcemanager.billing.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; +import com.azure.resourcemanager.billing.fluent.models.AssociatedTenantInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Result of listing enrollment accounts. */ +/** A container for a list of resources. */ @Immutable -public final class EnrollmentAccountListResult { - /* - * The list of enrollment accounts. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - +public final class AssociatedTenantListResult { /* * The link (url) to the next page of results. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of EnrollmentAccountListResult class. */ - public EnrollmentAccountListResult() { - } - - /** - * Get the value property: The list of enrollment accounts. - * - * @return the value value. + /* + * The list of resources. */ - public List value() { - return this.value; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of AssociatedTenantListResult class. */ + public AssociatedTenantListResult() { } /** @@ -46,6 +37,15 @@ public String nextLink() { return this.nextLink; } + /** + * Get the value property: The list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + /** * Validates the instance. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenantPropertiesAutoGenerated.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenantPropertiesAutoGenerated.java new file mode 100644 index 0000000000000..16a81951c1d78 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenantPropertiesAutoGenerated.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An associated tenant. */ +@Fluent +public class AssociatedTenantPropertiesAutoGenerated { + /* + * The friendly name assigned to the associated tenant. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The ID that uniquely identifies a tenant. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * 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. + */ + @JsonProperty(value = "billingManagementState") + private BillingManagementTenantState billingManagementState; + + /* + * The state determines whether subscriptions and licenses can be provisioned in the associated tenant. It can be + * set as 'Pending' from null, null from 'Pending', or null from 'Active' + */ + @JsonProperty(value = "provisioningState") + private ProvisioningTenantState provisioningState; + + /* + * The unique identifier for the billing request that is created when enabling provisioning for an associated + * tenant. + */ + @JsonProperty(value = "provisioningBillingRequestId", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningBillingRequestId; + + /** Creates an instance of AssociatedTenantPropertiesAutoGenerated class. */ + public AssociatedTenantPropertiesAutoGenerated() { + } + + /** + * Get the friendlyName property: The friendly name assigned to the associated tenant. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name assigned to the associated tenant. + * + * @param friendlyName the friendlyName value to set. + * @return the AssociatedTenantPropertiesAutoGenerated object itself. + */ + public AssociatedTenantPropertiesAutoGenerated withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the tenantId property: The ID that uniquely identifies a tenant. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The ID that uniquely identifies a tenant. + * + * @param tenantId the tenantId value to set. + * @return the AssociatedTenantPropertiesAutoGenerated object itself. + */ + public AssociatedTenantPropertiesAutoGenerated withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the billingManagementState property: 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. + * + * @return the billingManagementState value. + */ + public BillingManagementTenantState billingManagementState() { + return this.billingManagementState; + } + + /** + * Set the billingManagementState property: 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. + * + * @param billingManagementState the billingManagementState value to set. + * @return the AssociatedTenantPropertiesAutoGenerated object itself. + */ + public AssociatedTenantPropertiesAutoGenerated withBillingManagementState( + BillingManagementTenantState billingManagementState) { + this.billingManagementState = billingManagementState; + return this; + } + + /** + * Get the provisioningState property: The state determines whether subscriptions and licenses can be provisioned in + * the associated tenant. It can be set as 'Pending' from null, null from 'Pending', or null from 'Active'. + * + * @return the provisioningState value. + */ + public ProvisioningTenantState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The state determines whether subscriptions and licenses can be provisioned in + * the associated tenant. It can be set as 'Pending' from null, null from 'Pending', or null from 'Active'. + * + * @param provisioningState the provisioningState value to set. + * @return the AssociatedTenantPropertiesAutoGenerated object itself. + */ + public AssociatedTenantPropertiesAutoGenerated withProvisioningState(ProvisioningTenantState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the provisioningBillingRequestId property: The unique identifier for the billing request that is created when + * enabling provisioning for an associated tenant. + * + * @return the provisioningBillingRequestId value. + */ + public String provisioningBillingRequestId() { + return this.provisioningBillingRequestId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenants.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenants.java new file mode 100644 index 0000000000000..a5c7d6b21ded0 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AssociatedTenants.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.billing.fluent.models.AssociatedTenantInner; + +/** Resource collection API of AssociatedTenants. */ +public interface AssociatedTenants { + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingAccount(String billingAccountName); + + /** + * Lists the tenants that can collaborate with the billing account on commerce activities like viewing and + * downloading invoices, managing payments, making purchases, and managing licenses. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param includeRevoked Can be used to get revoked associated tenants. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingAccount( + String billingAccountName, + Boolean includeRevoked, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context); + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String billingAccountName, String associatedTenantName); + + /** + * Deletes an associated tenant. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param associatedTenantName The ID that uniquely identifies a tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String billingAccountName, String associatedTenantName, Context context); + + /** + * 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 includeRevoked Can be used to get revoked associated tenants. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant by ID along with {@link Response}. + */ + Response getWithResponse( + String billingAccountName, String associatedTenantName, Boolean includeRevoked, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant by ID. + */ + AssociatedTenant get(String billingAccountName, String associatedTenantName); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant. + */ + AssociatedTenant createOrUpdate(String billingAccountName, String associatedTenantName); + + /** + * 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 body An associated tenant. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an associated tenant. + */ + AssociatedTenant createOrUpdate( + String billingAccountName, String associatedTenantName, AssociatedTenantInner body, Context context); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalance.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalance.java index 78bbb1e705d5f..21cdc14f414af 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalance.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalance.java @@ -4,12 +4,14 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; /** An immutable client-side representation of AvailableBalance. */ public interface AvailableBalance { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -23,12 +25,19 @@ public interface AvailableBalance { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the amount property: Balance amount. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AzurePlan.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AzurePlan.java index 86eca5b75ba43..637249fe21889 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AzurePlan.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AzurePlan.java @@ -11,15 +11,15 @@ @Fluent public final class AzurePlan { /* - * The sku id. + * The ID that uniquely identifies a sku. */ - @JsonProperty(value = "skuId") + @JsonProperty(value = "skuId", access = JsonProperty.Access.WRITE_ONLY) private String skuId; /* * The sku description. */ - @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "skuDescription") private String skuDescription; /** Creates an instance of AzurePlan class. */ @@ -27,7 +27,7 @@ public AzurePlan() { } /** - * Get the skuId property: The sku id. + * Get the skuId property: The ID that uniquely identifies a sku. * * @return the skuId value. */ @@ -36,23 +36,23 @@ public String skuId() { } /** - * Set the skuId property: The sku id. + * Get the skuDescription property: The sku description. * - * @param skuId the skuId value to set. - * @return the AzurePlan object itself. + * @return the skuDescription value. */ - public AzurePlan withSkuId(String skuId) { - this.skuId = skuId; - return this; + public String skuDescription() { + return this.skuDescription; } /** - * Get the skuDescription property: The sku description. + * Set the skuDescription property: The sku description. * - * @return the skuDescription value. + * @param skuDescription the skuDescription value to set. + * @return the AzurePlan object itself. */ - public String skuDescription() { - return this.skuDescription; + public AzurePlan withSkuDescription(String skuDescription) { + this.skuDescription = skuDescription; + return this; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccount.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccount.java index 0a4275710e0d5..19f435d07ece8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccount.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccount.java @@ -4,13 +4,15 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingAccountInner; import java.util.List; /** An immutable client-side representation of BillingAccount. */ public interface BillingAccount { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -24,33 +26,25 @@ public interface BillingAccount { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the displayName property: The billing account name. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the displayName value. + * @return the systemData value. */ - String displayName(); + SystemData systemData(); /** - * Gets the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @return the soldTo value. - */ - AddressDetails soldTo(); - - /** - * Gets the agreementType property: The type of agreement. + * Gets the accountStatus property: The current status of the billing account. * - * @return the agreementType value. + * @return the accountStatus value. */ - AgreementType agreementType(); + AccountStatus accountStatus(); /** * Gets the accountType property: The type of customer. @@ -60,11 +54,11 @@ public interface BillingAccount { AccountType accountType(); /** - * Gets the accountStatus property: The current status of the billing account. + * Gets the agreementType property: The type of agreement. * - * @return the accountStatus value. + * @return the agreementType value. */ - AccountStatus accountStatus(); + AgreementType agreementType(); /** * Gets the billingProfiles property: The billing profiles associated with the billing account. By default this is @@ -75,19 +69,18 @@ public interface BillingAccount { BillingProfilesOnExpand billingProfiles(); /** - * Gets the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not - * populated, unless it's specified in $expand. + * Gets the departments property: The departments associated to the enrollment. * - * @return the enrollmentDetails value. + * @return the departments value. */ - Enrollment enrollmentDetails(); + List departments(); /** - * Gets the departments property: The departments associated to the enrollment. + * Gets the displayName property: The billing account name. * - * @return the departments value. + * @return the displayName value. */ - List departments(); + String displayName(); /** * Gets the enrollmentAccounts property: The accounts associated to the enrollment. @@ -96,6 +89,14 @@ public interface BillingAccount { */ List enrollmentAccounts(); + /** + * Gets the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not + * populated, unless it's specified in $expand. + * + * @return the enrollmentDetails value. + */ + Enrollment enrollmentDetails(); + /** * Gets the hasReadAccess property: Indicates whether user has read access to the billing account. * @@ -110,6 +111,14 @@ public interface BillingAccount { */ String notificationEmailAddress(); + /** + * Gets the soldTo property: The address of the individual or organization that is responsible for the billing + * account. + * + * @return the soldTo value. + */ + AddressDetails soldTo(); + /** * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingAccountInner object. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountListResult.java index 8671d7729a769..8e08d0e2b4382 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountListResult.java @@ -12,38 +12,38 @@ /** The list of billing accounts. */ @Immutable public final class BillingAccountListResult { - /* - * The list of billing accounts. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - /* * The link (url) to the next page of results. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /* + * The list of billing accounts. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + /** Creates an instance of BillingAccountListResult class. */ public BillingAccountListResult() { } /** - * Get the value property: The list of billing accounts. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of billing accounts. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountUpdateRequest.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountUpdateRequest.java index 15afe141a31ff..c42f718b7ade8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountUpdateRequest.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountUpdateRequest.java @@ -32,60 +32,12 @@ private BillingAccountProperties innerProperties() { } /** - * Get the displayName property: The billing account name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The billing account name. - * - * @param displayName the displayName value to set. - * @return the BillingAccountUpdateRequest object itself. - */ - public BillingAccountUpdateRequest withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @return the soldTo value. - */ - public AddressDetails soldTo() { - return this.innerProperties() == null ? null : this.innerProperties().soldTo(); - } - - /** - * Set the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @param soldTo the soldTo value to set. - * @return the BillingAccountUpdateRequest object itself. - */ - public BillingAccountUpdateRequest withSoldTo(AddressDetails soldTo) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withSoldTo(soldTo); - return this; - } - - /** - * Get the agreementType property: The type of agreement. + * Get the accountStatus property: The current status of the billing account. * - * @return the agreementType value. + * @return the accountStatus value. */ - public AgreementType agreementType() { - return this.innerProperties() == null ? null : this.innerProperties().agreementType(); + public AccountStatus accountStatus() { + return this.innerProperties() == null ? null : this.innerProperties().accountStatus(); } /** @@ -98,12 +50,12 @@ public AccountType accountType() { } /** - * Get the accountStatus property: The current status of the billing account. + * Get the agreementType property: The type of agreement. * - * @return the accountStatus value. + * @return the agreementType value. */ - public AccountStatus accountStatus() { - return this.innerProperties() == null ? null : this.innerProperties().accountStatus(); + public AgreementType agreementType() { + return this.innerProperties() == null ? null : this.innerProperties().agreementType(); } /** @@ -131,16 +83,6 @@ public BillingAccountUpdateRequest withBillingProfiles(BillingProfilesOnExpand b return this; } - /** - * Get the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not - * populated, unless it's specified in $expand. - * - * @return the enrollmentDetails value. - */ - public Enrollment enrollmentDetails() { - return this.innerProperties() == null ? null : this.innerProperties().enrollmentDetails(); - } - /** * Get the departments property: The departments associated to the enrollment. * @@ -164,6 +106,29 @@ public BillingAccountUpdateRequest withDepartments(List departments) return this; } + /** + * Get the displayName property: The billing account name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The billing account name. + * + * @param displayName the displayName value to set. + * @return the BillingAccountUpdateRequest object itself. + */ + public BillingAccountUpdateRequest withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingAccountProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + /** * Get the enrollmentAccounts property: The accounts associated to the enrollment. * @@ -187,6 +152,16 @@ public BillingAccountUpdateRequest withEnrollmentAccounts(List { + /** Static value Unknown for BillingManagementTenantState. */ + public static final BillingManagementTenantState UNKNOWN = fromString("Unknown"); + + /** Static value NotAllowed for BillingManagementTenantState. */ + public static final BillingManagementTenantState NOT_ALLOWED = fromString("NotAllowed"); + + /** Static value Active for BillingManagementTenantState. */ + public static final BillingManagementTenantState ACTIVE = fromString("Active"); + + /** Static value Revoked for BillingManagementTenantState. */ + public static final BillingManagementTenantState REVOKED = fromString("Revoked"); + + /** + * Creates a new instance of BillingManagementTenantState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BillingManagementTenantState() { + } + + /** + * Creates or finds a BillingManagementTenantState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BillingManagementTenantState. + */ + @JsonCreator + public static BillingManagementTenantState fromString(String name) { + return fromString(name, BillingManagementTenantState.class); + } + + /** + * Gets known BillingManagementTenantState values. + * + * @return known BillingManagementTenantState values. + */ + public static Collection values() { + return values(BillingManagementTenantState.class); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriod.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriod.java deleted file mode 100644 index ba9aaa0314b7e..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriod.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; -import java.time.LocalDate; -import java.util.List; - -/** An immutable client-side representation of BillingPeriod. */ -public interface BillingPeriod { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the billingPeriodStartDate property: The start of the date range covered by the billing period. - * - * @return the billingPeriodStartDate value. - */ - LocalDate billingPeriodStartDate(); - - /** - * Gets the billingPeriodEndDate property: The end of the date range covered by the billing period. - * - * @return the billingPeriodEndDate value. - */ - LocalDate billingPeriodEndDate(); - - /** - * Gets the invoiceIds property: Array of invoice ids that associated with. - * - * @return the invoiceIds value. - */ - List invoiceIds(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner object. - * - * @return the inner object. - */ - BillingPeriodInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriods.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriods.java deleted file mode 100644 index 7ea051335afc3..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriods.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of BillingPeriods. */ -public 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. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * 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 filter 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'. - * @param skiptoken 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. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String filter, String skiptoken, Integer top, Context context); - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period along with {@link Response}. - */ - Response getWithResponse(String billingPeriodName, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - BillingPeriod get(String billingPeriodName); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissions.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissions.java index db63bcc0dbb6e..5710e07cb478b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissions.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissions.java @@ -10,23 +10,21 @@ /** Resource collection API of BillingPermissions. */ public interface 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of list billingPermissions a caller has on a billing account as paginated response with {@link * PagedIterable}. */ - PagedIterable listByCustomer(String billingAccountName, String customerName); + PagedIterable listByBillingAccount(String billingAccountName); /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -34,25 +32,27 @@ public interface BillingPermissions { * @return result of list billingPermissions a caller has on a billing account as paginated response with {@link * PagedIterable}. */ - PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context); + PagedIterable listByBillingAccount(String billingAccountName, Context context); /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of list billingPermissions a caller has on a billing account as paginated response with {@link * PagedIterable}. */ - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName); /** - * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -60,7 +60,8 @@ PagedIterable listByCustomer( * @return result of list billingPermissions a caller has on a billing account as paginated response with {@link * PagedIterable}. */ - PagedIterable listByBillingAccount(String billingAccountName, Context context); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context); /** * Lists the billing permissions the caller has on an invoice section. @@ -94,24 +95,23 @@ PagedIterable listByInvoiceSections( String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); /** - * Lists the billing permissions the caller has on a billing profile. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of list billingPermissions a caller has on a billing account as paginated response with {@link * PagedIterable}. */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName); + PagedIterable listByCustomer(String billingAccountName, String customerName); /** - * Lists the billing permissions the caller has on a billing profile. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -119,6 +119,6 @@ PagedIterable listByBillingProfile( * @return result of list billingPermissions a caller has on a billing account as paginated response with {@link * PagedIterable}. */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); + PagedIterable listByCustomer( + String billingAccountName, String customerName, Context context); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsListResult.java index 6407b8a85a3a7..566bdc6a25666 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsListResult.java @@ -12,38 +12,38 @@ /** Result of list billingPermissions a caller has on a billing account. */ @Immutable public final class BillingPermissionsListResult { - /* - * The list of billingPermissions a caller has on a billing account. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - /* * The link (url) to the next page of results. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /* + * The list of billingPermissions a caller has on a billing account. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + /** Creates an instance of BillingPermissionsListResult class. */ public BillingPermissionsListResult() { } /** - * Get the value property: The list of billingPermissions a caller has on a billing account. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of billingPermissions a caller has on a billing account. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfile.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfile.java index fb9d355d5ade4..c602f65002ea1 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfile.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfile.java @@ -4,162 +4,304 @@ package com.azure.resourcemanager.billing.models; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileProperties; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; -/** An immutable client-side representation of BillingProfile. */ -public interface BillingProfile { +/** A billing profile. */ +@Fluent +public final class BillingProfile extends ArmResource { + /* + * The properties of the billing profile. + */ + @JsonProperty(value = "properties") + private BillingProfileProperties innerProperties; + + /** Creates an instance of BillingProfile class. */ + public BillingProfile() { + } + + /** + * Get the innerProperties property: The properties of the billing profile. + * + * @return the innerProperties value. + */ + private BillingProfileProperties innerProperties() { + return this.innerProperties; + } + /** - * Gets the id property: Fully qualified resource Id for the resource. + * Get the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. * - * @return the id value. + * @return the billingRelationshipType value. */ - String id(); + public BillingRelationshipType billingRelationshipType() { + return this.innerProperties() == null ? null : this.innerProperties().billingRelationshipType(); + } /** - * Gets the name property: The name of the resource. + * Get the billTo property: Billing address. * - * @return the name value. + * @return the billTo value. */ - String name(); + public AddressDetails billTo() { + return this.innerProperties() == null ? null : this.innerProperties().billTo(); + } /** - * Gets the type property: The type of the resource. + * Set the billTo property: Billing address. * - * @return the type value. + * @param billTo the billTo value to set. + * @return the BillingProfile object itself. + */ + public BillingProfile withBillTo(AddressDetails billTo) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingProfileProperties(); + } + this.innerProperties().withBillTo(billTo); + return this; + } + + /** + * Get the currency property: The currency in which the charges for the billing profile are billed. + * + * @return the currency value. */ - String type(); + public String currency() { + return this.innerProperties() == null ? null : this.innerProperties().currency(); + } /** - * Gets the displayName property: The name of the billing profile. + * Get the displayName property: The name of the billing profile. * * @return the displayName value. */ - String displayName(); + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } /** - * Gets the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. + * Set the displayName property: The name of the billing profile. * - * @return the poNumber value. + * @param displayName the displayName value to set. + * @return the BillingProfile object itself. */ - String poNumber(); + public BillingProfile withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingProfileProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } /** - * Gets the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. + * Get the enabledAzurePlans property: Information about the enabled azure plans. * - * @return the billingRelationshipType value. + * @return the enabledAzurePlans value. */ - BillingRelationshipType billingRelationshipType(); + public List enabledAzurePlans() { + return this.innerProperties() == null ? null : this.innerProperties().enabledAzurePlans(); + } /** - * Gets the billTo property: Billing address. + * Set the enabledAzurePlans property: Information about the enabled azure plans. * - * @return the billTo value. + * @param enabledAzurePlans the enabledAzurePlans value to set. + * @return the BillingProfile object itself. + */ + public BillingProfile withEnabledAzurePlans(List enabledAzurePlans) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingProfileProperties(); + } + this.innerProperties().withEnabledAzurePlans(enabledAzurePlans); + return this; + } + + /** + * Get the hasReadAccess property: Indicates whether user has read access to the billing profile. + * + * @return the hasReadAccess value. */ - AddressDetails billTo(); + public Boolean hasReadAccess() { + return this.innerProperties() == null ? null : this.innerProperties().hasReadAccess(); + } /** - * Gets the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing + * Get the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing * profile in indirect purchase motion. * * @return the indirectRelationshipInfo value. */ - IndirectRelationshipInfo indirectRelationshipInfo(); + public IndirectRelationshipInfo indirectRelationshipInfo() { + return this.innerProperties() == null ? null : this.innerProperties().indirectRelationshipInfo(); + } + + /** + * Get the invoiceDay property: The day of the month when the invoice for the billing profile is generated. + * + * @return the invoiceDay value. + */ + public Integer invoiceDay() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceDay(); + } /** - * Gets the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent + * Get the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent * through email. * * @return the invoiceEmailOptIn value. */ - Boolean invoiceEmailOptIn(); + public Boolean invoiceEmailOptIn() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceEmailOptIn(); + } /** - * Gets the invoiceDay property: The day of the month when the invoice for the billing profile is generated. + * Set the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent + * through email. * - * @return the invoiceDay value. + * @param invoiceEmailOptIn the invoiceEmailOptIn value to set. + * @return the BillingProfile object itself. */ - Integer invoiceDay(); + public BillingProfile withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingProfileProperties(); + } + this.innerProperties().withInvoiceEmailOptIn(invoiceEmailOptIn); + return this; + } /** - * Gets the currency property: The currency in which the charges for the billing profile are billed. + * Get the invoiceSections property: The invoice sections associated to the billing profile. By default this is not + * populated, unless it's specified in $expand. * - * @return the currency value. + * @return the invoiceSections value. */ - String currency(); + public InvoiceSectionsOnExpand invoiceSections() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceSections(); + } /** - * Gets the enabledAzurePlans property: Information about the enabled azure plans. + * Set the invoiceSections property: The invoice sections associated to the billing profile. By default this is not + * populated, unless it's specified in $expand. * - * @return the enabledAzurePlans value. + * @param invoiceSections the invoiceSections value to set. + * @return the BillingProfile object itself. */ - List enabledAzurePlans(); + public BillingProfile withInvoiceSections(InvoiceSectionsOnExpand invoiceSections) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingProfileProperties(); + } + this.innerProperties().withInvoiceSections(invoiceSections); + return this; + } /** - * Gets the invoiceSections property: The invoice sections associated to the billing profile. By default this is not - * populated, unless it's specified in $expand. + * Get the poNumber property: The purchase order name that will appear on the invoices generated for the billing + * profile. * - * @return the invoiceSections value. + * @return the poNumber value. */ - InvoiceSectionsOnExpand invoiceSections(); + public String poNumber() { + return this.innerProperties() == null ? null : this.innerProperties().poNumber(); + } /** - * Gets the hasReadAccess property: Indicates whether user has read access to the billing profile. + * Set the poNumber property: The purchase order name that will appear on the invoices generated for the billing + * profile. * - * @return the hasReadAccess value. + * @param poNumber the poNumber value to set. + * @return the BillingProfile object itself. */ - Boolean hasReadAccess(); + public BillingProfile withPoNumber(String poNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingProfileProperties(); + } + this.innerProperties().withPoNumber(poNumber); + return this; + } /** - * Gets the systemId property: The system generated unique identifier for a billing profile. + * Get the spendingLimit property: The billing profile spending limit. * - * @return the systemId value. + * @return the spendingLimit value. */ - String systemId(); + public SpendingLimit spendingLimit() { + return this.innerProperties() == null ? null : this.innerProperties().spendingLimit(); + } /** - * Gets the status property: The status of the billing profile. + * Get the status property: The status of the billing profile. * * @return the status value. */ - BillingProfileStatus status(); + public BillingProfileStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } /** - * Gets the statusReasonCode property: Reason for the specified billing profile status. + * Get the statusReasonCode property: Reason for the specified billing profile status. * * @return the statusReasonCode value. */ - StatusReasonCode statusReasonCode(); + public StatusReasonCode statusReasonCode() { + return this.innerProperties() == null ? null : this.innerProperties().statusReasonCode(); + } /** - * Gets the spendingLimit property: The billing profile spending limit. + * Get the systemId property: The system generated unique identifier for a billing profile. * - * @return the spendingLimit value. + * @return the systemId value. */ - SpendingLimit spendingLimit(); + public String systemId() { + return this.innerProperties() == null ? null : this.innerProperties().systemId(); + } /** - * Gets the targetClouds property: 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. + * Get the tags property: Tags of billing profiles. * - * @return the targetClouds value. + * @return the tags value. */ - List targetClouds(); + public Map tags() { + return this.innerProperties() == null ? null : this.innerProperties().tags(); + } /** - * Gets the tags property: Tags of billing profiles. + * Set the tags property: Tags of billing profiles. * - * @return the tags value. + * @param tags the tags value to set. + * @return the BillingProfile object itself. + */ + public BillingProfile withTags(Map tags) { + if (this.innerProperties() == null) { + this.innerProperties = new BillingProfileProperties(); + } + this.innerProperties().withTags(tags); + return this; + } + + /** + * Get the targetClouds property: 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. + * + * @return the targetClouds value. */ - Map tags(); + public List targetClouds() { + return this.innerProperties() == null ? null : this.innerProperties().targetClouds(); + } /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingProfileInner object. + * Validates the instance. * - * @return the inner object. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - BillingProfileInner innerModel(); + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileAutoGenerated.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileAutoGenerated.java new file mode 100644 index 0000000000000..e8915c05b100e --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileAutoGenerated.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BillingProfileAutoGenerated. */ +public interface BillingProfileAutoGenerated { + /** + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. + * + * @return the billingRelationshipType value. + */ + BillingRelationshipType billingRelationshipType(); + + /** + * Gets the billTo property: Billing address. + * + * @return the billTo value. + */ + AddressDetails billTo(); + + /** + * Gets the currency property: The currency in which the charges for the billing profile are billed. + * + * @return the currency value. + */ + String currency(); + + /** + * Gets the displayName property: The name of the billing profile. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the enabledAzurePlans property: Information about the enabled azure plans. + * + * @return the enabledAzurePlans value. + */ + List enabledAzurePlans(); + + /** + * Gets the hasReadAccess property: Indicates whether user has read access to the billing profile. + * + * @return the hasReadAccess value. + */ + Boolean hasReadAccess(); + + /** + * Gets the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing + * profile in indirect purchase motion. + * + * @return the indirectRelationshipInfo value. + */ + IndirectRelationshipInfo indirectRelationshipInfo(); + + /** + * Gets the invoiceDay property: The day of the month when the invoice for the billing profile is generated. + * + * @return the invoiceDay value. + */ + Integer invoiceDay(); + + /** + * Gets the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent + * through email. + * + * @return the invoiceEmailOptIn value. + */ + Boolean invoiceEmailOptIn(); + + /** + * Gets the invoiceSections property: The invoice sections associated to the billing profile. By default this is not + * populated, unless it's specified in $expand. + * + * @return the invoiceSections value. + */ + InvoiceSectionsOnExpandAutoGenerated invoiceSections(); + + /** + * Gets the poNumber property: The purchase order name that will appear on the invoices generated for the billing + * profile. + * + * @return the poNumber value. + */ + String poNumber(); + + /** + * Gets the spendingLimit property: The billing profile spending limit. + * + * @return the spendingLimit value. + */ + SpendingLimit spendingLimit(); + + /** + * Gets the status property: The status of the billing profile. + * + * @return the status value. + */ + BillingProfileStatus status(); + + /** + * Gets the statusReasonCode property: Reason for the specified billing profile status. + * + * @return the statusReasonCode value. + */ + StatusReasonCode statusReasonCode(); + + /** + * Gets the systemId property: The system generated unique identifier for a billing profile. + * + * @return the systemId value. + */ + String systemId(); + + /** + * Gets the tags property: Tags of billing profiles. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the targetClouds property: 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. + * + * @return the targetClouds value. + */ + List targetClouds(); + + /** + * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner object. + * + * @return the inner object. + */ + BillingProfileAutoGeneratedInner innerModel(); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileListResult.java index 454ceba278576..e17d56fd243f8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileListResult.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.billing.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -13,10 +13,10 @@ @Immutable public final class BillingProfileListResult { /* - * The list of billing profiles. + * The link (url) to the next page of results. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; /* * Total number of records. @@ -25,22 +25,22 @@ public final class BillingProfileListResult { private Integer totalCount; /* - * The link (url) to the next page of results. + * The list of billing profiles. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; /** Creates an instance of BillingProfileListResult class. */ public BillingProfileListResult() { } /** - * Get the value property: The list of billing profiles. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** @@ -53,12 +53,12 @@ public Integer totalCount() { } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of billing profiles. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfiles.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfiles.java index a07795c96dc07..17f35a387e785 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfiles.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfiles.java @@ -7,7 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner; /** Resource collection API of BillingProfiles. */ public interface BillingProfiles { @@ -21,7 +21,7 @@ public interface BillingProfiles { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing profiles as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByBillingAccount(String billingAccountName); /** * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with @@ -35,7 +35,8 @@ public interface BillingProfiles { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of billing profiles as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingAccount(String billingAccountName, String expand, Context context); + PagedIterable listByBillingAccount( + String billingAccountName, String expand, Context context); /** * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft @@ -50,7 +51,7 @@ public interface BillingProfiles { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a billing profile by its ID along with {@link Response}. */ - Response getWithResponse( + Response getWithResponse( String billingAccountName, String billingProfileName, String expand, Context context); /** @@ -64,7 +65,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a billing profile by its ID. */ - BillingProfile get(String billingAccountName, String billingProfileName); + BillingProfileAutoGenerated get(String billingAccountName, String billingProfileName); /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type @@ -78,7 +79,8 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a billing profile. */ - BillingProfile createOrUpdate(String billingAccountName, String billingProfileName, BillingProfileInner parameters); + BillingProfileAutoGenerated createOrUpdate( + String billingAccountName, String billingProfileName, BillingProfileAutoGeneratedInner parameters); /** * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type @@ -93,6 +95,9 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a billing profile. */ - BillingProfile createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context); + BillingProfileAutoGenerated createOrUpdate( + String billingAccountName, + String billingProfileName, + BillingProfileAutoGeneratedInner parameters, + Context context); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesOnExpand.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesOnExpand.java index 065cefc415eea..fa4199021ca12 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesOnExpand.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesOnExpand.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.billing.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -26,7 +25,7 @@ public final class BillingProfilesOnExpand { * The billing profiles associated with the billing account. */ @JsonProperty(value = "value") - private List value; + private List value; /** Creates an instance of BillingProfilesOnExpand class. */ public BillingProfilesOnExpand() { @@ -48,7 +47,7 @@ public Boolean hasMoreResults() { * * @return the value value. */ - public List value() { + public List value() { return this.value; } @@ -58,7 +57,7 @@ public List value() { * @param value the value value to set. * @return the BillingProfilesOnExpand object itself. */ - public BillingProfilesOnExpand withValue(List value) { + public BillingProfilesOnExpand withValue(List value) { this.value = value; return this; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperties.java index 84c357a8fe6e8..bab9a474684c9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperties.java @@ -14,28 +14,32 @@ public interface BillingProperties { * Get the billing properties for a subscription. This operation is not supported for billing accounts with * agreement type Enterprise Agreement. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the billing properties for a subscription along with {@link Response}. */ - Response getWithResponse(Context context); + Response getWithResponse(String subscriptionId, Context context); /** * Get the billing properties for a subscription. This operation is not supported for billing accounts with * agreement type Enterprise Agreement. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the billing properties for a subscription. */ - BillingProperty get(); + BillingProperty get(String subscriptionId); /** * 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing property operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -43,17 +47,19 @@ public interface BillingProperties { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a billing property along with {@link Response}. */ - Response updateWithResponse(BillingPropertyInner parameters, Context context); + Response updateWithResponse( + String subscriptionId, BillingPropertyInner parameters, Context context); /** * 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing property operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a billing property. */ - BillingProperty update(BillingPropertyInner parameters); + BillingProperty update(String subscriptionId, BillingPropertyInner parameters); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperty.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperty.java index 14688c694a2e2..74521d1167f51 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperty.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperty.java @@ -4,12 +4,14 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; /** An immutable client-side representation of BillingProperty. */ public interface BillingProperty { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -23,12 +25,19 @@ public interface BillingProperty { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the accountAdminNotificationEmailAddress property: The email address on which the account admin gets all * Azure notifications. @@ -38,11 +47,11 @@ public interface BillingProperty { String accountAdminNotificationEmailAddress(); /** - * Gets the billingTenantId property: The Azure AD tenant ID of the billing account for the subscription. + * Gets the billingAccountDisplayName property: The name of the billing account to which the subscription is billed. * - * @return the billingTenantId value. + * @return the billingAccountDisplayName value. */ - String billingTenantId(); + String billingAccountDisplayName(); /** * Gets the billingAccountId property: The ID of the billing account to which the subscription is billed. @@ -52,11 +61,11 @@ public interface BillingProperty { String billingAccountId(); /** - * Gets the billingAccountDisplayName property: The name of the billing account to which the subscription is billed. + * Gets the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. * - * @return the billingAccountDisplayName value. + * @return the billingProfileDisplayName value. */ - String billingAccountDisplayName(); + String billingProfileDisplayName(); /** * Gets the billingProfileId property: The ID of the billing profile to which the subscription is billed. @@ -66,11 +75,11 @@ public interface BillingProperty { String billingProfileId(); /** - * Gets the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. + * Gets the billingProfileSpendingLimit property: The billing profile spending limit. * - * @return the billingProfileDisplayName value. + * @return the billingProfileSpendingLimit value. */ - String billingProfileDisplayName(); + BillingProfileSpendingLimit billingProfileSpendingLimit(); /** * Gets the billingProfileStatus property: The status of the billing profile. @@ -87,11 +96,11 @@ public interface BillingProperty { BillingProfileStatusReasonCode billingProfileStatusReasonCode(); /** - * Gets the billingProfileSpendingLimit property: The billing profile spending limit. + * Gets the billingTenantId property: The Azure AD tenant ID of the billing account for the subscription. * - * @return the billingProfileSpendingLimit value. + * @return the billingTenantId value. */ - BillingProfileSpendingLimit billingProfileSpendingLimit(); + String billingTenantId(); /** * Gets the costCenter property: The cost center applied to the subscription. @@ -101,18 +110,18 @@ public interface BillingProperty { String costCenter(); /** - * Gets the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. + * Gets the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. * - * @return the invoiceSectionId value. + * @return the invoiceSectionDisplayName value. */ - String invoiceSectionId(); + String invoiceSectionDisplayName(); /** - * Gets the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. + * Gets the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. * - * @return the invoiceSectionDisplayName value. + * @return the invoiceSectionId value. */ - String invoiceSectionDisplayName(); + String invoiceSectionId(); /** * Gets the isAccountAdmin property: Indicates whether user is the account admin. @@ -136,18 +145,18 @@ public interface BillingProperty { String productName(); /** - * Gets the skuId property: The sku ID of the Azure plan for the subscription. + * Gets the skuDescription property: The sku description of the Azure plan for the subscription. * - * @return the skuId value. + * @return the skuDescription value. */ - String skuId(); + String skuDescription(); /** - * Gets the skuDescription property: The sku description of the Azure plan for the subscription. + * Gets the skuId property: The sku ID of the Azure plan for the subscription. * - * @return the skuDescription value. + * @return the skuId value. */ - String skuDescription(); + String skuId(); /** * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner object. diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequest.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequest.java new file mode 100644 index 0000000000000..5b4f5e0e8095d --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequest.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.billing.fluent.models.BillingRequestInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BillingRequest. */ +public interface BillingRequest { + /** + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the additionalInformation property: Additional information for the billing request. + * + * @return the additionalInformation value. + */ + Map additionalInformation(); + + /** + * Gets the reviewedBy property: UPN of request reviewer. Will only be set if request is approved. + * + * @return the reviewedBy value. + */ + String reviewedBy(); + + /** + * Gets the reviewalDate property: The date and time when the request was reviewed. + * + * @return the reviewalDate value. + */ + String reviewalDate(); + + /** + * Gets the billingAccountId property: The fully qualified ID that uniquely identifies a billing account. + * + * @return the billingAccountId value. + */ + String billingAccountId(); + + /** + * Gets the billingAccountName property: The ID that uniquely identifies a billing account. + * + * @return the billingAccountName value. + */ + String billingAccountName(); + + /** + * Gets the billingAccountDisplayName property: The name of the billing account. + * + * @return the billingAccountDisplayName value. + */ + String billingAccountDisplayName(); + + /** + * Gets the billingAccountPrimaryBillingTenantId property: The primary tenant ID of the billing account for which + * the billing request was submitted. + * + * @return the billingAccountPrimaryBillingTenantId value. + */ + String billingAccountPrimaryBillingTenantId(); + + /** + * Gets the billingProfileId property: The fully qualified ID that uniquely identifies a billing profile. + * + * @return the billingProfileId value. + */ + String billingProfileId(); + + /** + * Gets the billingProfileName property: The ID that uniquely identifies a billing profile. + * + * @return the billingProfileName value. + */ + String billingProfileName(); + + /** + * Gets the billingProfileDisplayName property: The name of the billing profile for the invoice section or customer. + * + * @return the billingProfileDisplayName value. + */ + String billingProfileDisplayName(); + + /** + * Gets the createdBy property: UPN of user who created the request. + * + * @return the createdBy value. + */ + String createdBy(); + + /** + * Gets the creationDate property: The date and time when the request was created. + * + * @return the creationDate value. + */ + String creationDate(); + + /** + * Gets the expirationDate property: The date and time when the request expires. + * + * @return the expirationDate value. + */ + String expirationDate(); + + /** + * Gets the decisionReason property: The reason to approve or decline the request. + * + * @return the decisionReason value. + */ + String decisionReason(); + + /** + * Gets the invoiceSectionId property: The fully qualified ID that uniquely identifies an invoice section. + * + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + + /** + * Gets the invoiceSectionName property: The ID that uniquely identifies an invoice section. + * + * @return the invoiceSectionName value. + */ + String invoiceSectionName(); + + /** + * Gets the invoiceSectionDisplayName property: The name of the invoice section. + * + * @return the invoiceSectionDisplayName value. + */ + String invoiceSectionDisplayName(); + + /** + * Gets the customerId property: The fully qualified ID that uniquely identifies a customer. + * + * @return the customerId value. + */ + String customerId(); + + /** + * Gets the customerName property: The ID that uniquely identifies a customer. + * + * @return the customerName value. + */ + String customerName(); + + /** + * Gets the customerDisplayName property: The name of the customer. + * + * @return the customerDisplayName value. + */ + String customerDisplayName(); + + /** + * Gets the subscriptionId property: The fully qualified ID that uniquely identifies a billing subscription. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Gets the subscriptionName property: The ID that uniquely identifies a billing subscription. + * + * @return the subscriptionName value. + */ + String subscriptionName(); + + /** + * Gets the subscriptionDisplayName property: The name of the billing subscription. + * + * @return the subscriptionDisplayName value. + */ + String subscriptionDisplayName(); + + /** + * Gets the justification property: Justification for submitting request. + * + * @return the justification value. + */ + String justification(); + + /** + * Gets the recipients property: The recipients of the billing request. + * + * @return the recipients value. + */ + List recipients(); + + /** + * Gets the scope property: The billing scope for which the request was submitted (ex. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'). + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the status property: Status of billing request. + * + * @return the status value. + */ + BillingRequestStatus status(); + + /** + * Gets the typePropertiesType property: Type of billing request. + * + * @return the typePropertiesType value. + */ + BillingRequestType typePropertiesType(); + + /** + * Gets the lastUpdatedBy property: UPN of the user who last updated the request. + * + * @return the lastUpdatedBy value. + */ + String lastUpdatedBy(); + + /** + * Gets the lastUpdatedDate property: Date and time of last update. + * + * @return the lastUpdatedDate value. + */ + String lastUpdatedDate(); + + /** + * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingRequestInner object. + * + * @return the inner object. + */ + BillingRequestInner innerModel(); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriodsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestListResult.java similarity index 68% rename from sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriodsListResult.java rename to sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestListResult.java index 8e0037413f780..18e9244803087 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriodsListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestListResult.java @@ -5,38 +5,27 @@ package com.azure.resourcemanager.billing.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; +import com.azure.resourcemanager.billing.fluent.models.BillingRequestInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * Result of listing billing periods. It contains a list of available billing periods in reverse chronological order. - */ +/** A container for a list of resources. */ @Immutable -public final class BillingPeriodsListResult { - /* - * The list of billing periods. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - +public final class BillingRequestListResult { /* * The link (url) to the next page of results. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of BillingPeriodsListResult class. */ - public BillingPeriodsListResult() { - } - - /** - * Get the value property: The list of billing periods. - * - * @return the value value. + /* + * The list of resources. */ - public List value() { - return this.value; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of BillingRequestListResult class. */ + public BillingRequestListResult() { } /** @@ -48,6 +37,15 @@ public String nextLink() { return this.nextLink; } + /** + * Get the value property: The list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + /** * Validates the instance. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestPropertiesAutoGenerated.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestPropertiesAutoGenerated.java new file mode 100644 index 0000000000000..9ef91a16a381f --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestPropertiesAutoGenerated.java @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A billing request. */ +@Fluent +public class BillingRequestPropertiesAutoGenerated { + /* + * Additional information for the billing request. + */ + @JsonProperty(value = "additionalInformation") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalInformation; + + /* + * UPN of request reviewer. Will only be set if request is approved. + */ + @JsonProperty(value = "reviewedBy", access = JsonProperty.Access.WRITE_ONLY) + private String reviewedBy; + + /* + * The date and time when the request was reviewed. + */ + @JsonProperty(value = "reviewalDate", access = JsonProperty.Access.WRITE_ONLY) + private String reviewalDate; + + /* + * The fully qualified ID that uniquely identifies a billing account. + */ + @JsonProperty(value = "billingAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountId; + + /* + * The ID that uniquely identifies a billing account. + */ + @JsonProperty(value = "billingAccountName", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountName; + + /* + * The name of the billing account. + */ + @JsonProperty(value = "billingAccountDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountDisplayName; + + /* + * The primary tenant ID of the billing account for which the billing request was submitted. + */ + @JsonProperty(value = "billingAccountPrimaryBillingTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountPrimaryBillingTenantId; + + /* + * The fully qualified ID that uniquely identifies a billing profile. + */ + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /* + * The ID that uniquely identifies a billing profile. + */ + @JsonProperty(value = "billingProfileName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileName; + + /* + * The name of the billing profile for the invoice section or customer. + */ + @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; + + /* + * UPN of user who created the request. + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private String createdBy; + + /* + * The date and time when the request was created. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private String creationDate; + + /* + * The date and time when the request expires. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private String expirationDate; + + /* + * The reason to approve or decline the request. + */ + @JsonProperty(value = "decisionReason") + private String decisionReason; + + /* + * The fully qualified ID that uniquely identifies an invoice section. + */ + @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /* + * The ID that uniquely identifies an invoice section. + */ + @JsonProperty(value = "invoiceSectionName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionName; + + /* + * The name of the invoice section. + */ + @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionDisplayName; + + /* + * The fully qualified ID that uniquely identifies a customer. + */ + @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; + + /* + * The ID that uniquely identifies a customer. + */ + @JsonProperty(value = "customerName", access = JsonProperty.Access.WRITE_ONLY) + private String customerName; + + /* + * The name of the customer. + */ + @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String customerDisplayName; + + /* + * The fully qualified ID that uniquely identifies a billing subscription. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /* + * The ID that uniquely identifies a billing subscription. + */ + @JsonProperty(value = "subscriptionName", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionName; + + /* + * The name of the billing subscription. + */ + @JsonProperty(value = "subscriptionDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionDisplayName; + + /* + * Justification for submitting request. + */ + @JsonProperty(value = "justification") + private String justification; + + /* + * The recipients of the billing request. + */ + @JsonProperty(value = "recipients") + private List recipients; + + /* + * The billing scope for which the request was submitted (ex. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'). + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * Status of billing request. + */ + @JsonProperty(value = "status") + private BillingRequestStatus status; + + /* + * Type of billing request. + */ + @JsonProperty(value = "type") + private BillingRequestType type; + + /* + * UPN of the user who last updated the request. + */ + @JsonProperty(value = "lastUpdatedBy", access = JsonProperty.Access.WRITE_ONLY) + private String lastUpdatedBy; + + /* + * Date and time of last update. + */ + @JsonProperty(value = "lastUpdatedDate", access = JsonProperty.Access.WRITE_ONLY) + private String lastUpdatedDate; + + /** Creates an instance of BillingRequestPropertiesAutoGenerated class. */ + public BillingRequestPropertiesAutoGenerated() { + } + + /** + * Get the additionalInformation property: Additional information for the billing request. + * + * @return the additionalInformation value. + */ + public Map additionalInformation() { + return this.additionalInformation; + } + + /** + * Set the additionalInformation property: Additional information for the billing request. + * + * @param additionalInformation the additionalInformation value to set. + * @return the BillingRequestPropertiesAutoGenerated object itself. + */ + public BillingRequestPropertiesAutoGenerated withAdditionalInformation(Map additionalInformation) { + this.additionalInformation = additionalInformation; + return this; + } + + /** + * Get the reviewedBy property: UPN of request reviewer. Will only be set if request is approved. + * + * @return the reviewedBy value. + */ + public String reviewedBy() { + return this.reviewedBy; + } + + /** + * Get the reviewalDate property: The date and time when the request was reviewed. + * + * @return the reviewalDate value. + */ + public String reviewalDate() { + return this.reviewalDate; + } + + /** + * Get the billingAccountId property: The fully qualified ID that uniquely identifies a billing account. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Get the billingAccountName property: The ID that uniquely identifies a billing account. + * + * @return the billingAccountName value. + */ + public String billingAccountName() { + return this.billingAccountName; + } + + /** + * Get the billingAccountDisplayName property: The name of the billing account. + * + * @return the billingAccountDisplayName value. + */ + public String billingAccountDisplayName() { + return this.billingAccountDisplayName; + } + + /** + * Get the billingAccountPrimaryBillingTenantId property: The primary tenant ID of the billing account for which the + * billing request was submitted. + * + * @return the billingAccountPrimaryBillingTenantId value. + */ + public String billingAccountPrimaryBillingTenantId() { + return this.billingAccountPrimaryBillingTenantId; + } + + /** + * Get the billingProfileId property: The fully qualified ID that uniquely identifies a billing profile. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get the billingProfileName property: The ID that uniquely identifies a billing profile. + * + * @return the billingProfileName value. + */ + public String billingProfileName() { + return this.billingProfileName; + } + + /** + * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section or customer. + * + * @return the billingProfileDisplayName value. + */ + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; + } + + /** + * Get the createdBy property: UPN of user who created the request. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Get the creationDate property: The date and time when the request was created. + * + * @return the creationDate value. + */ + public String creationDate() { + return this.creationDate; + } + + /** + * Get the expirationDate property: The date and time when the request expires. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the decisionReason property: The reason to approve or decline the request. + * + * @return the decisionReason value. + */ + public String decisionReason() { + return this.decisionReason; + } + + /** + * Set the decisionReason property: The reason to approve or decline the request. + * + * @param decisionReason the decisionReason value to set. + * @return the BillingRequestPropertiesAutoGenerated object itself. + */ + public BillingRequestPropertiesAutoGenerated withDecisionReason(String decisionReason) { + this.decisionReason = decisionReason; + return this; + } + + /** + * Get the invoiceSectionId property: The fully qualified ID that uniquely identifies an invoice section. + * + * @return the invoiceSectionId value. + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get the invoiceSectionName property: The ID that uniquely identifies an invoice section. + * + * @return the invoiceSectionName value. + */ + public String invoiceSectionName() { + return this.invoiceSectionName; + } + + /** + * Get the invoiceSectionDisplayName property: The name of the invoice section. + * + * @return the invoiceSectionDisplayName value. + */ + public String invoiceSectionDisplayName() { + return this.invoiceSectionDisplayName; + } + + /** + * Get the customerId property: The fully qualified ID that uniquely identifies a customer. + * + * @return the customerId value. + */ + public String customerId() { + return this.customerId; + } + + /** + * Get the customerName property: The ID that uniquely identifies a customer. + * + * @return the customerName value. + */ + public String customerName() { + return this.customerName; + } + + /** + * Get the customerDisplayName property: The name of the customer. + * + * @return the customerDisplayName value. + */ + public String customerDisplayName() { + return this.customerDisplayName; + } + + /** + * Get the subscriptionId property: The fully qualified ID that uniquely identifies a billing subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the subscriptionName property: The ID that uniquely identifies a billing subscription. + * + * @return the subscriptionName value. + */ + public String subscriptionName() { + return this.subscriptionName; + } + + /** + * Get the subscriptionDisplayName property: The name of the billing subscription. + * + * @return the subscriptionDisplayName value. + */ + public String subscriptionDisplayName() { + return this.subscriptionDisplayName; + } + + /** + * Get the justification property: Justification for submitting request. + * + * @return the justification value. + */ + public String justification() { + return this.justification; + } + + /** + * Set the justification property: Justification for submitting request. + * + * @param justification the justification value to set. + * @return the BillingRequestPropertiesAutoGenerated object itself. + */ + public BillingRequestPropertiesAutoGenerated withJustification(String justification) { + this.justification = justification; + return this; + } + + /** + * Get the recipients property: The recipients of the billing request. + * + * @return the recipients value. + */ + public List recipients() { + return this.recipients; + } + + /** + * Set the recipients property: The recipients of the billing request. + * + * @param recipients the recipients value to set. + * @return the BillingRequestPropertiesAutoGenerated object itself. + */ + public BillingRequestPropertiesAutoGenerated withRecipients(List recipients) { + this.recipients = recipients; + return this; + } + + /** + * Get the scope property: The billing scope for which the request was submitted (ex. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'). + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The billing scope for which the request was submitted (ex. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'). + * + * @param scope the scope value to set. + * @return the BillingRequestPropertiesAutoGenerated object itself. + */ + public BillingRequestPropertiesAutoGenerated withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the status property: Status of billing request. + * + * @return the status value. + */ + public BillingRequestStatus status() { + return this.status; + } + + /** + * Set the status property: Status of billing request. + * + * @param status the status value to set. + * @return the BillingRequestPropertiesAutoGenerated object itself. + */ + public BillingRequestPropertiesAutoGenerated withStatus(BillingRequestStatus status) { + this.status = status; + return this; + } + + /** + * Get the type property: Type of billing request. + * + * @return the type value. + */ + public BillingRequestType type() { + return this.type; + } + + /** + * Set the type property: Type of billing request. + * + * @param type the type value to set. + * @return the BillingRequestPropertiesAutoGenerated object itself. + */ + public BillingRequestPropertiesAutoGenerated withType(BillingRequestType type) { + this.type = type; + return this; + } + + /** + * Get the lastUpdatedBy property: UPN of the user who last updated the request. + * + * @return the lastUpdatedBy value. + */ + public String lastUpdatedBy() { + return this.lastUpdatedBy; + } + + /** + * Get the lastUpdatedDate property: Date and time of last update. + * + * @return the lastUpdatedDate value. + */ + public String lastUpdatedDate() { + return this.lastUpdatedDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestStatus.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestStatus.java new file mode 100644 index 0000000000000..d2ff4d9ab12e8 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestStatus.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Status of billing request. */ +public final class BillingRequestStatus extends ExpandableStringEnum { + /** Static value Unknown for BillingRequestStatus. */ + public static final BillingRequestStatus UNKNOWN = fromString("Unknown"); + + /** Static value Pending for BillingRequestStatus. */ + public static final BillingRequestStatus PENDING = fromString("Pending"); + + /** Static value Approved for BillingRequestStatus. */ + public static final BillingRequestStatus APPROVED = fromString("Approved"); + + /** Static value Declined for BillingRequestStatus. */ + public static final BillingRequestStatus DECLINED = fromString("Declined"); + + /** Static value Cancelled for BillingRequestStatus. */ + public static final BillingRequestStatus CANCELLED = fromString("Cancelled"); + + /** Static value Completed for BillingRequestStatus. */ + public static final BillingRequestStatus COMPLETED = fromString("Completed"); + + /** Static value Expired for BillingRequestStatus. */ + public static final BillingRequestStatus EXPIRED = fromString("Expired"); + + /** + * Creates a new instance of BillingRequestStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BillingRequestStatus() { + } + + /** + * Creates or finds a BillingRequestStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BillingRequestStatus. + */ + @JsonCreator + public static BillingRequestStatus fromString(String name) { + return fromString(name, BillingRequestStatus.class); + } + + /** + * Gets known BillingRequestStatus values. + * + * @return known BillingRequestStatus values. + */ + public static Collection values() { + return values(BillingRequestStatus.class); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestType.java new file mode 100644 index 0000000000000..7b2714d49b20a --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequestType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of billing request. */ +public final class BillingRequestType extends ExpandableStringEnum { + /** Static value Unknown for BillingRequestType. */ + public static final BillingRequestType UNKNOWN = fromString("Unknown"); + + /** Static value InvoiceAccess for BillingRequestType. */ + public static final BillingRequestType INVOICE_ACCESS = fromString("InvoiceAccess"); + + /** Static value ProvisioningAccess for BillingRequestType. */ + public static final BillingRequestType PROVISIONING_ACCESS = fromString("ProvisioningAccess"); + + /** Static value RoleAssignment for BillingRequestType. */ + public static final BillingRequestType ROLE_ASSIGNMENT = fromString("RoleAssignment"); + + /** Static value UpdateBillingPolicy for BillingRequestType. */ + public static final BillingRequestType UPDATE_BILLING_POLICY = fromString("UpdateBillingPolicy"); + + /** + * Creates a new instance of BillingRequestType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BillingRequestType() { + } + + /** + * Creates or finds a BillingRequestType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BillingRequestType. + */ + @JsonCreator + public static BillingRequestType fromString(String name) { + return fromString(name, BillingRequestType.class); + } + + /** + * Gets known BillingRequestType values. + * + * @return known BillingRequestType values. + */ + public static Collection values() { + return values(BillingRequestType.class); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequests.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequests.java new file mode 100644 index 0000000000000..4d039df4aeff7 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRequests.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.billing.fluent.models.BillingRequestInner; + +/** Resource collection API of BillingRequests. */ +public interface BillingRequests { + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingAccount(String billingAccountName); + + /** + * The list of billing requests submitted for the billing account. + * + * @param billingAccountName The ID that uniquely identifies a billing account. + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingAccount( + String billingAccountName, + String filter, + String orderBy, + Long top, + Long skip, + Boolean count, + String search, + Context context); + + /** + * The list of billing requests submitted by a user. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByUser(); + + /** + * The list of billing requests submitted by a user. + * + * @param filter The filter query option allows clients to filter a collection of resources that are addressed by a + * request URL. + * @param orderBy The orderby query option allows clients to request resources in a particular order. + * @param top 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. + * @param skip The skip query option requests the number of items in the queried collection that are to be skipped + * and not included in the result. + * @param count The count query option allows clients to request a count of the matching resources included with the + * resources in the response. + * @param search 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container for a list of resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByUser( + String filter, String orderBy, Long top, Long skip, Boolean count, String search, Context context); + + /** + * Gets a billing request by its ID. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request by its ID along with {@link Response}. + */ + Response getWithResponse(String billingRequestName, Context context); + + /** + * Gets a billing request by its ID. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request by its ID. + */ + BillingRequest get(String billingRequestName); + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request. + */ + BillingRequest createOrUpdate(String billingRequestName); + + /** + * Create or update a request. + * + * @param billingRequestName The ID that uniquely identifies a billing request. + * @param body A billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a billing request. + */ + BillingRequest createOrUpdate(String billingRequestName, BillingRequestInner body, Context context); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignment.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignment.java index 12309dabb5a29..b7cba2c3167a6 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignment.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignment.java @@ -4,12 +4,14 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; /** An immutable client-side representation of BillingRoleAssignment. */ public interface BillingRoleAssignment { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -23,32 +25,32 @@ public interface BillingRoleAssignment { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the createdOn property: The date the role assignment was created. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the createdOn value. + * @return the systemData value. */ - String createdOn(); + SystemData systemData(); /** - * Gets the createdByPrincipalTenantId property: The tenant Id of the user who created the role assignment. + * Gets the createdByPrincipalId property: The principal Id of the user who created the role assignment. * - * @return the createdByPrincipalTenantId value. + * @return the createdByPrincipalId value. */ - String createdByPrincipalTenantId(); + String createdByPrincipalId(); /** - * Gets the createdByPrincipalId property: The principal Id of the user who created the role assignment. + * Gets the createdByPrincipalTenantId property: The tenant Id of the user who created the role assignment. * - * @return the createdByPrincipalId value. + * @return the createdByPrincipalTenantId value. */ - String createdByPrincipalId(); + String createdByPrincipalTenantId(); /** * Gets the createdByUserEmailAddress property: The email address of the user who created the role assignment. @@ -57,6 +59,13 @@ public interface BillingRoleAssignment { */ String createdByUserEmailAddress(); + /** + * Gets the createdOn property: The date the role assignment was created. + * + * @return the createdOn value. + */ + String createdOn(); + /** * Gets the principalId property: The principal id of the user to whom the role was assigned. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignmentListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignmentListResult.java index 0c8573b0a5f9e..05b3a5b03e71f 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignmentListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignmentListResult.java @@ -12,38 +12,38 @@ /** The list of role assignments. */ @Immutable public final class BillingRoleAssignmentListResult { - /* - * The list of role assignments. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - /* * The link (url) to the next page of results. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /* + * The list of role assignments. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + /** Creates an instance of BillingRoleAssignmentListResult class. */ public BillingRoleAssignmentListResult() { } /** - * Get the value property: The list of role assignments. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of role assignments. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignments.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignments.java index b97391901fb89..836c1ed501f79 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignments.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignments.java @@ -11,38 +11,39 @@ /** Resource collection API of BillingRoleAssignments. */ public interface BillingRoleAssignments { /** - * 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 billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account along with {@link Response}. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context); + PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); /** - * 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 billing profile. The operation is supported for billing accounts + * with agreement type Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param billingProfileName The ID that uniquely identifies a billing profile. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - BillingRoleAssignment getByBillingAccount(String billingAccountName, String billingRoleAssignmentName); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context); /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts + * 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. * * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -50,163 +51,165 @@ Response getByBillingAccountWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the role assignment along with {@link Response}. */ - Response deleteByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context); + Response deleteByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the role assignment. */ - BillingRoleAssignment deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName); + BillingRoleAssignment deleteByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName); /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section along with {@link Response}. + * @return a role assignment for the caller on a billing profile along with {@link Response}. */ - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context); + Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. + * @return a role assignment for the caller on a billing profile. */ - BillingRoleAssignment getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName); + BillingRoleAssignment getByBillingProfile( + String billingAccountName, String billingProfileName, String billingRoleAssignmentName); /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response}. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - Response deleteByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName); /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. + * @return the list of role assignments as paginated response with {@link PagedIterable}. */ - BillingRoleAssignment deleteByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); /** - * 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. + * Deletes 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile along with {@link Response}. + * @return the role assignment along with {@link Response}. */ - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); + Response deleteByInvoiceSectionWithResponse( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName, + Context context); /** - * 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. + * Deletes 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. + * @return the role assignment. */ - BillingRoleAssignment getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName); + BillingRoleAssignment deleteByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName); /** - * 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. + * 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment along with {@link Response}. + * @return a role assignment for the caller on an invoice section along with {@link Response}. */ - Response deleteByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); + Response getByInvoiceSectionWithResponse( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName, + Context context); /** - * 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. + * 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 billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. + * @return a role assignment for the caller on an invoice section. */ - BillingRoleAssignment deleteByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName); + BillingRoleAssignment getByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleAssignmentName); /** * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts @@ -234,61 +237,58 @@ BillingRoleAssignment deleteByBillingProfile( PagedIterable listByBillingAccount(String billingAccountName, Context context); /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return the role assignment along with {@link Response}. */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); + Response deleteByBillingAccountWithResponse( + String billingAccountName, String billingRoleAssignmentName, Context context); /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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 billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return the role assignment. */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); + BillingRoleAssignment deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName); /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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. * * @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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return a role assignment for the caller on a billing account along with {@link Response}. */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); + Response getByBillingAccountWithResponse( + String billingAccountName, String billingRoleAssignmentName, Context context); /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. + * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. + * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments as paginated response with {@link PagedIterable}. + * @return a role assignment for the caller on a billing account. */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); + BillingRoleAssignment getByBillingAccount(String billingAccountName, String billingRoleAssignmentName); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinition.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinition.java index c1b7fbb0c17bc..983fb2d5e6edd 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinition.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinition.java @@ -4,13 +4,15 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; import java.util.List; /** An immutable client-side representation of BillingRoleDefinition. */ public interface BillingRoleDefinition { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -24,12 +26,19 @@ public interface BillingRoleDefinition { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the description property: The role description. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitionListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitionListResult.java index 80c001a0a0864..a6b6ae25c99c5 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitionListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitionListResult.java @@ -12,38 +12,38 @@ /** The list of role definitions. */ @Immutable public final class BillingRoleDefinitionListResult { - /* - * The role definitions. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - /* * The link (url) to the next page of results. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /* + * The role definitions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + /** Creates an instance of BillingRoleDefinitionListResult class. */ public BillingRoleDefinitionListResult() { } /** - * Get the value property: The role definitions. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The role definitions. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitions.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitions.java index 2bad7e3a7929f..d8cd87c334431 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitions.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitions.java @@ -11,72 +11,32 @@ /** Resource collection API of BillingRoleDefinitions. */ public interface BillingRoleDefinitions { /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account along with {@link Response}. - */ - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - BillingRoleDefinition getByBillingAccount(String billingAccountName, String billingRoleDefinitionName); - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section along with {@link Response}. + * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName, - Context context); + PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. + * 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 invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. + * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - BillingRoleDefinition getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context); /** * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with @@ -110,86 +70,126 @@ BillingRoleDefinition getByBillingProfile( String billingAccountName, String billingProfileName, String billingRoleDefinitionName); /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName); /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingAccount(String billingAccountName, Context context); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); /** - * 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. + * 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedIterable}. + * @return the definition for a role on an invoice section along with {@link Response}. */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); + Response getByInvoiceSectionWithResponse( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleDefinitionName, + Context context); /** - * 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. + * 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 context The context to associate with this operation. + * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions as paginated response with {@link PagedIterable}. + * @return the definition for a role on an invoice section. */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); + BillingRoleDefinition getByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String billingRoleDefinitionName); /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); + PagedIterable listByBillingAccount(String billingAccountName); /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement + * 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 billingProfileName The ID that uniquely identifies a billing profile. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of role definitions as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); + PagedIterable listByBillingAccount(String billingAccountName, Context context); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the definition for a role on a billing account along with {@link Response}. + */ + Response getByBillingAccountWithResponse( + String billingAccountName, String billingRoleDefinitionName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the definition for a role on a billing account. + */ + BillingRoleDefinition getByBillingAccount(String billingAccountName, String billingRoleDefinitionName); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscription.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscription.java index c2943229bbc6d..0cf93af7db0f7 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscription.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscription.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; import java.util.List; import java.util.UUID; @@ -11,7 +12,8 @@ /** An immutable client-side representation of BillingSubscription. */ public interface BillingSubscription { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -25,46 +27,25 @@ public interface BillingSubscription { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the displayName property: The name of the subscription. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the subscriptionId property: The ID of the subscription. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the subscriptionId value. + * @return the systemData value. */ - UUID subscriptionId(); + SystemData systemData(); /** - * Gets the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @return the subscriptionBillingStatus value. - */ - BillingSubscriptionStatusType subscriptionBillingStatus(); - - /** - * Gets the lastMonthCharges property: The last month charges. - * - * @return the lastMonthCharges value. - */ - Amount lastMonthCharges(); - - /** - * Gets the monthToDateCharges property: The current month to date charges. + * Gets the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. * - * @return the monthToDateCharges value. + * @return the billingProfileDisplayName value. */ - Amount monthToDateCharges(); + String billingProfileDisplayName(); /** * Gets the billingProfileId property: The ID of the billing profile to which the subscription is billed. @@ -74,18 +55,19 @@ public interface BillingSubscription { String billingProfileId(); /** - * Gets the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. + * Gets the costCenter property: The cost center applied to the subscription. * - * @return the billingProfileDisplayName value. + * @return the costCenter value. */ - String billingProfileDisplayName(); + String costCenter(); /** - * Gets the costCenter property: The cost center applied to the subscription. + * Gets the customerDisplayName property: The name of the customer for whom the subscription was created. The field + * is applicable only for Microsoft Partner Agreement billing account. * - * @return the costCenter value. + * @return the customerDisplayName value. */ - String costCenter(); + String customerDisplayName(); /** * Gets the customerId property: The ID of the customer for whom the subscription was created. The field is @@ -96,12 +78,18 @@ public interface BillingSubscription { String customerId(); /** - * Gets the customerDisplayName property: The name of the customer for whom the subscription was created. The field - * is applicable only for Microsoft Partner Agreement billing account. + * Gets the displayName property: The name of the subscription. * - * @return the customerDisplayName value. + * @return the displayName value. */ - String customerDisplayName(); + String displayName(); + + /** + * Gets the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. + * + * @return the invoiceSectionDisplayName value. + */ + String invoiceSectionDisplayName(); /** * Gets the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. @@ -111,11 +99,18 @@ public interface BillingSubscription { String invoiceSectionId(); /** - * Gets the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. + * Gets the lastMonthCharges property: The last month charges. * - * @return the invoiceSectionDisplayName value. + * @return the lastMonthCharges value. */ - String invoiceSectionDisplayName(); + Amount lastMonthCharges(); + + /** + * Gets the monthToDateCharges property: The current month to date charges. + * + * @return the monthToDateCharges value. + */ + Amount monthToDateCharges(); /** * Gets the reseller property: Reseller for this subscription. @@ -124,6 +119,13 @@ public interface BillingSubscription { */ Reseller reseller(); + /** + * Gets the skuDescription property: The sku description of the Azure plan for the subscription. + * + * @return the skuDescription value. + */ + String skuDescription(); + /** * Gets the skuId property: The sku ID of the Azure plan for the subscription. * @@ -132,11 +134,18 @@ public interface BillingSubscription { String skuId(); /** - * Gets the skuDescription property: The sku description of the Azure plan for the subscription. + * Gets the subscriptionBillingStatus property: The current billing status of the subscription. * - * @return the skuDescription value. + * @return the subscriptionBillingStatus value. */ - String skuDescription(); + BillingSubscriptionStatusType subscriptionBillingStatus(); + + /** + * Gets the subscriptionId property: The ID of the subscription. + * + * @return the subscriptionId value. + */ + UUID subscriptionId(); /** * Gets the suspensionReasons property: The suspension reason for a subscription. Applies only to subscriptions in diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptions.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptions.java index f2898f82f82ac..d91fb1f27c55f 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptions.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptions.java @@ -11,58 +11,6 @@ /** Resource collection API of BillingSubscriptions. */ public interface BillingSubscriptions { - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. - */ - PagedIterable listByCustomer(String billingAccountName, String customerName); - - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. - */ - PagedIterable listByCustomer(String billingAccountName, String customerName, Context context); - - /** - * Lists the subscriptions for a billing account. 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the subscriptions for a billing account. 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. - */ - PagedIterable listByBillingAccount(String billingAccountName, Context context); - /** * 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. @@ -122,36 +70,64 @@ PagedIterable listByInvoiceSection( PagedIterable listByInvoiceSection( String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); + /** + * Lists the subscriptions for a billing account. 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingAccount(String billingAccountName); + + /** + * Lists the subscriptions for a billing account. 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingAccount(String billingAccountName, Context context); + /** * Gets a subscription by its ID. 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 subscriptionId The ID that uniquely identifies a billing subscription. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a subscription by its ID along with {@link Response}. */ - Response getWithResponse(String billingAccountName, Context context); + Response getWithResponse(String billingAccountName, String subscriptionId, Context context); /** * Gets a subscription by its ID. 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 subscriptionId The ID that uniquely identifies a billing subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a subscription by its ID. */ - BillingSubscription get(String billingAccountName); + BillingSubscription get(String billingAccountName, String subscriptionId); /** * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -160,20 +136,21 @@ PagedIterable listByInvoiceSection( * @return a billing subscription along with {@link Response}. */ Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, Context context); + String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters, Context context); /** * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the update billing subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a billing subscription. */ - BillingSubscription update(String billingAccountName, BillingSubscriptionInner parameters); + BillingSubscription update(String billingAccountName, String subscriptionId, BillingSubscriptionInner parameters); /** * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing @@ -181,13 +158,15 @@ Response updateWithResponse( * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a billing subscription. */ - BillingSubscription move(String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); + BillingSubscription move( + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters); /** * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing @@ -195,6 +174,7 @@ Response updateWithResponse( * Microsoft Customer Agreement. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the move subscription operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -203,13 +183,17 @@ Response updateWithResponse( * @return a billing subscription. */ BillingSubscription move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context); /** * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the validate move eligibility operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -218,13 +202,17 @@ BillingSubscription move( * @return result of the transfer eligibility validation along with {@link Response}. */ Response validateMoveWithResponse( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); + String billingAccountName, + String subscriptionId, + TransferBillingSubscriptionRequestProperties parameters, + Context context); /** * 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. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param parameters Request parameters that are provided to the validate move eligibility operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -232,5 +220,32 @@ Response validateMoveWithResponse * @return result of the transfer eligibility validation. */ ValidateSubscriptionTransferEligibilityResult validateMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); + String billingAccountName, String subscriptionId, TransferBillingSubscriptionRequestProperties parameters); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCustomer(String billingAccountName, String customerName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of billing subscriptions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCustomer(String billingAccountName, String customerName, Context context); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsListResult.java index 9593b2711cd0b..bc81ad88d3fab 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsListResult.java @@ -13,10 +13,10 @@ @Immutable public final class BillingSubscriptionsListResult { /* - * The list of billing subscriptions. + * The link (url) to the next page of results. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; /* * Total number of records. @@ -25,22 +25,22 @@ public final class BillingSubscriptionsListResult { private Integer totalCount; /* - * The link (url) to the next page of results. + * The list of billing subscriptions. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; /** Creates an instance of BillingSubscriptionsListResult class. */ public BillingSubscriptionsListResult() { } /** - * Get the value property: The list of billing subscriptions. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** @@ -53,12 +53,12 @@ public Integer totalCount() { } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of billing subscriptions. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customer.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customer.java index 5bba073947f63..2b0fa32380ec0 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customer.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customer.java @@ -4,13 +4,15 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.CustomerInner; import java.util.List; /** An immutable client-side representation of Customer. */ public interface Customer { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -24,18 +26,18 @@ public interface Customer { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the billingProfileId property: The ID of the billing profile for the invoice section. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the billingProfileId value. + * @return the systemData value. */ - String billingProfileId(); + SystemData systemData(); /** * Gets the billingProfileDisplayName property: The name of the billing profile for the invoice section. @@ -44,6 +46,13 @@ public interface Customer { */ String billingProfileDisplayName(); + /** + * Gets the billingProfileId property: The ID of the billing profile for the invoice section. + * + * @return the billingProfileId value. + */ + String billingProfileId(); + /** * Gets the displayName property: The name of the customer. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerListResult.java index 771a360eb85e1..57dc98f1fbee9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerListResult.java @@ -13,10 +13,10 @@ @Immutable public final class CustomerListResult { /* - * The list of customers. + * The link (url) to the next page of results. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; /* * Total number of records. @@ -25,22 +25,22 @@ public final class CustomerListResult { private Integer totalCount; /* - * The link (url) to the next page of results. + * The list of customers. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; /** Creates an instance of CustomerListResult class. */ public CustomerListResult() { } /** - * Get the value property: The list of customers. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** @@ -53,12 +53,12 @@ public Integer totalCount() { } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of customers. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerPolicy.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerPolicy.java index 378612defd516..290ce5092f1f9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerPolicy.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerPolicy.java @@ -4,12 +4,14 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; /** An immutable client-side representation of CustomerPolicy. */ public interface CustomerPolicy { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -23,12 +25,19 @@ public interface CustomerPolicy { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the viewCharges property: The policy that controls whether the users in customer's organization can view * charges at pay-as-you-go prices. diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Department.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Department.java index f706b53a7be92..4b72356d9c6e8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Department.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Department.java @@ -5,14 +5,13 @@ package com.azure.resourcemanager.billing.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.fluent.models.DepartmentProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A department. */ @Fluent -public final class Department extends ProxyResource { +public final class Department extends ArmResource { /* * A department. */ @@ -32,29 +31,6 @@ private DepartmentProperties innerProperties() { return this.innerProperties; } - /** - * Get the departmentName property: The name of the department. - * - * @return the departmentName value. - */ - public String departmentName() { - return this.innerProperties() == null ? null : this.innerProperties().departmentName(); - } - - /** - * Set the departmentName property: The name of the department. - * - * @param departmentName the departmentName value to set. - * @return the Department object itself. - */ - public Department withDepartmentName(String departmentName) { - if (this.innerProperties() == null) { - this.innerProperties = new DepartmentProperties(); - } - this.innerProperties().withDepartmentName(departmentName); - return this; - } - /** * Get the costCenter property: The cost center associated with the department. * @@ -79,25 +55,25 @@ public Department withCostCenter(String costCenter) { } /** - * Get the status property: The status of the department. + * Get the departmentName property: The name of the department. * - * @return the status value. + * @return the departmentName value. */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); + public String departmentName() { + return this.innerProperties() == null ? null : this.innerProperties().departmentName(); } /** - * Set the status property: The status of the department. + * Set the departmentName property: The name of the department. * - * @param status the status value to set. + * @param departmentName the departmentName value to set. * @return the Department object itself. */ - public Department withStatus(String status) { + public Department withDepartmentName(String departmentName) { if (this.innerProperties() == null) { this.innerProperties = new DepartmentProperties(); } - this.innerProperties().withStatus(status); + this.innerProperties().withDepartmentName(departmentName); return this; } @@ -126,12 +102,37 @@ public Department withEnrollmentAccounts(List enrollmentAccou return this; } + /** + * Get the status property: The status of the department. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the department. + * + * @param status the status value to set. + * @return the Department object itself. + */ + public Department withStatus(String status) { + if (this.innerProperties() == null) { + this.innerProperties = new DepartmentProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Document.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Document.java index 38c0dada032ae..0f1f800ca5a87 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Document.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Document.java @@ -16,18 +16,18 @@ public final class Document { @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) private DocumentType kind; - /* - * Document URL. - */ - @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) - private String url; - /* * The source of the document. ENF for Brazil and DRS for rest of the world. */ @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) private DocumentSource source; + /* + * Document URL. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + /** Creates an instance of Document class. */ public Document() { } @@ -42,21 +42,21 @@ public DocumentType kind() { } /** - * Get the url property: Document URL. + * Get the source property: The source of the document. ENF for Brazil and DRS for rest of the world. * - * @return the url value. + * @return the source value. */ - public String url() { - return this.url; + public DocumentSource source() { + return this.source; } /** - * Get the source property: The source of the document. ENF for Brazil and DRS for rest of the world. + * Get the url property: Document URL. * - * @return the source value. + * @return the url value. */ - public DocumentSource source() { - return this.source; + public String url() { + return this.url; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Enrollment.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Enrollment.java index 0655e43782240..9fc42edc3500b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Enrollment.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Enrollment.java @@ -12,34 +12,34 @@ @Fluent public final class Enrollment { /* - * The start date of the enrollment. + * The billing cycle for the enrollment. */ - @JsonProperty(value = "startDate") - private OffsetDateTime startDate; + @JsonProperty(value = "billingCycle", access = JsonProperty.Access.WRITE_ONLY) + private String billingCycle; /* - * The end date of the enrollment. + * The channel type of the enrollment. */ - @JsonProperty(value = "endDate") - private OffsetDateTime endDate; + @JsonProperty(value = "channel", access = JsonProperty.Access.WRITE_ONLY) + private String channel; /* - * The billing currency for the enrollment. + * The country code of the enrollment. */ - @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; + @JsonProperty(value = "countryCode", access = JsonProperty.Access.WRITE_ONLY) + private String countryCode; /* - * The channel type of the enrollment. + * The billing currency for the enrollment. */ - @JsonProperty(value = "channel", access = JsonProperty.Access.WRITE_ONLY) - private String channel; + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; /* - * The policies for Enterprise Agreement enrollments. + * The end date of the enrollment. */ - @JsonProperty(value = "policies", access = JsonProperty.Access.WRITE_ONLY) - private EnrollmentPolicies policies; + @JsonProperty(value = "endDate") + private OffsetDateTime endDate; /* * The language for the enrollment. @@ -48,45 +48,61 @@ public final class Enrollment { private String language; /* - * The country code of the enrollment. + * The policies for Enterprise Agreement enrollments. */ - @JsonProperty(value = "countryCode", access = JsonProperty.Access.WRITE_ONLY) - private String countryCode; + @JsonProperty(value = "policies", access = JsonProperty.Access.WRITE_ONLY) + private EnrollmentPolicies policies; /* - * The current status of the enrollment. + * The start date of the enrollment. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; + @JsonProperty(value = "startDate") + private OffsetDateTime startDate; /* - * The billing cycle for the enrollment. + * The current status of the enrollment. */ - @JsonProperty(value = "billingCycle", access = JsonProperty.Access.WRITE_ONLY) - private String billingCycle; + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; /** Creates an instance of Enrollment class. */ public Enrollment() { } /** - * Get the startDate property: The start date of the enrollment. + * Get the billingCycle property: The billing cycle for the enrollment. * - * @return the startDate value. + * @return the billingCycle value. */ - public OffsetDateTime startDate() { - return this.startDate; + public String billingCycle() { + return this.billingCycle; } /** - * Set the startDate property: The start date of the enrollment. + * Get the channel property: The channel type of the enrollment. * - * @param startDate the startDate value to set. - * @return the Enrollment object itself. + * @return the channel value. */ - public Enrollment withStartDate(OffsetDateTime startDate) { - this.startDate = startDate; - return this; + public String channel() { + return this.channel; + } + + /** + * Get the countryCode property: The country code of the enrollment. + * + * @return the countryCode value. + */ + public String countryCode() { + return this.countryCode; + } + + /** + * Get the currency property: The billing currency for the enrollment. + * + * @return the currency value. + */ + public String currency() { + return this.currency; } /** @@ -110,21 +126,12 @@ public Enrollment withEndDate(OffsetDateTime endDate) { } /** - * Get the currency property: The billing currency for the enrollment. - * - * @return the currency value. - */ - public String currency() { - return this.currency; - } - - /** - * Get the channel property: The channel type of the enrollment. + * Get the language property: The language for the enrollment. * - * @return the channel value. + * @return the language value. */ - public String channel() { - return this.channel; + public String language() { + return this.language; } /** @@ -137,21 +144,23 @@ public EnrollmentPolicies policies() { } /** - * Get the language property: The language for the enrollment. + * Get the startDate property: The start date of the enrollment. * - * @return the language value. + * @return the startDate value. */ - public String language() { - return this.language; + public OffsetDateTime startDate() { + return this.startDate; } /** - * Get the countryCode property: The country code of the enrollment. + * Set the startDate property: The start date of the enrollment. * - * @return the countryCode value. + * @param startDate the startDate value to set. + * @return the Enrollment object itself. */ - public String countryCode() { - return this.countryCode; + public Enrollment withStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; } /** @@ -163,15 +172,6 @@ public String status() { return this.status; } - /** - * Get the billingCycle property: The billing cycle for the enrollment. - * - * @return the billingCycle value. - */ - public String billingCycle() { - return this.billingCycle; - } - /** * Validates the instance. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccount.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccount.java index c1209ebcf0d7e..e3f7c4a0ae890 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccount.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccount.java @@ -5,14 +5,13 @@ package com.azure.resourcemanager.billing.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** An enrollment account. */ @Fluent -public final class EnrollmentAccount extends ProxyResource { +public final class EnrollmentAccount extends ArmResource { /* * The properties of an enrollment account. */ @@ -55,29 +54,6 @@ public EnrollmentAccount withAccountName(String accountName) { return this; } - /** - * Get the costCenter property: The cost center associated with the enrollment account. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.innerProperties() == null ? null : this.innerProperties().costCenter(); - } - - /** - * Set the costCenter property: The cost center associated with the enrollment account. - * - * @param costCenter the costCenter value to set. - * @return the EnrollmentAccount object itself. - */ - public EnrollmentAccount withCostCenter(String costCenter) { - if (this.innerProperties() == null) { - this.innerProperties = new EnrollmentAccountProperties(); - } - this.innerProperties().withCostCenter(costCenter); - return this; - } - /** * Get the accountOwner property: The owner of the enrollment account. * @@ -125,48 +101,50 @@ public EnrollmentAccount withAccountOwnerEmail(String accountOwnerEmail) { } /** - * Get the status property: The status of the enrollment account. + * Get the costCenter property: The cost center associated with the enrollment account. * - * @return the status value. + * @return the costCenter value. */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); + public String costCenter() { + return this.innerProperties() == null ? null : this.innerProperties().costCenter(); } /** - * Set the status property: The status of the enrollment account. + * Set the costCenter property: The cost center associated with the enrollment account. * - * @param status the status value to set. + * @param costCenter the costCenter value to set. * @return the EnrollmentAccount object itself. */ - public EnrollmentAccount withStatus(String status) { + public EnrollmentAccount withCostCenter(String costCenter) { if (this.innerProperties() == null) { this.innerProperties = new EnrollmentAccountProperties(); } - this.innerProperties().withStatus(status); + this.innerProperties().withCostCenter(costCenter); return this; } /** - * Get the startDate property: The start date of the enrollment account. + * Get the department property: Associated department. By default this is not populated, unless it's specified in + * $expand. * - * @return the startDate value. + * @return the department value. */ - public OffsetDateTime startDate() { - return this.innerProperties() == null ? null : this.innerProperties().startDate(); + public Department department() { + return this.innerProperties() == null ? null : this.innerProperties().department(); } /** - * Set the startDate property: The start date of the enrollment account. + * Set the department property: Associated department. By default this is not populated, unless it's specified in + * $expand. * - * @param startDate the startDate value to set. + * @param department the department value to set. * @return the EnrollmentAccount object itself. */ - public EnrollmentAccount withStartDate(OffsetDateTime startDate) { + public EnrollmentAccount withDepartment(Department department) { if (this.innerProperties() == null) { this.innerProperties = new EnrollmentAccountProperties(); } - this.innerProperties().withStartDate(startDate); + this.innerProperties().withDepartment(department); return this; } @@ -194,27 +172,48 @@ public EnrollmentAccount withEndDate(OffsetDateTime endDate) { } /** - * Get the department property: Associated department. By default this is not populated, unless it's specified in - * $expand. + * Get the startDate property: The start date of the enrollment account. * - * @return the department value. + * @return the startDate value. */ - public Department department() { - return this.innerProperties() == null ? null : this.innerProperties().department(); + public OffsetDateTime startDate() { + return this.innerProperties() == null ? null : this.innerProperties().startDate(); } /** - * Set the department property: Associated department. By default this is not populated, unless it's specified in - * $expand. + * Set the startDate property: The start date of the enrollment account. * - * @param department the department value to set. + * @param startDate the startDate value to set. * @return the EnrollmentAccount object itself. */ - public EnrollmentAccount withDepartment(Department department) { + public EnrollmentAccount withStartDate(OffsetDateTime startDate) { if (this.innerProperties() == null) { this.innerProperties = new EnrollmentAccountProperties(); } - this.innerProperties().withDepartment(department); + this.innerProperties().withStartDate(startDate); + return this; + } + + /** + * Get the status property: The status of the enrollment account. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the enrollment account. + * + * @param status the status value to set. + * @return the EnrollmentAccount object itself. + */ + public EnrollmentAccount withStatus(String status) { + if (this.innerProperties() == null) { + this.innerProperties = new EnrollmentAccountProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -223,7 +222,9 @@ public EnrollmentAccount withDepartment(Department department) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { + super.validate(); if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountSummary.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountSummary.java deleted file mode 100644 index d3b01bf1360ec..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountSummary.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; - -/** An immutable client-side representation of EnrollmentAccountSummary. */ -public interface EnrollmentAccountSummary { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the principalName property: The account owner's principal name. - * - * @return the principalName value. - */ - String principalName(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner object. - * - * @return the inner object. - */ - EnrollmentAccountSummaryInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccounts.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccounts.java deleted file mode 100644 index 556421ab3c39b..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccounts.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of EnrollmentAccounts. */ -public interface EnrollmentAccounts { - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name along with {@link Response}. - */ - Response getWithResponse(String name, Context context); - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - EnrollmentAccountSummary get(String name); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instruction.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instruction.java index 0ae66007b7b12..29cd607ad6af2 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instruction.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instruction.java @@ -4,13 +4,15 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.InstructionInner; import java.time.OffsetDateTime; /** An immutable client-side representation of Instruction. */ public interface Instruction { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -24,12 +26,19 @@ public interface Instruction { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the amount property: The amount budgeted for this billing instruction. * @@ -38,11 +47,11 @@ public interface Instruction { float amount(); /** - * Gets the startDate property: The date this billing instruction goes into effect. + * Gets the creationDate property: The date this billing instruction was created. * - * @return the startDate value. + * @return the creationDate value. */ - OffsetDateTime startDate(); + OffsetDateTime creationDate(); /** * Gets the endDate property: The date this billing instruction is no longer in effect. @@ -52,11 +61,11 @@ public interface Instruction { OffsetDateTime endDate(); /** - * Gets the creationDate property: The date this billing instruction was created. + * Gets the startDate property: The date this billing instruction goes into effect. * - * @return the creationDate value. + * @return the startDate value. */ - OffsetDateTime creationDate(); + OffsetDateTime startDate(); /** * Gets the inner com.azure.resourcemanager.billing.fluent.models.InstructionInner object. diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InstructionListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InstructionListResult.java index c5c21be504637..3d03c8040945f 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InstructionListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InstructionListResult.java @@ -12,38 +12,38 @@ /** The list of billing instructions used during invoice generation. */ @Immutable public final class InstructionListResult { - /* - * The list of billing instructions used during invoice generation. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - /* * The link (url) to the next page of results. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /* + * The list of billing instructions used during invoice generation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + /** Creates an instance of InstructionListResult class. */ public InstructionListResult() { } /** - * Get the value property: The list of billing instructions used during invoice generation. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of billing instructions used during invoice generation. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoice.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoice.java index 2a6232c366666..61058de7710b3 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoice.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoice.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; import java.time.OffsetDateTime; import java.util.List; @@ -12,7 +13,8 @@ /** An immutable client-side representation of Invoice. */ public interface Invoice { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -26,32 +28,18 @@ public interface Invoice { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the dueDate property: The due date for the invoice. - * - * @return the dueDate value. - */ - OffsetDateTime dueDate(); - - /** - * Gets the invoiceDate property: The date when the invoice was generated. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the invoiceDate value. + * @return the systemData value. */ - OffsetDateTime invoiceDate(); - - /** - * Gets the status property: The current status of the invoice. - * - * @return the status value. - */ - InvoiceStatus status(); + SystemData systemData(); /** * Gets the amountDue property: The amount due as of now. @@ -75,6 +63,28 @@ public interface Invoice { */ Amount billedAmount(); + /** + * Gets the billedDocumentId property: The Id of the active invoice which is originally billed after this invoice + * was voided. This field is applicable to the void invoices only. + * + * @return the billedDocumentId value. + */ + String billedDocumentId(); + + /** + * Gets the billingProfileDisplayName property: The name of the billing profile for which the invoice is generated. + * + * @return the billingProfileDisplayName value. + */ + String billingProfileDisplayName(); + + /** + * Gets the billingProfileId property: The ID of the billing profile for which the invoice is generated. + * + * @return the billingProfileId value. + */ + String billingProfileId(); + /** * Gets the creditAmount property: 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. @@ -84,44 +94,48 @@ public interface Invoice { Amount creditAmount(); /** - * Gets the freeAzureCreditApplied property: The amount of free Azure credits applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. + * Gets the creditForDocumentId property: 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. * - * @return the freeAzureCreditApplied value. + * @return the creditForDocumentId value. */ - Amount freeAzureCreditApplied(); + String creditForDocumentId(); /** - * Gets the subTotal property: The pre-tax amount due. This field is applicable to billing accounts with agreement - * type Microsoft Customer Agreement. + * Gets the documents property: List of documents available to download such as invoice and tax receipt. * - * @return the subTotal value. + * @return the documents value. */ - Amount subTotal(); + List documents(); /** - * Gets the taxAmount property: The amount of tax charged for the billing period. This field is applicable to - * billing accounts with agreement type Microsoft Customer Agreement. + * Gets the documentType property: The type of the document. * - * @return the taxAmount value. + * @return the documentType value. */ - Amount taxAmount(); + InvoiceDocumentType documentType(); /** - * Gets the totalAmount property: The amount due when the invoice was generated. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. + * Gets the dueDate property: The due date for the invoice. * - * @return the totalAmount value. + * @return the dueDate value. */ - Amount totalAmount(); + OffsetDateTime dueDate(); /** - * Gets the invoicePeriodStartDate property: The start date of the billing period for which the invoice is - * generated. + * Gets the freeAzureCreditApplied property: The amount of free Azure credits applied to the charges. This field is + * applicable to billing accounts with agreement type Microsoft Customer Agreement. * - * @return the invoicePeriodStartDate value. + * @return the freeAzureCreditApplied value. */ - OffsetDateTime invoicePeriodStartDate(); + Amount freeAzureCreditApplied(); + + /** + * Gets the invoiceDate property: The date when the invoice was generated. + * + * @return the invoiceDate value. + */ + OffsetDateTime invoiceDate(); /** * Gets the invoicePeriodEndDate property: The end date of the billing period for which the invoice is generated. @@ -130,6 +144,14 @@ public interface Invoice { */ OffsetDateTime invoicePeriodEndDate(); + /** + * Gets the invoicePeriodStartDate property: The start date of the billing period for which the invoice is + * generated. + * + * @return the invoicePeriodStartDate value. + */ + OffsetDateTime invoicePeriodStartDate(); + /** * Gets the invoiceType property: Invoice type. * @@ -146,18 +168,11 @@ public interface Invoice { Boolean isMonthlyInvoice(); /** - * Gets the billingProfileId property: The ID of the billing profile for which the invoice is generated. - * - * @return the billingProfileId value. - */ - String billingProfileId(); - - /** - * Gets the billingProfileDisplayName property: The name of the billing profile for which the invoice is generated. + * Gets the payments property: List of payments. * - * @return the billingProfileDisplayName value. + * @return the payments value. */ - String billingProfileDisplayName(); + List payments(); /** * Gets the purchaseOrderNumber property: An optional purchase order number for the invoice. @@ -167,55 +182,49 @@ public interface Invoice { String purchaseOrderNumber(); /** - * Gets the documents property: List of documents available to download such as invoice and tax receipt. - * - * @return the documents value. - */ - List documents(); - - /** - * Gets the payments property: List of payments. + * Gets the rebillDetails property: Rebill details for an invoice. * - * @return the payments value. + * @return the rebillDetails value. */ - List payments(); + Map rebillDetails(); /** - * Gets the rebillDetails property: Rebill details for an invoice. + * Gets the status property: The current status of the invoice. * - * @return the rebillDetails value. + * @return the status value. */ - Map rebillDetails(); + InvoiceStatus status(); /** - * Gets the documentType property: The type of the document. + * Gets the subscriptionId property: The ID of the subscription for which the invoice is generated. * - * @return the documentType value. + * @return the subscriptionId value. */ - InvoiceDocumentType documentType(); + String subscriptionId(); /** - * Gets the billedDocumentId property: The Id of the active invoice which is originally billed after this invoice - * was voided. This field is applicable to the void invoices only. + * Gets the subTotal property: The pre-tax amount due. This field is applicable to billing accounts with agreement + * type Microsoft Customer Agreement. * - * @return the billedDocumentId value. + * @return the subTotal value. */ - String billedDocumentId(); + Amount subTotal(); /** - * Gets the creditForDocumentId property: 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. + * Gets the taxAmount property: The amount of tax charged for the billing period. This field is applicable to + * billing accounts with agreement type Microsoft Customer Agreement. * - * @return the creditForDocumentId value. + * @return the taxAmount value. */ - String creditForDocumentId(); + Amount taxAmount(); /** - * Gets the subscriptionId property: The ID of the subscription for which the invoice is generated. + * Gets the totalAmount property: The amount due when the invoice was generated. This field is applicable to billing + * accounts with agreement type Microsoft Customer Agreement. * - * @return the subscriptionId value. + * @return the totalAmount value. */ - String subscriptionId(); + Amount totalAmount(); /** * Gets the inner com.azure.resourcemanager.billing.fluent.models.InvoiceInner object. diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java index ce13fcbc1a018..9c7682502f2e8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java @@ -12,12 +12,6 @@ /** The list of invoices. */ @Immutable public final class InvoiceListResult { - /* - * The list of invoices. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - /* * The link (url) to the next page of results. */ @@ -30,19 +24,16 @@ public final class InvoiceListResult { @JsonProperty(value = "totalCount", access = JsonProperty.Access.WRITE_ONLY) private Integer totalCount; + /* + * The list of invoices. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + /** Creates an instance of InvoiceListResult class. */ public InvoiceListResult() { } - /** - * Get the value property: The list of invoices. - * - * @return the value value. - */ - public List value() { - return this.value; - } - /** * Get the nextLink property: The link (url) to the next page of results. * @@ -61,6 +52,15 @@ public Integer totalCount() { return this.totalCount; } + /** + * Get the value property: The list of invoices. + * + * @return the value value. + */ + public List value() { + return this.value; + } + /** * Validates the instance. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSection.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSection.java index 9c438923d556d..b8aa68541f140 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSection.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSection.java @@ -4,13 +4,15 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; import java.util.Map; /** An immutable client-side representation of InvoiceSection. */ public interface InvoiceSection { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -24,12 +26,19 @@ public interface InvoiceSection { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the displayName property: The name of the invoice section. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListResult.java index 6f2e48d840c56..e38213bcd26e9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListResult.java @@ -13,10 +13,10 @@ @Immutable public final class InvoiceSectionListResult { /* - * The list of invoice sections. + * The link (url) to the next page of results. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; /* * Total number of records. @@ -25,22 +25,22 @@ public final class InvoiceSectionListResult { private Integer totalCount; /* - * The link (url) to the next page of results. + * The list of invoice sections. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; /** Creates an instance of InvoiceSectionListResult class. */ public InvoiceSectionListResult() { } /** - * Get the value property: The list of invoice sections. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** @@ -53,12 +53,12 @@ public Integer totalCount() { } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of invoice sections. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListWithCreateSubPermissionResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListWithCreateSubPermissionResult.java index aa8564c38ab52..0e471d91a1950 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListWithCreateSubPermissionResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListWithCreateSubPermissionResult.java @@ -12,22 +12,31 @@ /** The list of invoice section properties with create subscription permission. */ @Fluent public final class InvoiceSectionListWithCreateSubPermissionResult { - /* - * The list of invoice section properties with create subscription permission. - */ - @JsonProperty(value = "value") - private List value; - /* * The link (url) to the next page of results. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /* + * The list of invoice section properties with create subscription permission. + */ + @JsonProperty(value = "value") + private List value; + /** Creates an instance of InvoiceSectionListWithCreateSubPermissionResult class. */ public InvoiceSectionListWithCreateSubPermissionResult() { } + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Get the value property: The list of invoice section properties with create subscription permission. * @@ -49,15 +58,6 @@ public InvoiceSectionListWithCreateSubPermissionResult withValue( return this; } - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - /** * Validates the instance. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionWithCreateSubPermission.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionWithCreateSubPermission.java index 0ec3115c1bcc3..4ed0cf5cbc645 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionWithCreateSubPermission.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionWithCreateSubPermission.java @@ -10,25 +10,11 @@ /** An immutable client-side representation of InvoiceSectionWithCreateSubPermission. */ public interface InvoiceSectionWithCreateSubPermission { /** - * Gets the invoiceSectionId property: The ID of the invoice section. - * - * @return the invoiceSectionId value. - */ - String invoiceSectionId(); - - /** - * Gets the invoiceSectionDisplayName property: The name of the invoice section. - * - * @return the invoiceSectionDisplayName value. - */ - String invoiceSectionDisplayName(); - - /** - * Gets the invoiceSectionSystemId property: The system generated unique identifier for an invoice section. + * Gets the billingProfileDisplayName property: The name of the billing profile for the invoice section. * - * @return the invoiceSectionSystemId value. + * @return the billingProfileDisplayName value. */ - String invoiceSectionSystemId(); + String billingProfileDisplayName(); /** * Gets the billingProfileId property: The ID of the billing profile for the invoice section. @@ -38,11 +24,11 @@ public interface InvoiceSectionWithCreateSubPermission { String billingProfileId(); /** - * Gets the billingProfileDisplayName property: The name of the billing profile for the invoice section. + * Gets the billingProfileSpendingLimit property: The billing profile spending limit. * - * @return the billingProfileDisplayName value. + * @return the billingProfileSpendingLimit value. */ - String billingProfileDisplayName(); + SpendingLimitForBillingProfile billingProfileSpendingLimit(); /** * Gets the billingProfileStatus property: The status of the billing profile. @@ -58,13 +44,6 @@ public interface InvoiceSectionWithCreateSubPermission { */ StatusReasonCodeForBillingProfile billingProfileStatusReasonCode(); - /** - * Gets the billingProfileSpendingLimit property: The billing profile spending limit. - * - * @return the billingProfileSpendingLimit value. - */ - SpendingLimitForBillingProfile billingProfileSpendingLimit(); - /** * Gets the billingProfileSystemId property: The system generated unique identifier for a billing profile. * @@ -79,6 +58,27 @@ public interface InvoiceSectionWithCreateSubPermission { */ List enabledAzurePlans(); + /** + * Gets the invoiceSectionDisplayName property: The name of the invoice section. + * + * @return the invoiceSectionDisplayName value. + */ + String invoiceSectionDisplayName(); + + /** + * Gets the invoiceSectionId property: The ID of the invoice section. + * + * @return the invoiceSectionId value. + */ + String invoiceSectionId(); + + /** + * Gets the invoiceSectionSystemId property: The system generated unique identifier for an invoice section. + * + * @return the invoiceSectionSystemId value. + */ + String invoiceSectionSystemId(); + /** * Gets the inner com.azure.resourcemanager.billing.fluent.models.InvoiceSectionWithCreateSubPermissionInner object. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsOnExpandAutoGenerated.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsOnExpandAutoGenerated.java new file mode 100644 index 0000000000000..0951dba7c9189 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsOnExpandAutoGenerated.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in + * $expand. + */ +@Fluent +public final class InvoiceSectionsOnExpandAutoGenerated { + /* + * 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. + */ + @JsonProperty(value = "hasMoreResults", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasMoreResults; + + /* + * The invoice sections associated to the billing profile. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of InvoiceSectionsOnExpandAutoGenerated class. */ + public InvoiceSectionsOnExpandAutoGenerated() { + } + + /** + * Get the hasMoreResults property: 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. + * + * @return the hasMoreResults value. + */ + public Boolean hasMoreResults() { + return this.hasMoreResults; + } + + /** + * Get the value property: The invoice sections associated to the billing profile. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The invoice sections associated to the billing profile. + * + * @param value the value value to set. + * @return the InvoiceSectionsOnExpandAutoGenerated object itself. + */ + public InvoiceSectionsOnExpandAutoGenerated withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoices.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoices.java index a9b21a5dcb9e0..4c8ad8e706539 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoices.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoices.java @@ -12,10 +12,11 @@ /** Resource collection API of Invoices. */ public interface Invoices { /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -23,14 +24,15 @@ public interface Invoices { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of invoices as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate); /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for + * 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 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 context The context to associate with this operation. @@ -39,15 +41,48 @@ PagedIterable listByBillingAccount( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of invoices as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate, Context context); + PagedIterable listByBillingProfile( + String billingAccountName, + String billingProfileName, + String periodStartDate, + String periodEndDate, + Context context); /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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 downloadUrls An array of download urls for individual documents. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + */ + DownloadUrl downloadMultipleBillingProfileInvoices(String billingAccountName, List downloadUrls); + + /** + * 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 downloadUrls An array of download urls for individual documents. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + */ + DownloadUrl downloadMultipleBillingProfileInvoices( + String billingAccountName, List downloadUrls, Context context); + + /** + * 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. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -55,15 +90,14 @@ PagedIterable listByBillingAccount( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of invoices as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate); + PagedIterable listByBillingAccount( + String billingAccountName, String periodStartDate, String periodEndDate); /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for + * 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. * * @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 context The context to associate with this operation. @@ -72,12 +106,8 @@ PagedIterable listByBillingProfile( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of invoices as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context); + PagedIterable listByBillingAccount( + String billingAccountName, String periodStartDate, String periodEndDate, Context context); /** * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement @@ -106,31 +136,6 @@ PagedIterable listByBillingProfile( */ Invoice get(String billingAccountName, String invoiceName); - /** - * 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID along with {@link Response}. - */ - Response getByIdWithResponse(String invoiceName, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - Invoice getById(String invoiceName); - /** * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft * Partner Agreement or Microsoft Customer Agreement. @@ -161,25 +166,21 @@ PagedIterable listByBillingProfile( DownloadUrl downloadInvoice(String billingAccountName, String invoiceName, String downloadToken, Context context); /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. */ - DownloadUrl downloadMultipleBillingProfileInvoices(String billingAccountName, List downloadUrls); + DownloadUrl downloadMultipleBillingSubscriptionInvoices(String subscriptionId, List downloadUrls); /** - * 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 multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. * - * @param billingAccountName The ID that uniquely identifies a billing account. + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param downloadUrls An array of download urls for individual documents. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -187,12 +188,13 @@ PagedIterable listByBillingProfile( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. */ - DownloadUrl downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context); + DownloadUrl downloadMultipleBillingSubscriptionInvoices( + String subscriptionId, List downloadUrls, Context context); /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -200,11 +202,13 @@ DownloadUrl downloadMultipleBillingProfileInvoices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of invoices as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate); + PagedIterable listByBillingSubscription( + String subscriptionId, String periodStartDate, String periodEndDate); /** * Lists the invoices for a subscription. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param periodStartDate Invoice period start date. * @param periodEndDate Invoice period end date. * @param context The context to associate with this operation. @@ -213,11 +217,13 @@ DownloadUrl downloadMultipleBillingProfileInvoices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of invoices as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate, Context context); + PagedIterable listByBillingSubscription( + String subscriptionId, String periodStartDate, String periodEndDate, Context context); /** * Gets an invoice by subscription ID and invoice ID. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -225,22 +231,25 @@ DownloadUrl downloadMultipleBillingProfileInvoices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an invoice by subscription ID and invoice ID along with {@link Response}. */ - Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, Context context); + Response getBySubscriptionAndInvoiceIdWithResponse( + String subscriptionId, String invoiceName, Context context); /** * Gets an invoice by subscription ID and invoice ID. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an invoice by subscription ID and invoice ID. */ - Invoice getBySubscriptionAndInvoiceId(String invoiceName); + Invoice getBySubscriptionAndInvoiceId(String subscriptionId, String invoiceName); /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -248,11 +257,12 @@ DownloadUrl downloadMultipleBillingProfileInvoices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a URL to download an invoice. */ - DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken); + DownloadUrl downloadBillingSubscriptionInvoice(String subscriptionId, String invoiceName, String downloadToken); /** * Gets a URL to download an invoice. * + * @param subscriptionId The ID that uniquely identifies a billing subscription. * @param invoiceName The ID that uniquely identifies an invoice. * @param downloadToken Download token with document source and document ID. * @param context The context to associate with this operation. @@ -261,28 +271,31 @@ DownloadUrl downloadMultipleBillingProfileInvoices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a URL to download an invoice. */ - DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken, Context context); + DownloadUrl downloadBillingSubscriptionInvoice( + String subscriptionId, String invoiceName, String downloadToken, Context context); /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * - * @param downloadUrls An array of download urls for individual documents. + * @param invoiceName The ID that uniquely identifies an invoice. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * @return an invoice by ID along with {@link Response}. */ - DownloadUrl downloadMultipleBillingSubscriptionInvoices(List downloadUrls); + Response getByIdWithResponse(String invoiceName, Context context); /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner + * Agreement or Microsoft Customer Agreement. * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. + * @param invoiceName The ID that uniquely identifies an invoice. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. + * @return an invoice by ID. */ - DownloadUrl downloadMultipleBillingSubscriptionInvoices(List downloadUrls, Context context); + Invoice getById(String invoiceName); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operation.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operation.java index 71956e6bb4b87..8189c51a200ab 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operation.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operation.java @@ -9,11 +9,11 @@ /** An immutable client-side representation of Operation. */ public interface Operation { /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * Gets the display property: The object that represents the operation. * - * @return the name value. + * @return the display value. */ - String name(); + OperationDisplay display(); /** * Gets the isDataAction property: Identifies if the operation is a data operation. @@ -23,11 +23,11 @@ public interface Operation { Boolean isDataAction(); /** - * Gets the display property: The object that represents the operation. + * Gets the name property: Operation name: {provider}/{resource}/{operation}. * - * @return the display value. + * @return the name value. */ - OperationDisplay display(); + String name(); /** * Gets the inner com.azure.resourcemanager.billing.fluent.models.OperationInner object. diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationDisplay.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationDisplay.java index 9dbcadbfa3e1b..65294f463b3b0 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationDisplay.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationDisplay.java @@ -11,16 +11,10 @@ @Immutable public final class OperationDisplay { /* - * Service provider: Microsoft.Billing. - */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) - private String provider; - - /* - * Resource on which the operation is performed such as invoice and billing subscription. + * Description of operation. */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) - private String resource; + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; /* * Operation type such as read, write and delete. @@ -29,49 +23,55 @@ public final class OperationDisplay { private String operation; /* - * Description of operation. + * Service provider: Microsoft.Billing. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * Resource on which the operation is performed such as invoice and billing subscription. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; /** Creates an instance of OperationDisplay class. */ public OperationDisplay() { } /** - * Get the provider property: Service provider: Microsoft.Billing. + * Get the description property: Description of operation. * - * @return the provider value. + * @return the description value. */ - public String provider() { - return this.provider; + public String description() { + return this.description; } /** - * Get the resource property: Resource on which the operation is performed such as invoice and billing subscription. + * Get the operation property: Operation type such as read, write and delete. * - * @return the resource value. + * @return the operation value. */ - public String resource() { - return this.resource; + public String operation() { + return this.operation; } /** - * Get the operation property: Operation type such as read, write and delete. + * Get the provider property: Service provider: Microsoft.Billing. * - * @return the operation value. + * @return the provider value. */ - public String operation() { - return this.operation; + public String provider() { + return this.provider; } /** - * Get the description property: Description of operation. + * Get the resource property: Resource on which the operation is performed such as invoice and billing subscription. * - * @return the description value. + * @return the resource value. */ - public String description() { - return this.description; + public String resource() { + return this.resource; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationListResult.java index 9bac4604cb54e..24d910bbc0e5e 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationListResult.java @@ -12,38 +12,38 @@ /** The list of billing operations and a URL link to get the next set of results. */ @Immutable public final class OperationListResult { - /* - * The list of billing operations supported by the Microsoft.Billing resource provider. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - /* * URL to get the next set of operation list results if there are any. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /* + * The list of billing operations supported by the Microsoft.Billing resource provider. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + /** Creates an instance of OperationListResult class. */ public OperationListResult() { } /** - * Get the value property: The list of billing operations supported by the Microsoft.Billing resource provider. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. + * Get the value property: The list of billing operations supported by the Microsoft.Billing resource provider. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethod.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethod.java new file mode 100644 index 0000000000000..b9e82f85b2556 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethod.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodInner; +import java.util.List; + +/** An immutable client-side representation of PaymentMethod. */ +public interface PaymentMethod { + /** + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the accountHolderName property: The account holder name for the payment method. This is only supported for + * payment methods with family CreditCard. + * + * @return the accountHolderName value. + */ + String accountHolderName(); + + /** + * Gets the displayName property: The display name of the payment method. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the expiration property: The expiration month and year of the payment method. This is only supported for + * payment methods with family CreditCard. + * + * @return the expiration value. + */ + String expiration(); + + /** + * Gets the family property: The family of payment method. + * + * @return the family value. + */ + PaymentMethodFamily family(); + + /** + * Gets the lastFourDigits property: Last four digits of payment method. + * + * @return the lastFourDigits value. + */ + String lastFourDigits(); + + /** + * Gets the logos property: The list of logos for the payment method. + * + * @return the logos value. + */ + List logos(); + + /** + * Gets the status property: Status of the payment method. + * + * @return the status value. + */ + PaymentMethodStatus status(); + + /** + * Gets the typePropertiesType property: The type of payment method. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the inner com.azure.resourcemanager.billing.fluent.models.PaymentMethodInner object. + * + * @return the inner object. + */ + PaymentMethodInner innerModel(); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodFamily.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodFamily.java index 82fbccebdb8b5..3bc1448d511d9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodFamily.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodFamily.java @@ -22,6 +22,9 @@ public final class PaymentMethodFamily extends ExpandableStringEnum value; + + /** Creates an instance of PaymentMethodLinksListResult class. */ + public PaymentMethodLinksListResult() { + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: The list of payment method links. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodLogo.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodLogo.java new file mode 100644 index 0000000000000..061f6ca096890 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodLogo.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Logo of payment method. */ +@Immutable +public final class PaymentMethodLogo { + /* + * MIME type of the logo. + */ + @JsonProperty(value = "mimeType", access = JsonProperty.Access.WRITE_ONLY) + private String mimeType; + + /* + * Public URL of image of the logo. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /** Creates an instance of PaymentMethodLogo class. */ + public PaymentMethodLogo() { + } + + /** + * Get the mimeType property: MIME type of the logo. + * + * @return the mimeType value. + */ + public String mimeType() { + return this.mimeType; + } + + /** + * Get the url property: Public URL of image of the logo. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodProjectionProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodProjectionProperties.java new file mode 100644 index 0000000000000..49c3870014fac --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodProjectionProperties.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a payment method projection. */ +@Fluent +public final class PaymentMethodProjectionProperties { + /* + * The account holder name for the payment method. This is only supported for payment methods with family + * CreditCard. + */ + @JsonProperty(value = "accountHolderName", access = JsonProperty.Access.WRITE_ONLY) + private String accountHolderName; + + /* + * The display name of the payment method. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The expiration month and year of the payment method. This is only supported for payment methods with family + * CreditCard. + */ + @JsonProperty(value = "expiration", access = JsonProperty.Access.WRITE_ONLY) + private String expiration; + + /* + * The family of payment method. + */ + @JsonProperty(value = "family") + private PaymentMethodFamily family; + + /* + * Id of payment method. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Last four digits of payment method. + */ + @JsonProperty(value = "lastFourDigits", access = JsonProperty.Access.WRITE_ONLY) + private String lastFourDigits; + + /* + * The list of logos for the payment method. + */ + @JsonProperty(value = "logos") + private List logos; + + /* + * Status of the payment method. + */ + @JsonProperty(value = "status") + private PaymentMethodStatus status; + + /* + * The type of payment method. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** Creates an instance of PaymentMethodProjectionProperties class. */ + public PaymentMethodProjectionProperties() { + } + + /** + * Get the accountHolderName property: The account holder name for the payment method. This is only supported for + * payment methods with family CreditCard. + * + * @return the accountHolderName value. + */ + public String accountHolderName() { + return this.accountHolderName; + } + + /** + * Get the displayName property: The display name of the payment method. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the expiration property: The expiration month and year of the payment method. This is only supported for + * payment methods with family CreditCard. + * + * @return the expiration value. + */ + public String expiration() { + return this.expiration; + } + + /** + * Get the family property: The family of payment method. + * + * @return the family value. + */ + public PaymentMethodFamily family() { + return this.family; + } + + /** + * Set the family property: The family of payment method. + * + * @param family the family value to set. + * @return the PaymentMethodProjectionProperties object itself. + */ + public PaymentMethodProjectionProperties withFamily(PaymentMethodFamily family) { + this.family = family; + return this; + } + + /** + * Get the id property: Id of payment method. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the lastFourDigits property: Last four digits of payment method. + * + * @return the lastFourDigits value. + */ + public String lastFourDigits() { + return this.lastFourDigits; + } + + /** + * Get the logos property: The list of logos for the payment method. + * + * @return the logos value. + */ + public List logos() { + return this.logos; + } + + /** + * Set the logos property: The list of logos for the payment method. + * + * @param logos the logos value to set. + * @return the PaymentMethodProjectionProperties object itself. + */ + public PaymentMethodProjectionProperties withLogos(List logos) { + this.logos = logos; + return this; + } + + /** + * Get the status property: Status of the payment method. + * + * @return the status value. + */ + public PaymentMethodStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the payment method. + * + * @param status the status value to set. + * @return the PaymentMethodProjectionProperties object itself. + */ + public PaymentMethodProjectionProperties withStatus(PaymentMethodStatus status) { + this.status = status; + return this; + } + + /** + * Get the type property: The type of payment method. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logos() != null) { + logos().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodStatus.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodStatus.java new file mode 100644 index 0000000000000..8463a4ab5a674 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Status of the payment method. */ +public final class PaymentMethodStatus extends ExpandableStringEnum { + /** Static value Active for PaymentMethodStatus. */ + public static final PaymentMethodStatus ACTIVE = fromString("Active"); + + /** Static value Inactive for PaymentMethodStatus. */ + public static final PaymentMethodStatus INACTIVE = fromString("Inactive"); + + /** Static value Unknown for PaymentMethodStatus. */ + public static final PaymentMethodStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of PaymentMethodStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PaymentMethodStatus() { + } + + /** + * Creates or finds a PaymentMethodStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PaymentMethodStatus. + */ + @JsonCreator + public static PaymentMethodStatus fromString(String name) { + return fromString(name, PaymentMethodStatus.class); + } + + /** + * Gets known PaymentMethodStatus values. + * + * @return known PaymentMethodStatus values. + */ + public static Collection values() { + return values(PaymentMethodStatus.class); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethods.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethods.java new file mode 100644 index 0000000000000..d88b05e6e5d86 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethods.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PaymentMethods. */ +public 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment method links as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, Context context); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method linked with a billing profile along with {@link Response}. + */ + Response getByBillingProfileWithResponse( + String billingAccountName, String billingProfileName, String paymentMethodName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method linked with a billing profile. + */ + PaymentMethodLink getByBillingProfile( + String billingAccountName, String billingProfileName, String paymentMethodName); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingAccount(String billingAccountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + PagedIterable listByBillingAccount(String billingAccountName, Context context); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method available for a billing account along with {@link Response}. + */ + Response getByBillingAccountWithResponse( + String billingAccountName, String paymentMethodName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method available for a billing account. + */ + PaymentMethod getByBillingAccount(String billingAccountName, String paymentMethodName); + + /** + * Lists the payment methods owned by the caller. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + PagedIterable listByUser(); + + /** + * Lists the payment methods owned by the caller. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of payment methods as paginated response with {@link PagedIterable}. + */ + PagedIterable listByUser(Context context); + + /** + * Deletes a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByUserWithResponse(String paymentMethodName, Context context); + + /** + * Deletes a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByUser(String paymentMethodName); + + /** + * Gets a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method owned by the caller along with {@link Response}. + */ + Response getByUserWithResponse(String paymentMethodName, Context context); + + /** + * Gets a payment method owned by the caller. + * + * @param paymentMethodName The ID that uniquely identifies a payment method. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a payment method owned by the caller. + */ + PaymentMethod getByUser(String paymentMethodName); +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodsListResult.java new file mode 100644 index 0000000000000..852dfeec3ccad --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodsListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.billing.fluent.models.PaymentMethodInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of payment methods. */ +@Immutable +public final class PaymentMethodsListResult { + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * The list of payment methods. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of PaymentMethodsListResult class. */ + public PaymentMethodsListResult() { + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: The list of payment methods. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentProperties.java index 671c093c5b671..6a5d23623b2c1 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentProperties.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentProperties.java @@ -11,12 +11,6 @@ /** The properties of a payment. */ @Fluent public final class PaymentProperties { - /* - * The type of payment. - */ - @JsonProperty(value = "paymentType", access = JsonProperty.Access.WRITE_ONLY) - private String paymentType; - /* * The paid amount. */ @@ -41,19 +35,16 @@ public final class PaymentProperties { @JsonProperty(value = "paymentMethodType", access = JsonProperty.Access.WRITE_ONLY) private String paymentMethodType; + /* + * The type of payment. + */ + @JsonProperty(value = "paymentType", access = JsonProperty.Access.WRITE_ONLY) + private String paymentType; + /** Creates an instance of PaymentProperties class. */ public PaymentProperties() { } - /** - * Get the paymentType property: The type of payment. - * - * @return the paymentType value. - */ - public String paymentType() { - return this.paymentType; - } - /** * Get the amount property: The paid amount. * @@ -101,6 +92,15 @@ public String paymentMethodType() { return this.paymentMethodType; } + /** + * Get the paymentType property: The type of payment. + * + * @return the paymentType value. + */ + public String paymentType() { + return this.paymentType; + } + /** * Validates the instance. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policy.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policy.java index d8060551acf79..41de35f5bfed8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policy.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policy.java @@ -4,12 +4,14 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.PolicyInner; /** An immutable client-side representation of Policy. */ public interface Policy { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -23,12 +25,19 @@ public interface Policy { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the marketplacePurchases property: The policy that controls whether Azure marketplace purchases are allowed * for a billing profile. diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Product.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Product.java index ee20cf0f24130..91b826cfb67dd 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Product.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Product.java @@ -4,13 +4,15 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.ProductInner; import java.time.OffsetDateTime; /** An immutable client-side representation of Product. */ public interface Product { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -24,12 +26,19 @@ public interface Product { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the autoRenew property: Indicates whether auto renewal is turned on or off for a product. * @@ -38,153 +47,153 @@ public interface Product { AutoRenew autoRenew(); /** - * Gets the displayName property: The display name of the product. + * Gets the availabilityId property: The availability of the product. * - * @return the displayName value. + * @return the availabilityId value. */ - String displayName(); + String availabilityId(); /** - * Gets the purchaseDate property: The date when the product was purchased. + * Gets the billingFrequency property: The frequency at which the product will be billed. * - * @return the purchaseDate value. + * @return the billingFrequency value. */ - OffsetDateTime purchaseDate(); + BillingFrequency billingFrequency(); /** - * Gets the productTypeId property: The ID of the type of product. + * Gets the billingProfileDisplayName property: The name of the billing profile to which the product is billed. * - * @return the productTypeId value. + * @return the billingProfileDisplayName value. */ - String productTypeId(); + String billingProfileDisplayName(); /** - * Gets the productType property: The description of the type of product. + * Gets the billingProfileId property: The ID of the billing profile to which the product is billed. * - * @return the productType value. + * @return the billingProfileId value. */ - String productType(); + String billingProfileId(); /** - * Gets the status property: The current status of the product. + * Gets the customerDisplayName property: The name of the customer for whom the product was purchased. The field is + * applicable only for Microsoft Partner Agreement billing account. * - * @return the status value. + * @return the customerDisplayName value. */ - ProductStatusType status(); + String customerDisplayName(); /** - * Gets the endDate property: The date when the product will be renewed or canceled. + * Gets the customerId property: The ID of the customer for whom the product was purchased. The field is applicable + * only for Microsoft Partner Agreement billing account. * - * @return the endDate value. + * @return the customerId value. */ - OffsetDateTime endDate(); + String customerId(); /** - * Gets the billingFrequency property: The frequency at which the product will be billed. + * Gets the displayName property: The display name of the product. * - * @return the billingFrequency value. + * @return the displayName value. */ - BillingFrequency billingFrequency(); + String displayName(); /** - * Gets the lastCharge property: The last month charges. + * Gets the endDate property: The date when the product will be renewed or canceled. * - * @return the lastCharge value. + * @return the endDate value. */ - Amount lastCharge(); + OffsetDateTime endDate(); /** - * Gets the lastChargeDate property: The date of the last charge. + * Gets the invoiceSectionDisplayName property: The name of the invoice section to which the product is billed. * - * @return the lastChargeDate value. + * @return the invoiceSectionDisplayName value. */ - OffsetDateTime lastChargeDate(); + String invoiceSectionDisplayName(); /** - * Gets the quantity property: The quantity purchased for the product. + * Gets the invoiceSectionId property: The ID of the invoice section to which the product is billed. * - * @return the quantity value. + * @return the invoiceSectionId value. */ - Float quantity(); + String invoiceSectionId(); /** - * Gets the skuId property: The sku ID of the product. + * Gets the lastCharge property: The last month charges. * - * @return the skuId value. + * @return the lastCharge value. */ - String skuId(); + Amount lastCharge(); /** - * Gets the skuDescription property: The sku description of the product. + * Gets the lastChargeDate property: The date of the last charge. * - * @return the skuDescription value. + * @return the lastChargeDate value. */ - String skuDescription(); + OffsetDateTime lastChargeDate(); /** - * Gets the tenantId property: The id of the tenant in which the product is used. + * Gets the productType property: The description of the type of product. * - * @return the tenantId value. + * @return the productType value. */ - String tenantId(); + String productType(); /** - * Gets the availabilityId property: The availability of the product. + * Gets the productTypeId property: The ID of the type of product. * - * @return the availabilityId value. + * @return the productTypeId value. */ - String availabilityId(); + String productTypeId(); /** - * Gets the invoiceSectionId property: The ID of the invoice section to which the product is billed. + * Gets the purchaseDate property: The date when the product was purchased. * - * @return the invoiceSectionId value. + * @return the purchaseDate value. */ - String invoiceSectionId(); + OffsetDateTime purchaseDate(); /** - * Gets the invoiceSectionDisplayName property: The name of the invoice section to which the product is billed. + * Gets the quantity property: The quantity purchased for the product. * - * @return the invoiceSectionDisplayName value. + * @return the quantity value. */ - String invoiceSectionDisplayName(); + Float quantity(); /** - * Gets the billingProfileId property: The ID of the billing profile to which the product is billed. + * Gets the reseller property: Reseller for this product. * - * @return the billingProfileId value. + * @return the reseller value. */ - String billingProfileId(); + Reseller reseller(); /** - * Gets the billingProfileDisplayName property: The name of the billing profile to which the product is billed. + * Gets the skuDescription property: The sku description of the product. * - * @return the billingProfileDisplayName value. + * @return the skuDescription value. */ - String billingProfileDisplayName(); + String skuDescription(); /** - * Gets the customerId property: The ID of the customer for whom the product was purchased. The field is applicable - * only for Microsoft Partner Agreement billing account. + * Gets the skuId property: The sku ID of the product. * - * @return the customerId value. + * @return the skuId value. */ - String customerId(); + String skuId(); /** - * Gets the customerDisplayName property: The name of the customer for whom the product was purchased. The field is - * applicable only for Microsoft Partner Agreement billing account. + * Gets the status property: The current status of the product. * - * @return the customerDisplayName value. + * @return the status value. */ - String customerDisplayName(); + ProductStatusType status(); /** - * Gets the reseller property: Reseller for this product. + * Gets the tenantId property: The id of the tenant in which the product is used. * - * @return the reseller value. + * @return the tenantId value. */ - Reseller reseller(); + String tenantId(); /** * Gets the inner com.azure.resourcemanager.billing.fluent.models.ProductInner object. diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Products.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Products.java index 9d0ce896b9e90..c1393a17eb5d9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Products.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Products.java @@ -12,49 +12,62 @@ /** Resource collection API of Products. */ public 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. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ - PagedIterable listByCustomer(String billingAccountName, String customerName); + PagedIterable listByInvoiceSection( + String billingAccountName, String billingProfileName, String invoiceSectionName); /** - * 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 filter 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 (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ - PagedIterable listByCustomer(String billingAccountName, String customerName, Context context); + PagedIterable listByInvoiceSection( + String billingAccountName, + String billingProfileName, + String invoiceSectionName, + String filter, + Context context); /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingAccount(String billingAccountName); + PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is + * 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 filter 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 (:). @@ -64,61 +77,53 @@ public interface Products { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context); + PagedIterable listByBillingProfile( + String billingAccountName, String billingProfileName, String filter, Context context); /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); + PagedIterable listByCustomer(String billingAccountName, String customerName); /** - * 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 filter 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 (:). + * @param customerName The ID that uniquely identifies a customer. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String filter, Context context); + PagedIterable listByCustomer(String billingAccountName, String customerName, Context context); /** - * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); + PagedIterable listByBillingAccount(String billingAccountName); /** - * 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 filter 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 (:). @@ -128,12 +133,7 @@ PagedIterable listByInvoiceSection( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of products as paginated response with {@link PagedIterable}. */ - PagedIterable listByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context); + PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context); /** * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsListResult.java index 8b2aa24b27510..ce5777272fbb3 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsListResult.java @@ -16,10 +16,10 @@ @Immutable public final class ProductsListResult { /* - * The list of products. + * The link (url) to the next page of results. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; /* * Total number of records. @@ -28,22 +28,22 @@ public final class ProductsListResult { private Integer totalCount; /* - * The link (url) to the next page of results. + * The list of products. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; /** Creates an instance of ProductsListResult class. */ public ProductsListResult() { } /** - * Get the value property: The list of products. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** @@ -56,12 +56,12 @@ public Integer totalCount() { } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of products. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProvisioningTenantState.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProvisioningTenantState.java new file mode 100644 index 0000000000000..ac3f70586dec2 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProvisioningTenantState.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The state determines whether subscriptions and licenses can be provisioned in the associated tenant. It can be set as + * 'Pending' from null, null from 'Pending', or null from 'Active'. + */ +public final class ProvisioningTenantState extends ExpandableStringEnum { + /** Static value Unknown for ProvisioningTenantState. */ + public static final ProvisioningTenantState UNKNOWN = fromString("Unknown"); + + /** Static value NotRequested for ProvisioningTenantState. */ + public static final ProvisioningTenantState NOT_REQUESTED = fromString("NotRequested"); + + /** Static value Active for ProvisioningTenantState. */ + public static final ProvisioningTenantState ACTIVE = fromString("Active"); + + /** Static value Pending for ProvisioningTenantState. */ + public static final ProvisioningTenantState PENDING = fromString("Pending"); + + /** Static value PermissionRequestExpired for ProvisioningTenantState. */ + public static final ProvisioningTenantState PERMISSION_REQUEST_EXPIRED = fromString("PermissionRequestExpired"); + + /** Static value BillingRequestDeclined for ProvisioningTenantState. */ + public static final ProvisioningTenantState BILLING_REQUEST_DECLINED = fromString("BillingRequestDeclined"); + + /** Static value Revoked for ProvisioningTenantState. */ + public static final ProvisioningTenantState REVOKED = fromString("Revoked"); + + /** + * Creates a new instance of ProvisioningTenantState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningTenantState() { + } + + /** + * Creates or finds a ProvisioningTenantState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningTenantState. + */ + @JsonCreator + public static ProvisioningTenantState fromString(String name) { + return fromString(name, ProvisioningTenantState.class); + } + + /** + * Gets known ProvisioningTenantState values. + * + * @return known ProvisioningTenantState values. + */ + public static Collection values() { + return values(ProvisioningTenantState.class); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reseller.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reseller.java index ac30a2d0394d5..a14053be42231 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reseller.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reseller.java @@ -10,38 +10,38 @@ /** Details of the reseller. */ @Immutable public final class Reseller { - /* - * The MPN ID of the reseller. - */ - @JsonProperty(value = "resellerId", access = JsonProperty.Access.WRITE_ONLY) - private String resellerId; - /* * The name of the reseller. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /* + * The MPN ID of the reseller. + */ + @JsonProperty(value = "resellerId", access = JsonProperty.Access.WRITE_ONLY) + private String resellerId; + /** Creates an instance of Reseller class. */ public Reseller() { } /** - * Get the resellerId property: The MPN ID of the reseller. + * Get the description property: The name of the reseller. * - * @return the resellerId value. + * @return the description value. */ - public String resellerId() { - return this.resellerId; + public String description() { + return this.description; } /** - * Get the description property: The name of the reseller. + * Get the resellerId property: The MPN ID of the reseller. * - * @return the description value. + * @return the resellerId value. */ - public String description() { - return this.description; + public String resellerId() { + return this.resellerId; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservation.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservation.java index fd38fb9c0dbac..50807f269477a 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservation.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservation.java @@ -17,32 +17,32 @@ public interface Reservation { String id(); /** - * Gets the name property: The name of the reservation. + * Gets the location property: The location of the reservation. * - * @return the name value. + * @return the location value. */ - String name(); + String location(); /** - * Gets the type property: The type of the reservation. + * Gets the name property: The name of the reservation. * - * @return the type value. + * @return the name value. */ - String type(); + String name(); /** - * Gets the location property: The location of the reservation. + * Gets the sku property: The sku information associated to this reservation. * - * @return the location value. + * @return the sku value. */ - String location(); + ReservationSkuProperty sku(); /** - * Gets the sku property: The sku information associated to this reservation. + * Gets the type property: The type of the reservation. * - * @return the sku value. + * @return the type value. */ - ReservationSkuProperty sku(); + String type(); /** * Gets the appliedScopes property: The array of applied scopes of a reservation. Will be null if the reservation is @@ -60,25 +60,26 @@ public interface Reservation { String appliedScopeType(); /** - * Gets the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine. + * Gets the displayName property: The display name of the reservation. * - * @return the reservedResourceType value. + * @return the displayName value. */ - String reservedResourceType(); + String displayName(); /** - * Gets the quantity property: The number of the reservation. + * Gets the displayProvisioningState property: The provisioning state of the reservation for display, e.g. + * Succeeded. * - * @return the quantity value. + * @return the displayProvisioningState value. */ - Float quantity(); + String displayProvisioningState(); /** - * Gets the provisioningState property: The provisioning state of the reservation, e.g. Succeeded. + * Gets the effectiveDateTime property: The effective date time of the reservation. * - * @return the provisioningState value. + * @return the effectiveDateTime value. */ - String provisioningState(); + String effectiveDateTime(); /** * Gets the expiryDate property: The expiry date of the reservation. @@ -88,48 +89,46 @@ public interface Reservation { String expiryDate(); /** - * Gets the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded. + * Gets the provisioningState property: The provisioning state of the reservation, e.g. Succeeded. * - * @return the provisioningSubState value. + * @return the provisioningState value. */ - String provisioningSubState(); + String provisioningState(); /** - * Gets the displayName property: The display name of the reservation. + * Gets the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded. * - * @return the displayName value. + * @return the provisioningSubState value. */ - String displayName(); + String provisioningSubState(); /** - * Gets the displayProvisioningState property: The provisioning state of the reservation for display, e.g. - * Succeeded. + * Gets the quantity property: The number of the reservation. * - * @return the displayProvisioningState value. + * @return the quantity value. */ - String displayProvisioningState(); + Float quantity(); /** - * Gets the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On. + * Gets the renew property: The renew state of the reservation. * - * @return the userFriendlyRenewState value. + * @return the renew value. */ - String userFriendlyRenewState(); + Boolean renew(); /** - * Gets the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. - * Shared. + * Gets the renewSource property: The renew source of the reservation. * - * @return the userFriendlyAppliedScopeType value. + * @return the renewSource value. */ - String userFriendlyAppliedScopeType(); + String renewSource(); /** - * Gets the effectiveDateTime property: The effective date time of the reservation. + * Gets the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine. * - * @return the effectiveDateTime value. + * @return the reservedResourceType value. */ - String effectiveDateTime(); + String reservedResourceType(); /** * Gets the skuDescription property: The sku description of the reservation. @@ -146,18 +145,19 @@ public interface Reservation { String term(); /** - * Gets the renew property: The renew state of the reservation. + * Gets the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. + * Shared. * - * @return the renew value. + * @return the userFriendlyAppliedScopeType value. */ - Boolean renew(); + String userFriendlyAppliedScopeType(); /** - * Gets the renewSource property: The renew source of the reservation. + * Gets the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On. * - * @return the renewSource value. + * @return the userFriendlyRenewState value. */ - String renewSource(); + String userFriendlyRenewState(); /** * Gets the utilization property: Reservation utilization. diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPropertyUtilization.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPropertyUtilization.java index 2498b8c592e16..5a192a15359fb 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPropertyUtilization.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPropertyUtilization.java @@ -11,31 +11,22 @@ /** Reservation utilization. */ @Fluent public final class ReservationPropertyUtilization { - /* - * The number of days trend for a reservation - */ - @JsonProperty(value = "trend", access = JsonProperty.Access.WRITE_ONLY) - private String trend; - /* * The array of aggregates of a reservation's utilization */ @JsonProperty(value = "aggregates") private List aggregates; + /* + * The number of days trend for a reservation + */ + @JsonProperty(value = "trend", access = JsonProperty.Access.WRITE_ONLY) + private String trend; + /** Creates an instance of ReservationPropertyUtilization class. */ public ReservationPropertyUtilization() { } - /** - * Get the trend property: The number of days trend for a reservation. - * - * @return the trend value. - */ - public String trend() { - return this.trend; - } - /** * Get the aggregates property: The array of aggregates of a reservation's utilization. * @@ -56,6 +47,15 @@ public ReservationPropertyUtilization withAggregates(List listByBillingAccount(String billingAccountName); + PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. + * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. * * @param billingAccountName The ID that uniquely identifies a billing account. + * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. + * state. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -38,8 +40,9 @@ public interface Reservations { * @return the list of reservations and summary of roll out count of reservations in each state as paginated * response with {@link PagedIterable}. */ - PagedIterable listByBillingAccount( + PagedIterable listByBillingProfile( String billingAccountName, + String billingProfileName, String filter, String orderby, String refreshSummary, @@ -47,28 +50,26 @@ PagedIterable listByBillingAccount( Context context); /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of reservations and summary of roll out count of reservations in each state as paginated * response with {@link PagedIterable}. */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); + PagedIterable listByBillingAccount(String billingAccountName); /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. + * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. * * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. * @param filter 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'. * @param orderby May be used to sort order by reservation properties. * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. + * states. * @param selectedState The selected provisioning state. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -77,9 +78,8 @@ PagedIterable listByBillingAccount( * @return the list of reservations and summary of roll out count of reservations in each state as paginated * response with {@link PagedIterable}. */ - PagedIterable listByBillingProfile( + PagedIterable listByBillingAccount( String billingAccountName, - String billingProfileName, String filter, String orderby, String refreshSummary, diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationsListResult.java index 8127320772a48..d9aff3b90b0bb 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationsListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationsListResult.java @@ -12,12 +12,6 @@ /** The list of reservations and summary of roll out count of reservations in each state. */ @Fluent public final class ReservationsListResult { - /* - * The list of reservations. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - /* * The link (url) to the next page of results. */ @@ -30,19 +24,16 @@ public final class ReservationsListResult { @JsonProperty(value = "summary") private ReservationSummary summary; + /* + * The list of reservations. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + /** Creates an instance of ReservationsListResult class. */ public ReservationsListResult() { } - /** - * Get the value property: The list of reservations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - /** * Get the nextLink property: The link (url) to the next page of results. * @@ -72,17 +63,26 @@ public ReservationsListResult withSummary(ReservationSummary summary) { return this; } + /** + * Get the value property: The list of reservations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } if (summary() != null) { summary().validate(); } + if (value() != null) { + value().forEach(e -> e.validate()); + } } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transaction.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transaction.java index 0da0e3d3afe9e..6fd8501e8701b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transaction.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transaction.java @@ -4,13 +4,15 @@ package com.azure.resourcemanager.billing.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.billing.fluent.models.TransactionInner; import java.time.OffsetDateTime; /** An immutable client-side representation of Transaction. */ public interface Transaction { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. * * @return the id value. */ @@ -24,113 +26,115 @@ public interface Transaction { String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: Resource type. * * @return the type value. */ String type(); /** - * Gets the kind property: The kind of transaction. Options are all or reservation. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * - * @return the kind value. + * @return the systemData value. */ - TransactionTypeKind kind(); + SystemData systemData(); /** - * Gets the date property: The date of transaction. + * Gets the azureCreditApplied property: The amount of any Azure credits automatically applied to this transaction. * - * @return the date value. + * @return the azureCreditApplied value. */ - OffsetDateTime date(); + Amount azureCreditApplied(); /** - * Gets the invoice property: Invoice on which the transaction was billed or 'pending' if the transaction is not - * billed. + * Gets the azurePlan property: The type of azure plan of the subscription that was used for the transaction. * - * @return the invoice value. + * @return the azurePlan value. */ - String invoice(); + String azurePlan(); /** - * Gets the invoiceId property: The ID of the invoice on which the transaction was billed. This field is only - * applicable for transactions which are billed. + * Gets the billingCurrency property: The ISO 4217 code for the currency in which this transaction is billed. * - * @return the invoiceId value. + * @return the billingCurrency value. */ - String invoiceId(); + String billingCurrency(); /** - * Gets the orderId property: The order ID of the reservation. The field is only applicable for transaction of kind - * reservation. + * Gets the billingProfileDisplayName property: The name of the billing profile which will be billed for the + * transaction. * - * @return the orderId value. + * @return the billingProfileDisplayName value. */ - String orderId(); + String billingProfileDisplayName(); /** - * Gets the orderName property: The name of the reservation order. The field is only applicable for transactions of - * kind reservation. + * Gets the billingProfileId property: The ID of the billing profile which will be billed for the transaction. * - * @return the orderName value. + * @return the billingProfileId value. */ - String orderName(); + String billingProfileId(); /** - * Gets the productFamily property: The family of the product for which the transaction took place. + * Gets the customerDisplayName property: The name of the customer for which the transaction took place. The field + * is applicable only for Microsoft Partner Agreement billing account. * - * @return the productFamily value. + * @return the customerDisplayName value. */ - String productFamily(); + String customerDisplayName(); /** - * Gets the productTypeId property: The ID of the product type for which the transaction took place. + * Gets the customerId property: The ID of the customer for which the transaction took place. The field is + * applicable only for Microsoft Partner Agreement billing account. * - * @return the productTypeId value. + * @return the customerId value. */ - String productTypeId(); + String customerId(); /** - * Gets the productType property: The type of the product for which the transaction took place. + * Gets the date property: The date of transaction. * - * @return the productType value. + * @return the date value. */ - String productType(); + OffsetDateTime date(); /** - * Gets the productDescription property: The description of the product for which the transaction took place. + * Gets the discount property: The percentage discount, if any, applied to this transaction. * - * @return the productDescription value. + * @return the discount value. */ - String productDescription(); + Float discount(); /** - * Gets the transactionType property: The type of transaction. + * Gets the effectivePrice property: The price of the product after applying any discounts. * - * @return the transactionType value. + * @return the effectivePrice value. */ - ReservationType transactionType(); + Amount effectivePrice(); /** - * Gets the transactionAmount property: The charge associated with the transaction. + * Gets the exchangeRate property: The exchange rate used to convert charged amount to billing currency, if + * applicable. * - * @return the transactionAmount value. + * @return the exchangeRate value. */ - Amount transactionAmount(); + Float exchangeRate(); /** - * Gets the quantity property: The quantity purchased in the transaction. + * Gets the invoice property: Invoice on which the transaction was billed or 'pending' if the transaction is not + * billed. * - * @return the quantity value. + * @return the invoice value. */ - Integer quantity(); + String invoice(); /** - * Gets the invoiceSectionId property: The ID of the invoice section which will be billed for the transaction. + * Gets the invoiceId property: The ID of the invoice on which the transaction was billed. This field is only + * applicable for transactions which are billed. * - * @return the invoiceSectionId value. + * @return the invoiceId value. */ - String invoiceSectionId(); + String invoiceId(); /** * Gets the invoiceSectionDisplayName property: The name of the invoice section which will be billed for the @@ -141,108 +145,91 @@ public interface Transaction { String invoiceSectionDisplayName(); /** - * Gets the billingProfileId property: The ID of the billing profile which will be billed for the transaction. - * - * @return the billingProfileId value. - */ - String billingProfileId(); - - /** - * Gets the billingProfileDisplayName property: The name of the billing profile which will be billed for the - * transaction. - * - * @return the billingProfileDisplayName value. - */ - String billingProfileDisplayName(); - - /** - * Gets the customerId property: The ID of the customer for which the transaction took place. The field is - * applicable only for Microsoft Partner Agreement billing account. + * Gets the invoiceSectionId property: The ID of the invoice section which will be billed for the transaction. * - * @return the customerId value. + * @return the invoiceSectionId value. */ - String customerId(); + String invoiceSectionId(); /** - * Gets the customerDisplayName property: The name of the customer for which the transaction took place. The field - * is applicable only for Microsoft Partner Agreement billing account. + * Gets the kind property: The kind of transaction. Options are all or reservation. * - * @return the customerDisplayName value. + * @return the kind value. */ - String customerDisplayName(); + TransactionTypeKind kind(); /** - * Gets the subscriptionId property: The ID of the subscription that was used for the transaction. The field is only - * applicable for transaction of kind reservation. + * Gets the marketPrice property: The retail price of the product. * - * @return the subscriptionId value. + * @return the marketPrice value. */ - String subscriptionId(); + Amount marketPrice(); /** - * Gets the subscriptionName property: The name of the subscription that was used for the transaction. The field is - * only applicable for transaction of kind reservation. + * Gets the orderId property: The order ID of the reservation. The field is only applicable for transaction of kind + * reservation. * - * @return the subscriptionName value. + * @return the orderId value. */ - String subscriptionName(); + String orderId(); /** - * Gets the azurePlan property: The type of azure plan of the subscription that was used for the transaction. + * Gets the orderName property: The name of the reservation order. The field is only applicable for transactions of + * kind reservation. * - * @return the azurePlan value. + * @return the orderName value. */ - String azurePlan(); + String orderName(); /** - * Gets the azureCreditApplied property: The amount of any Azure credits automatically applied to this transaction. + * Gets the pricingCurrency property: The ISO 4217 code for the currency in which the product is priced. * - * @return the azureCreditApplied value. + * @return the pricingCurrency value. */ - Amount azureCreditApplied(); + String pricingCurrency(); /** - * Gets the billingCurrency property: The ISO 4217 code for the currency in which this transaction is billed. + * Gets the productDescription property: The description of the product for which the transaction took place. * - * @return the billingCurrency value. + * @return the productDescription value. */ - String billingCurrency(); + String productDescription(); /** - * Gets the discount property: The percentage discount, if any, applied to this transaction. + * Gets the productFamily property: The family of the product for which the transaction took place. * - * @return the discount value. + * @return the productFamily value. */ - Float discount(); + String productFamily(); /** - * Gets the effectivePrice property: The price of the product after applying any discounts. + * Gets the productType property: The type of the product for which the transaction took place. * - * @return the effectivePrice value. + * @return the productType value. */ - Amount effectivePrice(); + String productType(); /** - * Gets the exchangeRate property: The exchange rate used to convert charged amount to billing currency, if - * applicable. + * Gets the productTypeId property: The ID of the product type for which the transaction took place. * - * @return the exchangeRate value. + * @return the productTypeId value. */ - Float exchangeRate(); + String productTypeId(); /** - * Gets the marketPrice property: The retail price of the product. + * Gets the quantity property: The quantity purchased in the transaction. * - * @return the marketPrice value. + * @return the quantity value. */ - Amount marketPrice(); + Integer quantity(); /** - * Gets the pricingCurrency property: The ISO 4217 code for the currency in which the product is priced. + * Gets the servicePeriodEndDate property: The end date of the product term, or the end date of the month in which + * usage ended. * - * @return the pricingCurrency value. + * @return the servicePeriodEndDate value. */ - String pricingCurrency(); + OffsetDateTime servicePeriodEndDate(); /** * Gets the servicePeriodStartDate property: The date of the purchase of the product, or the start date of the month @@ -253,12 +240,20 @@ public interface Transaction { OffsetDateTime servicePeriodStartDate(); /** - * Gets the servicePeriodEndDate property: The end date of the product term, or the end date of the month in which - * usage ended. + * Gets the subscriptionId property: The ID of the subscription that was used for the transaction. The field is only + * applicable for transaction of kind reservation. * - * @return the servicePeriodEndDate value. + * @return the subscriptionId value. */ - OffsetDateTime servicePeriodEndDate(); + String subscriptionId(); + + /** + * Gets the subscriptionName property: The name of the subscription that was used for the transaction. The field is + * only applicable for transaction of kind reservation. + * + * @return the subscriptionName value. + */ + String subscriptionName(); /** * Gets the subTotal property: The pre-tax charged amount for the transaction. @@ -274,6 +269,20 @@ public interface Transaction { */ Amount tax(); + /** + * Gets the transactionAmount property: The charge associated with the transaction. + * + * @return the transactionAmount value. + */ + Amount transactionAmount(); + + /** + * Gets the transactionType property: The type of transaction. + * + * @return the transactionType value. + */ + ReservationType transactionType(); + /** * Gets the unitOfMeasure property: The unit of measure used to bill for the product. For example, compute services * are billed per hour. diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionListResult.java index 16ecbebca4d31..62c586005fb64 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionListResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionListResult.java @@ -13,10 +13,10 @@ @Immutable public final class TransactionListResult { /* - * The list of transactions. + * The link (url) to the next page of results. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; /* * Total number of records. @@ -25,22 +25,22 @@ public final class TransactionListResult { private Integer totalCount; /* - * The link (url) to the next page of results. + * The list of transactions. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; /** Creates an instance of TransactionListResult class. */ public TransactionListResult() { } /** - * Get the value property: The list of transactions. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the value value. + * @return the nextLink value. */ - public List value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** @@ -53,12 +53,12 @@ public Integer totalCount() { } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the value property: The list of transactions. * - * @return the nextLink value. + * @return the value value. */ - public String nextLink() { - return this.nextLink; + public List value() { + return this.value; } /** diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityError.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityError.java index 05141ea1bff90..91973052e67c7 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityError.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityError.java @@ -16,18 +16,18 @@ public final class ValidateProductTransferEligibilityError { @JsonProperty(value = "code") private ProductTransferValidationErrorCode code; - /* - * The error message. - */ - @JsonProperty(value = "message") - private String message; - /* * Detailed error message explaining the error. */ @JsonProperty(value = "details") private String details; + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + /** Creates an instance of ValidateProductTransferEligibilityError class. */ public ValidateProductTransferEligibilityError() { } @@ -53,42 +53,42 @@ public ValidateProductTransferEligibilityError withCode(ProductTransferValidatio } /** - * Get the message property: The error message. + * Get the details property: Detailed error message explaining the error. * - * @return the message value. + * @return the details value. */ - public String message() { - return this.message; + public String details() { + return this.details; } /** - * Set the message property: The error message. + * Set the details property: Detailed error message explaining the error. * - * @param message the message value to set. + * @param details the details value to set. * @return the ValidateProductTransferEligibilityError object itself. */ - public ValidateProductTransferEligibilityError withMessage(String message) { - this.message = message; + public ValidateProductTransferEligibilityError withDetails(String details) { + this.details = details; return this; } /** - * Get the details property: Detailed error message explaining the error. + * Get the message property: The error message. * - * @return the details value. + * @return the message value. */ - public String details() { - return this.details; + public String message() { + return this.message; } /** - * Set the details property: Detailed error message explaining the error. + * Set the message property: The error message. * - * @param details the details value to set. + * @param message the message value to set. * @return the ValidateProductTransferEligibilityError object itself. */ - public ValidateProductTransferEligibilityError withDetails(String details) { - this.details = details; + public ValidateProductTransferEligibilityError withMessage(String message) { + this.message = message; return this; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityResult.java index 57f3bc3485652..a4b25348e5d52 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityResult.java @@ -9,18 +9,18 @@ /** An immutable client-side representation of ValidateProductTransferEligibilityResult. */ public interface ValidateProductTransferEligibilityResult { /** - * Gets the isMoveEligible property: Specifies whether the transfer is eligible or not. + * Gets the errorDetails property: Validation error details. * - * @return the isMoveEligible value. + * @return the errorDetails value. */ - Boolean isMoveEligible(); + ValidateProductTransferEligibilityError errorDetails(); /** - * Gets the errorDetails property: Validation error details. + * Gets the isMoveEligible property: Specifies whether the transfer is eligible or not. * - * @return the errorDetails value. + * @return the isMoveEligible value. */ - ValidateProductTransferEligibilityError errorDetails(); + Boolean isMoveEligible(); /** * Gets the inner com.azure.resourcemanager.billing.fluent.models.ValidateProductTransferEligibilityResultInner diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityError.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityError.java index d7fa61fceaa0b..d4370b8de5ee2 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityError.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityError.java @@ -16,18 +16,18 @@ public final class ValidateSubscriptionTransferEligibilityError { @JsonProperty(value = "code") private SubscriptionTransferValidationErrorCode code; - /* - * The error message. - */ - @JsonProperty(value = "message") - private String message; - /* * Detailed error message explaining the error. */ @JsonProperty(value = "details") private String details; + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + /** Creates an instance of ValidateSubscriptionTransferEligibilityError class. */ public ValidateSubscriptionTransferEligibilityError() { } @@ -53,42 +53,42 @@ public ValidateSubscriptionTransferEligibilityError withCode(SubscriptionTransfe } /** - * Get the message property: The error message. + * Get the details property: Detailed error message explaining the error. * - * @return the message value. + * @return the details value. */ - public String message() { - return this.message; + public String details() { + return this.details; } /** - * Set the message property: The error message. + * Set the details property: Detailed error message explaining the error. * - * @param message the message value to set. + * @param details the details value to set. * @return the ValidateSubscriptionTransferEligibilityError object itself. */ - public ValidateSubscriptionTransferEligibilityError withMessage(String message) { - this.message = message; + public ValidateSubscriptionTransferEligibilityError withDetails(String details) { + this.details = details; return this; } /** - * Get the details property: Detailed error message explaining the error. + * Get the message property: The error message. * - * @return the details value. + * @return the message value. */ - public String details() { - return this.details; + public String message() { + return this.message; } /** - * Set the details property: Detailed error message explaining the error. + * Set the message property: The error message. * - * @param details the details value to set. + * @param message the message value to set. * @return the ValidateSubscriptionTransferEligibilityError object itself. */ - public ValidateSubscriptionTransferEligibilityError withDetails(String details) { - this.details = details; + public ValidateSubscriptionTransferEligibilityError withMessage(String message) { + this.message = message; return this; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityResult.java index a090986d8003f..f6cce664a1ed4 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityResult.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityResult.java @@ -9,18 +9,18 @@ /** An immutable client-side representation of ValidateSubscriptionTransferEligibilityResult. */ public interface ValidateSubscriptionTransferEligibilityResult { /** - * Gets the isMoveEligible property: Specifies whether the subscription is eligible to be transferred. + * Gets the errorDetails property: Validation error details. * - * @return the isMoveEligible value. + * @return the errorDetails value. */ - Boolean isMoveEligible(); + ValidateSubscriptionTransferEligibilityError errorDetails(); /** - * Gets the errorDetails property: Validation error details. + * Gets the isMoveEligible property: Specifies whether the subscription is eligible to be transferred. * - * @return the errorDetails value. + * @return the isMoveEligible value. */ - ValidateSubscriptionTransferEligibilityError errorDetails(); + Boolean isMoveEligible(); /** * Gets the inner com.azure.resourcemanager.billing.fluent.models.ValidateSubscriptionTransferEligibilityResultInner diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/package-info.java index 5bd18ba909787..d9b7b8143c08e 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/package-info.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/package-info.java @@ -2,8 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** - * Package containing the data models for BillingManagementClient. Billing client provides access to billing resources - * for Azure subscriptions. - */ +/** Package containing the data models for BillingManagementClient. Billing Client. */ package com.azure.resourcemanager.billing.models; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/package-info.java index 85bcbed59250f..4165d0989846b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/package-info.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/package-info.java @@ -2,8 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** - * Package containing the classes for BillingManagementClient. Billing client provides access to billing resources for - * Azure subscriptions. - */ +/** Package containing the classes for BillingManagementClient. Billing Client. */ package com.azure.resourcemanager.billing; diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AddressValidateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AddressValidateSamples.java index a85bfdbed0752..406fff85bd4e9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AddressValidateSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AddressValidateSamples.java @@ -9,44 +9,44 @@ /** Samples for Address Validate. */ public final class AddressValidateSamples { /* - * 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/2023-04-01/examples/addressValidateValid.json */ /** - * Sample code: AddressInvalid. + * Sample code: addressValidateValid. * * @param manager Entry point to BillingManager. */ - public static void addressInvalid(com.azure.resourcemanager.billing.BillingManager manager) { + public static void addressValidateValid(com.azure.resourcemanager.billing.BillingManager manager) { manager .address() .validateWithResponse( new AddressDetails() - .withAddressLine1("1 Test") + .withAddressLine1("1 Test Address") .withCity("bellevue") - .withRegion("wa") .withCountry("us") - .withPostalCode("fakeTokenPlaceholder"), + .withPostalCode("fakeTokenPlaceholder") + .withRegion("wa"), com.azure.core.util.Context.NONE); } /* - * 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/2023-04-01/examples/addressValidateInvalid.json */ /** - * Sample code: AddressValid. + * Sample code: addressValidateInvalid. * * @param manager Entry point to BillingManager. */ - public static void addressValid(com.azure.resourcemanager.billing.BillingManager manager) { + public static void addressValidateInvalid(com.azure.resourcemanager.billing.BillingManager manager) { manager .address() .validateWithResponse( new AddressDetails() - .withAddressLine1("1 Test Address") + .withAddressLine1("1 Test") .withCity("bellevue") - .withRegion("wa") .withCountry("us") - .withPostalCode("fakeTokenPlaceholder"), + .withPostalCode("fakeTokenPlaceholder") + .withRegion("wa"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsGetSamples.java index 0e47789c27aba..80cc838c1f295 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsGetSamples.java @@ -7,14 +7,14 @@ /** Samples for Agreements Get. */ public final class AgreementsGetSamples { /* - * 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/2023-04-01/examples/agreementsGet.json */ /** - * Sample code: AgreementByName. + * Sample code: agreementsGet. * * @param manager Entry point to BillingManager. */ - public static void agreementByName(com.azure.resourcemanager.billing.BillingManager manager) { + public static void agreementsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .agreements() .getWithResponse("{billingAccountName}", "{agreementName}", null, com.azure.core.util.Context.NONE); diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountSamples.java index fc4be17de7029..0f14cb424ff3c 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountSamples.java @@ -7,10 +7,10 @@ /** Samples for Agreements ListByBillingAccount. */ public final class AgreementsListByBillingAccountSamples { /* - * 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/2023-04-01/examples/agreementsListByBillingAccount.json */ /** - * Sample code: AgreementsListByBillingAccount. + * Sample code: agreementsListByBillingAccount. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsCreateOrUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ff3118b8014e6 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsCreateOrUpdateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for AssociatedTenants CreateOrUpdate. */ +public final class AssociatedTenantsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/associatedTenantsCreateOrUpdate.json + */ + /** + * Sample code: AssociatedTenantsCreateOrUpdate. + * + * @param manager Entry point to BillingManager. + */ + public static void associatedTenantsCreateOrUpdate(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .associatedTenants() + .createOrUpdate( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "11111111-1111-1111-1111-111111111111", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsDeleteSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsDeleteSamples.java new file mode 100644 index 0000000000000..bff84a9c9c351 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for AssociatedTenants Delete. */ +public final class AssociatedTenantsDeleteSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/associatedTenantsDelete.json + */ + /** + * Sample code: AssociatedTenantsDelete. + * + * @param manager Entry point to BillingManager. + */ + public static void associatedTenantsDelete(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .associatedTenants() + .delete( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "11111111-1111-1111-1111-111111111111", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsGetSamples.java new file mode 100644 index 0000000000000..fa8a7acaa5439 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for AssociatedTenants Get. */ +public final class AssociatedTenantsGetSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/associatedTenantsGet.json + */ + /** + * Sample code: AssociatedTenantsGet. + * + * @param manager Entry point to BillingManager. + */ + public static void associatedTenantsGet(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .associatedTenants() + .getWithResponse( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "11111111-1111-1111-1111-111111111111", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsListByBillingAccountSamples.java new file mode 100644 index 0000000000000..1f9b430f1c8e4 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AssociatedTenantsListByBillingAccountSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for AssociatedTenants ListByBillingAccount. */ +public final class AssociatedTenantsListByBillingAccountSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/associatedTenantsListByBillingAccount.json + */ + /** + * Sample code: AssociatedTenantsListByBillingAccount. + * + * @param manager Entry point to BillingManager. + */ + public static void associatedTenantsListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .associatedTenants() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + null, + null, + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetSamples.java index b2c36890b574a..a4142d7df35cc 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetSamples.java @@ -7,14 +7,14 @@ /** Samples for AvailableBalances Get. */ public final class AvailableBalancesGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/availableBalancesGetByBillingProfile.json */ /** - * Sample code: AvailableBalanceByBillingProfile. + * Sample code: availableBalancesGetByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void availableBalanceByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + public static void availableBalancesGetByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { manager .availableBalances() .getWithResponse("{billingAccountName}", "{billingProfileName}", com.azure.core.util.Context.NONE); diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsGetSamples.java index 2931b35323d60..aa687602c3ecd 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsGetSamples.java @@ -7,31 +7,36 @@ /** Samples for BillingAccounts Get. */ public final class BillingAccountsGetSamples { /* - * 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/2023-04-01/examples/billingAccountsGet.json */ /** - * Sample code: BillingAccountWithExpand. + * Sample code: billingAccountsGet. * * @param manager Entry point to BillingManager. */ - public static void billingAccountWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingAccountsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingAccounts() .getWithResponse( - "{billingAccountName}", - "soldTo,billingProfiles,billingProfiles/invoiceSections", + "00000000-0000-0000-0000-000000000000:11111111-1111-1111-1111-111111111111_2019-05-31", + null, com.azure.core.util.Context.NONE); } /* - * 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/2023-04-01/examples/billingAccountsGetWithExpand.json */ /** - * Sample code: BillingAccounts. + * Sample code: billingAccountsGetWithExpand. * * @param manager Entry point to BillingManager. */ - public static void billingAccounts(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingAccounts().getWithResponse("{billingAccountName}", null, com.azure.core.util.Context.NONE); + public static void billingAccountsGetWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingAccounts() + .getWithResponse( + "00000000-0000-0000-0000-000000000000:11111111-1111-1111-1111-111111111111_2019-05-31", + "soldTo,billingProfiles,billingProfiles/invoiceSections", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples.java index c0949ee719f4d..072c96231d319 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples.java @@ -7,10 +7,10 @@ /** Samples for BillingAccounts ListInvoiceSectionsByCreateSubscriptionPermission. */ public final class BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples { /* - * 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/2023-04-01/examples/invoiceSectionsListWithCreateSubPermission.json */ /** - * Sample code: InvoiceSectionsListWithCreateSubPermission. + * Sample code: invoiceSectionsListWithCreateSubPermission. * * @param manager Entry point to BillingManager. */ @@ -19,6 +19,7 @@ public static void invoiceSectionsListWithCreateSubPermission( manager .billingAccounts() .listInvoiceSectionsByCreateSubscriptionPermission( - "{billingAccountName}", com.azure.core.util.Context.NONE); + "00000000-0000-0000-0000-000000000000:11111111-1111-1111-1111-111111111111_2019-05-31", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListSamples.java index b928c56edfcc0..b66429759a667 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListSamples.java @@ -7,37 +7,37 @@ /** Samples for BillingAccounts List. */ public final class BillingAccountsListSamples { /* - * 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/2023-04-01/examples/billingAccountsListWithExpandForEnrollmentDetails.json */ /** - * Sample code: BillingAccountsList. + * Sample code: billingAccountsListWithExpandForEnrollmentDetails. * * @param manager Entry point to BillingManager. */ - public static void billingAccountsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingAccounts().list(null, com.azure.core.util.Context.NONE); + public static void billingAccountsListWithExpandForEnrollmentDetails( + com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingAccounts() + .list("enrollmentDetails,departments,enrollmentAccounts", com.azure.core.util.Context.NONE); } /* - * 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/2023-04-01/examples/billingAccountsList.json */ /** - * Sample code: BillingAccountsListWithExpandForEnrollmentDetails. + * Sample code: billingAccountsList. * * @param manager Entry point to BillingManager. */ - public static void billingAccountsListWithExpandForEnrollmentDetails( - com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingAccounts() - .list("enrollmentDetails,departments,enrollmentAccounts", com.azure.core.util.Context.NONE); + public static void billingAccountsList(com.azure.resourcemanager.billing.BillingManager manager) { + manager.billingAccounts().list(null, com.azure.core.util.Context.NONE); } /* - * 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/2023-04-01/examples/billingAccountsListWithExpand.json */ /** - * Sample code: BillingAccountsListWithExpand. + * Sample code: billingAccountsListWithExpand. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsUpdateSamples.java index a8bc12b67ee2e..cc2040c59d2a0 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsUpdateSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsUpdateSamples.java @@ -10,30 +10,30 @@ /** Samples for BillingAccounts Update. */ public final class BillingAccountsUpdateSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingAccountsPatch.json */ /** - * Sample code: UpdateBillingAccount. + * Sample code: billingAccountsPatch. * * @param manager Entry point to BillingManager. */ - public static void updateBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingAccountsPatch(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingAccounts() .update( - "{billingAccountName}", + "00000000-0000-0000-0000-000000000000:11111111-1111-1111-1111-111111111111_2019-05-31", new BillingAccountUpdateRequest() .withDisplayName("Test Account") .withSoldTo( new AddressDetails() - .withFirstName("Test") - .withLastName("User") - .withCompanyName("Contoso") .withAddressLine1("Test Address 1") .withCity("Redmond") - .withRegion("WA") + .withCompanyName("Contoso") .withCountry("US") - .withPostalCode("fakeTokenPlaceholder")), + .withFirstName("Test") + .withLastName("User") + .withPostalCode("fakeTokenPlaceholder") + .withRegion("WA")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetSamples.java deleted file mode 100644 index a8eeef3411e64..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -/** Samples for BillingPeriods Get. */ -public final class BillingPeriodsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json - */ - /** - * Sample code: BillingPeriodsGet. - * - * @param manager Entry point to BillingManager. - */ - public static void billingPeriodsGet(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingPeriods().getWithResponse("201702-1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListSamples.java deleted file mode 100644 index fe074f624dfb6..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -/** Samples for BillingPeriods List. */ -public final class BillingPeriodsListSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json - */ - /** - * Sample code: BillingPeriodsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingPeriodsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingPeriods().list(null, null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountSamples.java index 749219927b8a9..675ff1a3e56d7 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingPermissions ListByBillingAccount. */ public final class BillingPermissionsListByBillingAccountSamples { /* - * 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/2023-04-01/examples/billingPermissionsListByBillingAccount.json */ /** - * Sample code: BillingAccountPermissionsList. + * Sample code: billingPermissionsListByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountPermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPermissionsListByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager.billingPermissions().listByBillingAccount("{billingAccountName}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileSamples.java index 9c700744f8d12..ea7c3755d7b0f 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingPermissions ListByBillingProfile. */ public final class BillingPermissionsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/billingPermissionsListByBillingProfile.json */ /** - * Sample code: BillingProfilePermissionsList. + * Sample code: billingPermissionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfilePermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPermissionsListByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingPermissions() .listByBillingProfile("{billingAccountName}", "{billingProfileName}", com.azure.core.util.Context.NONE); diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerSamples.java index 47ecb819e6c3d..807e8412b1ca8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerSamples.java @@ -7,14 +7,14 @@ /** Samples for BillingPermissions ListByCustomer. */ public final class BillingPermissionsListByCustomerSamples { /* - * 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/2023-04-01/examples/billingPermissionsListByCustomer.json */ /** - * Sample code: BillingProfilePermissionsList. + * Sample code: billingPermissionsListByCustomer. * * @param manager Entry point to BillingManager. */ - public static void billingProfilePermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPermissionsListByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingPermissions() .listByCustomer("{billingAccountName}", "{customerName}", com.azure.core.util.Context.NONE); diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsSamples.java index 375cf59b6cf2d..fad6e3d274cae 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingPermissions ListByInvoiceSections. */ public final class BillingPermissionsListByInvoiceSectionsSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingPermissionsListByInvoiceSection.json */ /** - * Sample code: InvoiceSectionPermissionsList. + * Sample code: billingPermissionsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionPermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPermissionsListByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingPermissions() .listByInvoiceSections( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesCreateOrUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesCreateOrUpdateSamples.java index 945ebcfb43890..2be149c24edbb 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesCreateOrUpdateSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesCreateOrUpdateSamples.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.billing.generated; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; +import com.azure.resourcemanager.billing.fluent.models.BillingProfileAutoGeneratedInner; import com.azure.resourcemanager.billing.models.AddressDetails; import com.azure.resourcemanager.billing.models.AzurePlan; import java.util.Arrays; @@ -12,34 +12,33 @@ /** Samples for BillingProfiles CreateOrUpdate. */ public final class BillingProfilesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesPut.json */ /** - * Sample code: CreateBillingProfile. + * Sample code: billingProfilesPut. * * @param manager Entry point to BillingManager. */ - public static void createBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingProfilesPut(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProfiles() .createOrUpdate( "{billingAccountName}", "{billingProfileName}", - new BillingProfileInner() - .withDisplayName("Finance") - .withPoNumber("ABC12345") + new BillingProfileAutoGeneratedInner() .withBillTo( new AddressDetails() - .withFirstName("Test") - .withLastName("User") .withAddressLine1("Test Address 1") .withCity("Redmond") - .withRegion("WA") .withCountry("US") - .withPostalCode("fakeTokenPlaceholder")) + .withFirstName("Test") + .withLastName("User") + .withPostalCode("fakeTokenPlaceholder") + .withRegion("WA")) + .withDisplayName("Finance") + .withEnabledAzurePlans(Arrays.asList(new AzurePlan(), new AzurePlan())) .withInvoiceEmailOptIn(true) - .withEnabledAzurePlans( - Arrays.asList(new AzurePlan().withSkuId("0001"), new AzurePlan().withSkuId("0002"))), + .withPoNumber("ABC12345"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesGetSamples.java index 0ee57263e0e51..857784b9955eb 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesGetSamples.java @@ -7,31 +7,31 @@ /** Samples for BillingProfiles Get. */ public final class BillingProfilesGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileWithExpand.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesGet.json */ /** - * Sample code: BillingProfileWithExpand. + * Sample code: billingProfilesGet. * * @param manager Entry point to BillingManager. */ - public static void billingProfileWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingProfilesGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProfiles() - .getWithResponse( - "{billingAccountName}", "{billingProfileName}", "invoiceSections", com.azure.core.util.Context.NONE); + .getWithResponse("{billingAccountName}", "{billingProfileName}", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesGetWithExpand.json */ /** - * Sample code: BillingProfile. + * Sample code: billingProfilesGetWithExpand. * * @param manager Entry point to BillingManager. */ - public static void billingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingProfilesGetWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProfiles() - .getWithResponse("{billingAccountName}", "{billingProfileName}", null, com.azure.core.util.Context.NONE); + .getWithResponse( + "{billingAccountName}", "{billingProfileName}", "invoiceSections", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesListByBillingAccountSamples.java index 3dd1368def39b..bf6f13e627b52 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesListByBillingAccountSamples.java @@ -7,24 +7,25 @@ /** Samples for BillingProfiles ListByBillingAccount. */ public final class BillingProfilesListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListWithExpand.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesListByBillingAccountWithExpand.json */ /** - * Sample code: BillingProfilesListWithExpand. + * Sample code: billingProfilesListByBillingAccountWithExpand. * * @param manager Entry point to BillingManager. */ - public static void billingProfilesListWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingProfilesListByBillingAccountWithExpand( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProfiles() .listByBillingAccount("{billingAccountName}", "invoiceSections", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingProfilesListByBillingAccount.json */ /** - * Sample code: BillingProfilesListByBillingAccount. + * Sample code: billingProfilesListByBillingAccount. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyGetSamples.java index 2d42a03f854fe..549ac2b5d2c92 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyGetSamples.java @@ -7,14 +7,14 @@ /** Samples for BillingProperty Get. */ public final class BillingPropertyGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingPropertiesGet.json */ /** - * Sample code: BillingProperty. + * Sample code: billingPropertiesGet. * * @param manager Entry point to BillingManager. */ - public static void billingProperty(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingProperties().getWithResponse(com.azure.core.util.Context.NONE); + public static void billingPropertiesGet(com.azure.resourcemanager.billing.BillingManager manager) { + manager.billingProperties().getWithResponse("{subscriptionId}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyUpdateSamples.java index 7fa915bdf3011..d6ee273de9ab7 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyUpdateSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyUpdateSamples.java @@ -9,16 +9,19 @@ /** Samples for BillingProperty Update. */ public final class BillingPropertyUpdateSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingPropertiesPatch.json */ /** - * Sample code: UpdateBillingProperty. + * Sample code: billingPropertiesPatch. * * @param manager Entry point to BillingManager. */ - public static void updateBillingProperty(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingPropertiesPatch(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingProperties() - .updateWithResponse(new BillingPropertyInner().withCostCenter("1010"), com.azure.core.util.Context.NONE); + .updateWithResponse( + "{subscriptionId}", + new BillingPropertyInner().withCostCenter("1010"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsCreateOrUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f97c202611313 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsCreateOrUpdateSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for BillingRequests CreateOrUpdate. */ +public final class BillingRequestsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsCreateOrUpdate.json + */ + /** + * Sample code: BillingRequestsCreateOrUpdate. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsCreateOrUpdate(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .createOrUpdate("00000000-0000-0000-0000-000000000000", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsGetSamples.java new file mode 100644 index 0000000000000..961f4cdb1d7cd --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for BillingRequests Get. */ +public final class BillingRequestsGetSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsGet.json + */ + /** + * Sample code: BillingRequestsGet. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsGet(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .getWithResponse("00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsListByBillingAccountSamples.java new file mode 100644 index 0000000000000..fa4c1c386a2cc --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsListByBillingAccountSamples.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for BillingRequests ListByBillingAccount. */ +public final class BillingRequestsListByBillingAccountSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByInvoiceSection.json + */ + /** + * Sample code: BillingRequestsListByInvoiceSection. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByInvoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "properties/invoiceSectionName eq 'xxxx-xxxx-xxx-xxx'", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByBillingAccount.json + */ + /** + * Sample code: BillingRequestsListByBillingAccount. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + null, + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByBillingProfile.json + */ + /** + * Sample code: BillingRequestsListByBillingProfile. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", + "properties/billingProfileName eq 'xxxx-xxxx-xxx-xxx'", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsListByUserSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsListByUserSamples.java new file mode 100644 index 0000000000000..d603e8d6a6028 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRequestsListByUserSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for BillingRequests ListByUser. */ +public final class BillingRequestsListByUserSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByUser.json + */ + /** + * Sample code: BillingRequestsListByUser. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByUser(com.azure.resourcemanager.billing.BillingManager manager) { + manager.billingRequests().listByUser(null, null, null, null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRequestsListByUserWithFilter.json + */ + /** + * Sample code: BillingRequestsListByUserWithFilter. + * + * @param manager Entry point to BillingManager. + */ + public static void billingRequestsListByUserWithFilter(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingRequests() + .listByUser( + "properties/status eq 'Approved'", null, null, null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountSamples.java index e58ac66809b40..e34f6b4568c69 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleAssignments DeleteByBillingAccount. */ public final class BillingRoleAssignmentsDeleteByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsDeleteByBillingAccount.json */ /** - * Sample code: BillingAccountRoleAssignmentDelete. + * Sample code: billingRoleAssignmentsDeleteByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleAssignmentDelete(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsDeleteByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .deleteByBillingAccountWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileSamples.java index 1233799c36c39..ad2c68038b236 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleAssignments DeleteByBillingProfile. */ public final class BillingRoleAssignmentsDeleteByBillingProfileSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsDeleteByBillingProfile.json */ /** - * Sample code: BillingProfileRoleAssignmentDelete. + * Sample code: billingRoleAssignmentsDeleteByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleAssignmentDelete(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsDeleteByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .deleteByBillingProfileWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionSamples.java index ffed5ad0544db..72d59a0196837 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleAssignments DeleteByInvoiceSection. */ public final class BillingRoleAssignmentsDeleteByInvoiceSectionSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsDeleteByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleAssignmentDelete. + * Sample code: billingRoleAssignmentsDeleteByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleAssignmentDelete(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsDeleteByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .deleteByInvoiceSectionWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountSamples.java index ddb4c22181728..3336e99bb32dc 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleAssignments GetByBillingAccount. */ public final class BillingRoleAssignmentsGetByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsGetByBillingAccount.json */ /** - * Sample code: BillingAccountRoleAssignment. + * Sample code: billingRoleAssignmentsGetByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleAssignment(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsGetByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .getByBillingAccountWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileSamples.java index 510dc17118305..81e451cc07549 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleAssignments GetByBillingProfile. */ public final class BillingRoleAssignmentsGetByBillingProfileSamples { /* - * 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/2023-04-01/examples/billingRoleAssignmentsGetByBillingProfile.json */ /** - * Sample code: BillingProfileRoleAssignment. + * Sample code: billingRoleAssignmentsGetByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleAssignment(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsGetByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .getByBillingProfileWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionSamples.java index 59207d8350b22..129a835a0b788 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleAssignments GetByInvoiceSection. */ public final class BillingRoleAssignmentsGetByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingRoleAssignmentsGetByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleAssignment. + * Sample code: billingRoleAssignmentsGetByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleAssignment(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsGetByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .getByInvoiceSectionWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountSamples.java index 1a2fee1fb595a..328670d16ee27 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleAssignments ListByBillingAccount. */ public final class BillingRoleAssignmentsListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsListByBillingAccount.json */ /** - * Sample code: BillingAccountRoleAssignmentList. + * Sample code: billingRoleAssignmentsListByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleAssignmentList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsListByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager.billingRoleAssignments().listByBillingAccount("{billingAccountName}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileSamples.java index 1b1fb83d0ee8a..9dd9ab3c4dd83 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleAssignments ListByBillingProfile. */ public final class BillingRoleAssignmentsListByBillingProfileSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleAssignmentsListByBillingProfile.json */ /** - * Sample code: BillingProfileRoleAssignmentList. + * Sample code: billingRoleAssignmentsListByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleAssignmentList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsListByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .listByBillingProfile("{billingAccountName}", "{billingProfileName}", com.azure.core.util.Context.NONE); diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionSamples.java index 5deba09f74879..88daf825f0617 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleAssignments ListByInvoiceSection. */ public final class BillingRoleAssignmentsListByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingRoleAssignmentsListByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleAssignmentList. + * Sample code: billingRoleAssignmentsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleAssignmentList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleAssignmentsListByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleAssignments() .listByInvoiceSection( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountSamples.java index fb5ce1213d067..efa8c82b22a8b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleDefinitions GetByBillingAccount. */ public final class BillingRoleDefinitionsGetByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleDefinitionsGetByBillingAccount.json */ /** - * Sample code: BillingAccountRoleDefinition. + * Sample code: billingRoleDefinitionsGetByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleDefinition(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsGetByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .getByBillingAccountWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileSamples.java index c1c38629a9230..9b125ee0b397f 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleDefinitions GetByBillingProfile. */ public final class BillingRoleDefinitionsGetByBillingProfileSamples { /* - * 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/2023-04-01/examples/billingRoleDefinitionsGetByBillingProfile.json */ /** - * Sample code: BillingProfileRoleDefinition. + * Sample code: billingRoleDefinitionsGetByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleDefinition(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsGetByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .getByBillingProfileWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionSamples.java index 49afb6680f4f2..9702f67ef0edd 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleDefinitions GetByInvoiceSection. */ public final class BillingRoleDefinitionsGetByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingRoleDefinitionsGetByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleDefinition. + * Sample code: billingRoleDefinitionsGetByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleDefinition(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsGetByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .getByInvoiceSectionWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountSamples.java index e885d49b3d841..3930af83ce926 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleDefinitions ListByBillingAccount. */ public final class BillingRoleDefinitionsListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleDefinitionsListByBillingAccount.json */ /** - * Sample code: BillingAccountRoleDefinitionsList. + * Sample code: billingRoleDefinitionsListByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountRoleDefinitionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsListByBillingAccount( + com.azure.resourcemanager.billing.BillingManager manager) { manager.billingRoleDefinitions().listByBillingAccount("{billingAccountName}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileSamples.java index 4b309b01b1804..9aace562f885a 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleDefinitions ListByBillingProfile. */ public final class BillingRoleDefinitionsListByBillingProfileSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingRoleDefinitionsListByBillingProfile.json */ /** - * Sample code: BillingProfileRoleDefinitionsList. + * Sample code: billingRoleDefinitionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void billingProfileRoleDefinitionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsListByBillingProfile( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .listByBillingProfile("{billingAccountName}", "{billingProfileName}", com.azure.core.util.Context.NONE); diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionSamples.java index a00a74ebb81db..06be9b4228baa 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionSamples.java @@ -7,14 +7,15 @@ /** Samples for BillingRoleDefinitions ListByInvoiceSection. */ public final class BillingRoleDefinitionsListByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingRoleDefinitionsListByInvoiceSection.json */ /** - * Sample code: InvoiceSectionRoleDefinitionsList. + * Sample code: billingRoleDefinitionsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ - public static void invoiceSectionRoleDefinitionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingRoleDefinitionsListByInvoiceSection( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingRoleDefinitions() .listByInvoiceSection( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetSamples.java index 162f315126b7e..4ce615d122e77 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetSamples.java @@ -7,14 +7,16 @@ /** Samples for BillingSubscriptions Get. */ public final class BillingSubscriptionsGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsGet.json */ /** - * Sample code: BillingSubscription. + * Sample code: billingSubscriptionsGet. * * @param manager Entry point to BillingManager. */ - public static void billingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingSubscriptions().getWithResponse("{billingAccountName}", com.azure.core.util.Context.NONE); + public static void billingSubscriptionsGet(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .billingSubscriptions() + .getWithResponse("{billingAccountName}", "{subscriptionId}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountSamples.java index a17560829e65c..5d4a86b82ad30 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountSamples.java @@ -7,10 +7,10 @@ /** Samples for BillingSubscriptions ListByBillingAccount. */ public final class BillingSubscriptionsListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsListByBillingAccount.json */ /** - * Sample code: BillingSubscriptionsListByBillingAccount. + * Sample code: billingSubscriptionsListByBillingAccount. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileSamples.java index 55dea15e35d47..ea3c0df9a8473 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileSamples.java @@ -7,10 +7,10 @@ /** Samples for BillingSubscriptions ListByBillingProfile. */ public final class BillingSubscriptionsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/billingSubscriptionsListByBillingProfile.json */ /** - * Sample code: BillingSubscriptionsListByBillingProfile. + * Sample code: billingSubscriptionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerSamples.java index e841064075b60..3eb2f3192aab1 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerSamples.java @@ -7,10 +7,10 @@ /** Samples for BillingSubscriptions ListByCustomer. */ public final class BillingSubscriptionsListByCustomerSamples { /* - * 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/2023-04-01/examples/billingSubscriptionsListByCustomer.json */ /** - * Sample code: BillingSubscriptionsListByCustomer. + * Sample code: billingSubscriptionsListByCustomer. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionSamples.java index a67ea15b6760b..8413378422c26 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionSamples.java @@ -7,10 +7,10 @@ /** Samples for BillingSubscriptions ListByInvoiceSection. */ public final class BillingSubscriptionsListByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/billingSubscriptionsListByInvoiceSection.json */ /** - * Sample code: BillingSubscriptionsListByInvoiceSection. + * Sample code: billingSubscriptionsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveSamples.java index 3892c08e03d7c..f5ff1ed6c2028 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveSamples.java @@ -9,18 +9,19 @@ /** Samples for BillingSubscriptions Move. */ public final class BillingSubscriptionsMoveSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsMove.json */ /** - * Sample code: MoveBillingSubscription. + * Sample code: billingSubscriptionsMove. * * @param manager Entry point to BillingManager. */ - public static void moveBillingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingSubscriptionsMove(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingSubscriptions() .move( "{billingAccountName}", + "{subscriptionId}", new TransferBillingSubscriptionRequestProperties() .withDestinationInvoiceSectionId( "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateSamples.java index e55a3d34ba98e..5d3b94f21cffd 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateSamples.java @@ -9,18 +9,19 @@ /** Samples for BillingSubscriptions Update. */ public final class BillingSubscriptionsUpdateSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsPatch.json */ /** - * Sample code: UpdateBillingProperty. + * Sample code: billingSubscriptionsPatch. * * @param manager Entry point to BillingManager. */ - public static void updateBillingProperty(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingSubscriptionsPatch(com.azure.resourcemanager.billing.BillingManager manager) { manager .billingSubscriptions() .updateWithResponse( "{billingAccountName}", + "{subscriptionId}", new BillingSubscriptionInner().withCostCenter("ABC1234"), com.azure.core.util.Context.NONE); } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsValidateMoveSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsValidateMoveSamples.java index bd1daa62cbeac..06955ea8f1ffb 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsValidateMoveSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsValidateMoveSamples.java @@ -9,18 +9,20 @@ /** Samples for BillingSubscriptions ValidateMove. */ public final class BillingSubscriptionsValidateMoveSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsValidateMoveFailure.json */ /** - * Sample code: SubscriptionMoveValidateFailure. + * Sample code: billingSubscriptionsValidateMoveFailure. * * @param manager Entry point to BillingManager. */ - public static void subscriptionMoveValidateFailure(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingSubscriptionsValidateMoveFailure( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingSubscriptions() .validateMoveWithResponse( "{billingAccountName}", + "{subscriptionId}", new TransferBillingSubscriptionRequestProperties() .withDestinationInvoiceSectionId( "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), @@ -28,18 +30,20 @@ public static void subscriptionMoveValidateFailure(com.azure.resourcemanager.bil } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveSuccess.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/billingSubscriptionsValidateMoveSuccess.json */ /** - * Sample code: SubscriptionMoveValidateSuccess. + * Sample code: billingSubscriptionsValidateMoveSuccess. * * @param manager Entry point to BillingManager. */ - public static void subscriptionMoveValidateSuccess(com.azure.resourcemanager.billing.BillingManager manager) { + public static void billingSubscriptionsValidateMoveSuccess( + com.azure.resourcemanager.billing.BillingManager manager) { manager .billingSubscriptions() .validateMoveWithResponse( "{billingAccountName}", + "{subscriptionId}", new TransferBillingSubscriptionRequestProperties() .withDestinationInvoiceSectionId( "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersGetSamples.java index 52e85bf5d6039..a281db2a49c37 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersGetSamples.java @@ -7,14 +7,14 @@ /** Samples for Customers Get. */ public final class CustomersGetSamples { /* - * 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/2023-04-01/examples/customersGetWithExpand.json */ /** - * Sample code: CustomerWithExpand. + * Sample code: customersGetWithExpand. * * @param manager Entry point to BillingManager. */ - public static void customerWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { + public static void customersGetWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { manager .customers() .getWithResponse( @@ -25,14 +25,14 @@ public static void customerWithExpand(com.azure.resourcemanager.billing.BillingM } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/customersGet.json */ /** - * Sample code: Customer. + * Sample code: customersGet. * * @param manager Entry point to BillingManager. */ - public static void customer(com.azure.resourcemanager.billing.BillingManager manager) { + public static void customersGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .customers() .getWithResponse("{billingAccountName}", "{customerName}", null, com.azure.core.util.Context.NONE); diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountSamples.java index 15cd3c3593da9..b502d7bbb0a7b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountSamples.java @@ -7,10 +7,10 @@ /** Samples for Customers ListByBillingAccount. */ public final class CustomersListByBillingAccountSamples { /* - * 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/2023-04-01/examples/customersListByBillingAccount.json */ /** - * Sample code: CustomersListByBillingAccount. + * Sample code: customersListByBillingAccount. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileSamples.java index 88f504d26bc4f..f78db6850a76b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileSamples.java @@ -7,10 +7,10 @@ /** Samples for Customers ListByBillingProfile. */ public final class CustomersListByBillingProfileSamples { /* - * 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/2023-04-01/examples/customersListByBillingProfile.json */ /** - * Sample code: CustomersListByBillingProfile. + * Sample code: customersListByBillingProfile. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetSamples.java deleted file mode 100644 index 3036ac4867da7..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -/** Samples for EnrollmentAccounts Get. */ -public final class EnrollmentAccountsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json - */ - /** - * Sample code: EnrollmentAccountsGet. - * - * @param manager Entry point to BillingManager. - */ - public static void enrollmentAccountsGet(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .enrollmentAccounts() - .getWithResponse("e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListSamples.java deleted file mode 100644 index ac3aba88167c0..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -/** Samples for EnrollmentAccounts List. */ -public final class EnrollmentAccountsListSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json - */ - /** - * Sample code: EnrollmentAccountsList. - * - * @param manager Entry point to BillingManager. - */ - public static void enrollmentAccountsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.enrollmentAccounts().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsGetSamples.java index f880c2ee1880b..c595294615d7b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsGetSamples.java @@ -7,14 +7,14 @@ /** Samples for Instructions Get. */ public final class InstructionsGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/instructionsGet.json */ /** - * Sample code: Instruction. + * Sample code: instructionsGet. * * @param manager Entry point to BillingManager. */ - public static void instruction(com.azure.resourcemanager.billing.BillingManager manager) { + public static void instructionsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .instructions() .getWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileSamples.java index 035d20c24f17f..35924e26995bf 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileSamples.java @@ -7,10 +7,10 @@ /** Samples for Instructions ListByBillingProfile. */ public final class InstructionsListByBillingProfileSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/instructionsListByBillingProfile.json */ /** - * Sample code: InstructionsListByBillingProfile. + * Sample code: instructionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsPutSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsPutSamples.java index 32582dfad5224..be7502a615d2c 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsPutSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsPutSamples.java @@ -10,14 +10,14 @@ /** Samples for Instructions Put. */ public final class InstructionsPutSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/instructionsPut.json */ /** - * Sample code: PutInstruction. + * Sample code: instructionsPut. * * @param manager Entry point to BillingManager. */ - public static void putInstruction(com.azure.resourcemanager.billing.BillingManager manager) { + public static void instructionsPut(com.azure.resourcemanager.billing.BillingManager manager) { manager .instructions() .putWithResponse( @@ -26,8 +26,8 @@ public static void putInstruction(com.azure.resourcemanager.billing.BillingManag "{instructionName}", new InstructionInner() .withAmount(5000f) - .withStartDate(OffsetDateTime.parse("2019-12-30T21:26:47.997Z")) - .withEndDate(OffsetDateTime.parse("2020-12-30T21:26:47.997Z")), + .withEndDate(OffsetDateTime.parse("2020-12-30T21:26:47.997Z")) + .withStartDate(OffsetDateTime.parse("2019-12-30T21:26:47.997Z")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java index 854b6b370fd8b..94eb21e8d8c68 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java @@ -11,14 +11,14 @@ /** Samples for InvoiceSections CreateOrUpdate. */ public final class InvoiceSectionsCreateOrUpdateSamples { /* - * 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/2023-04-01/examples/invoiceSectionsPut.json */ /** - * Sample code: PutInvoiceSection. + * Sample code: invoiceSectionsPut. * * @param manager Entry point to BillingManager. */ - public static void putInvoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoiceSectionsPut(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoiceSections() .createOrUpdate( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetSamples.java index 065b3593969ea..0f37cb449c061 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetSamples.java @@ -7,14 +7,14 @@ /** Samples for InvoiceSections Get. */ public final class InvoiceSectionsGetSamples { /* - * 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/2023-04-01/examples/invoiceSectionsGet.json */ /** - * Sample code: InvoiceSection. + * Sample code: invoiceSectionsGet. * * @param manager Entry point to BillingManager. */ - public static void invoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoiceSectionsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoiceSections() .getWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileSamples.java index f8dc780b02967..03ea63e9230b5 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileSamples.java @@ -7,10 +7,10 @@ /** Samples for InvoiceSections ListByBillingProfile. */ public final class InvoiceSectionsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/invoiceSectionsListByBillingProfile.json */ /** - * Sample code: InvoiceSectionsListByBillingProfile. + * Sample code: invoiceSectionsListByBillingProfile. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceSamples.java index a2b6c40ec013a..76495ecf8f8c4 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceSamples.java @@ -7,16 +7,17 @@ /** Samples for Invoices DownloadBillingSubscriptionInvoice. */ public final class InvoicesDownloadBillingSubscriptionInvoiceSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesDownloadByBillingSubscription.json */ /** - * Sample code: BillingSubscriptionInvoiceDownload. + * Sample code: invoicesDownloadByBillingSubscription. * * @param manager Entry point to BillingManager. */ - public static void billingSubscriptionInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesDownloadByBillingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() - .downloadBillingSubscriptionInvoice("{invoiceName}", "DRS_12345", com.azure.core.util.Context.NONE); + .downloadBillingSubscriptionInvoice( + "{subscriptionId}", "{invoiceName}", "DRS_12345", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceSamples.java index 6925a5b77cbf5..2d18f01c2b9ef 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceSamples.java @@ -7,14 +7,14 @@ /** Samples for Invoices DownloadInvoice. */ public final class InvoicesDownloadInvoiceSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesDownloadByBillingAccount.json */ /** - * Sample code: InvoiceDownload. + * Sample code: invoicesDownloadByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void invoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesDownloadByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() .downloadInvoice("{billingAccountName}", "{invoiceName}", "DRS_12345", com.azure.core.util.Context.NONE); diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesSamples.java index 14f62f95826e9..0a4a87721db1b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesSamples.java @@ -9,23 +9,23 @@ /** Samples for Invoices DownloadMultipleBillingProfileInvoices. */ public final class InvoicesDownloadMultipleBillingProfileInvoicesSamples { /* - * 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/2023-04-01/examples/invoicesDownloadBatchByBillingAccount.json */ /** - * Sample code: BillingProfileInvoiceDownload. + * Sample code: invoicesDownloadBatchByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingProfileInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesDownloadBatchByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() .downloadMultipleBillingProfileInvoices( "{billingAccountName}", Arrays .asList( - "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"), + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01", + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01", + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples.java index 73caf27d94f73..d1038eb65861b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples.java @@ -9,22 +9,24 @@ /** Samples for Invoices DownloadMultipleBillingSubscriptionInvoices. */ public final class InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesDownloadBatchByBillingSubscription.json */ /** - * Sample code: BillingSubscriptionInvoiceDownload. + * Sample code: invoicesDownloadBatchByBillingSubscription. * * @param manager Entry point to BillingManager. */ - public static void billingSubscriptionInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesDownloadBatchByBillingSubscription( + com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() .downloadMultipleBillingSubscriptionInvoices( + "{subscriptionId}", Arrays .asList( - "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"), + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01", + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01", + "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2023-04-01"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdSamples.java index 9e8739aed3961..1f29bdbc68388 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdSamples.java @@ -7,14 +7,14 @@ /** Samples for Invoices GetById. */ public final class InvoicesGetByIdSamples { /* - * 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/2023-04-01/examples/invoicesGet.json */ /** - * Sample code: Invoice. + * Sample code: invoicesGet. * * @param manager Entry point to BillingManager. */ - public static void invoice(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGet(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getByIdWithResponse("{invoiceName}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdSamples.java index dadef8d4ffe0f..5fe45eeeafaf8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdSamples.java @@ -7,15 +7,17 @@ /** Samples for Invoices GetBySubscriptionAndInvoiceId. */ public final class InvoicesGetBySubscriptionAndInvoiceIdSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetByBillingSubscription.json */ /** - * Sample code: BillingSubscriptionsListByBillingAccount. + * Sample code: invoicesGetByBillingSubscription. * * @param manager Entry point to BillingManager. */ - public static void billingSubscriptionsListByBillingAccount( - com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().getBySubscriptionAndInvoiceIdWithResponse("{invoiceName}", com.azure.core.util.Context.NONE); + public static void invoicesGetByBillingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .invoices() + .getBySubscriptionAndInvoiceIdWithResponse( + "{subscriptionId}", "{invoiceName}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetSamples.java index f97b3ad93c772..a8ef28e75f8a9 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetSamples.java @@ -7,50 +7,50 @@ /** Samples for Invoices Get. */ public final class InvoicesGetSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Invoice.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetByBillingAccount.json */ /** - * Sample code: Invoice. + * Sample code: invoicesGetByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void invoice(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGetByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetVoid.json */ /** - * Sample code: CreditNote. + * Sample code: invoicesGetVoid. * * @param manager Entry point to BillingManager. */ - public static void creditNote(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGetVoid(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/VoidInvoice.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetCreditNote.json */ /** - * Sample code: VoidInvoice. + * Sample code: invoicesGetCreditNote. * * @param manager Entry point to BillingManager. */ - public static void voidInvoice(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGetCreditNote(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceWithRebillDetails.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesGetWithRebillDetails.json */ /** - * Sample code: InvoiceWithRebillDetails. + * Sample code: invoicesGetWithRebillDetails. * * @param manager Entry point to BillingManager. */ - public static void invoiceWithRebillDetails(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesGetWithRebillDetails(com.azure.resourcemanager.billing.BillingManager manager) { manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountSamples.java index a6a7fb572c21e..871b4f7c1d756 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountSamples.java @@ -7,28 +7,28 @@ /** Samples for Invoices ListByBillingAccount. */ public final class InvoicesListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesListByBillingAccount.json */ /** - * Sample code: BillingAccountInvoicesList. + * Sample code: invoicesListByBillingAccount. * * @param manager Entry point to BillingManager. */ - public static void billingAccountInvoicesList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void invoicesListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() .listByBillingAccount("{billingAccountName}", "2018-01-01", "2018-06-30", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesListWithRebillDetails.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesListByBillingAccountWithRebillDetails.json */ /** - * Sample code: BillingAccountInvoicesListWithRebillDetails. + * Sample code: invoicesListByBillingAccountWithRebillDetails. * * @param manager Entry point to BillingManager. */ - public static void billingAccountInvoicesListWithRebillDetails( + public static void invoicesListByBillingAccountWithRebillDetails( com.azure.resourcemanager.billing.BillingManager manager) { manager .invoices() diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileSamples.java index 63a25b26023de..681eff05b23ff 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileSamples.java @@ -7,10 +7,10 @@ /** Samples for Invoices ListByBillingProfile. */ public final class InvoicesListByBillingProfileSamples { /* - * 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/2023-04-01/examples/invoicesListByBillingProfile.json */ /** - * Sample code: InvoicesListByBillingProfile. + * Sample code: invoicesListByBillingProfile. * * @param manager Entry point to BillingManager. */ @@ -26,10 +26,10 @@ public static void invoicesListByBillingProfile(com.azure.resourcemanager.billin } /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfileWithRebillDetails.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesListByBillingProfileWithRebillDetails.json */ /** - * Sample code: InvoicesListByBillingProfileWithRebillDetails. + * Sample code: invoicesListByBillingProfileWithRebillDetails. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionSamples.java index 63ffc552facc4..f1a3fed920c4b 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionSamples.java @@ -7,15 +7,17 @@ /** Samples for Invoices ListByBillingSubscription. */ public final class InvoicesListByBillingSubscriptionSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/invoicesListByBillingSubscription.json */ /** - * Sample code: BillingSubscriptionsListByBillingAccount. + * Sample code: invoicesListByBillingSubscription. * * @param manager Entry point to BillingManager. */ - public static void billingSubscriptionsListByBillingAccount( - com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().listByBillingSubscription("2022-01-01", "2022-06-30", com.azure.core.util.Context.NONE); + public static void invoicesListByBillingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .invoices() + .listByBillingSubscription( + "{subscriptionId}", "2022-01-01", "2022-06-30", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/OperationsListSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/OperationsListSamples.java index 695d94af736f8..3b0ef9e30cc53 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/OperationsListSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/OperationsListSamples.java @@ -7,14 +7,14 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/GetOperations.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/operationsGet.json */ /** - * Sample code: BillingAccountPermissionsList. + * Sample code: operationsGet. * * @param manager Entry point to BillingManager. */ - public static void billingAccountPermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { + public static void operationsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsDeleteByUserSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsDeleteByUserSamples.java new file mode 100644 index 0000000000000..61f23be54ee2d --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsDeleteByUserSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for PaymentMethods DeleteByUser. */ +public final class PaymentMethodsDeleteByUserSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodOwnedByUser_Delete.json + */ + /** + * Sample code: DeletePaymentMethodOwnedByUser. + * + * @param manager Entry point to BillingManager. + */ + public static void deletePaymentMethodOwnedByUser(com.azure.resourcemanager.billing.BillingManager manager) { + manager.paymentMethods().deleteByUserWithResponse("ABCDABCDABC0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByBillingAccountSamples.java new file mode 100644 index 0000000000000..41fa0636bc897 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByBillingAccountSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for PaymentMethods GetByBillingAccount. */ +public final class PaymentMethodsGetByBillingAccountSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodAtBillingAccount_Get.json + */ + /** + * Sample code: PaymentMethodGetAtBillingProfile. + * + * @param manager Entry point to BillingManager. + */ + public static void paymentMethodGetAtBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .paymentMethods() + .getByBillingAccountWithResponse( + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", + "21dd9edc-af71-4d62-80ce-37151d475326", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByBillingProfileSamples.java new file mode 100644 index 0000000000000..e3de747166b24 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByBillingProfileSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for PaymentMethods GetByBillingProfile. */ +public final class PaymentMethodsGetByBillingProfileSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodAtBillingProfile_Get.json + */ + /** + * Sample code: PaymentMethodsGetByBillingProfile. + * + * @param manager Entry point to BillingManager. + */ + public static void paymentMethodsGetByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .paymentMethods() + .getByBillingProfileWithResponse( + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", + "ABC1-A1CD-AB1-BP1", + "ABCDABCDABC0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByUserSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByUserSamples.java new file mode 100644 index 0000000000000..aa607702a46d2 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsGetByUserSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for PaymentMethods GetByUser. */ +public final class PaymentMethodsGetByUserSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodOwnedByUser_Get.json + */ + /** + * Sample code: GetPaymentMethodOwnedByUser. + * + * @param manager Entry point to BillingManager. + */ + public static void getPaymentMethodOwnedByUser(com.azure.resourcemanager.billing.BillingManager manager) { + manager.paymentMethods().getByUserWithResponse("ABCDABCDABC0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByBillingAccountSamples.java new file mode 100644 index 0000000000000..c6d1ad0a134d3 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByBillingAccountSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for PaymentMethods ListByBillingAccount. */ +public final class PaymentMethodsListByBillingAccountSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodAtBillingAccount_List.json + */ + /** + * Sample code: PaymentMethodsListByBillingAccount. + * + * @param manager Entry point to BillingManager. + */ + public static void paymentMethodsListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .paymentMethods() + .listByBillingAccount( + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByBillingProfileSamples.java new file mode 100644 index 0000000000000..f28c87c2213b7 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByBillingProfileSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for PaymentMethods ListByBillingProfile. */ +public final class PaymentMethodsListByBillingProfileSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodAtBillingProfile_List.json + */ + /** + * Sample code: PaymentMethodsListByBillingProfile. + * + * @param manager Entry point to BillingManager. + */ + public static void paymentMethodsListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + manager + .paymentMethods() + .listByBillingProfile( + "00000000-0000-0000-0000-000000000032:00000000-0000-0000-0000-000000000099_2019-05-31", + "ABC1-A1CD-AB1-BP1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByUserSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByUserSamples.java new file mode 100644 index 0000000000000..86bdbcfc2d391 --- /dev/null +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PaymentMethodsListByUserSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.billing.generated; + +/** Samples for PaymentMethods ListByUser. */ +public final class PaymentMethodsListByUserSamples { + /* + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/PaymentMethodOwnedByUser_List.json + */ + /** + * Sample code: ListPaymentMethodOwnedByUser. + * + * @param manager Entry point to BillingManager. + */ + public static void listPaymentMethodOwnedByUser(com.azure.resourcemanager.billing.BillingManager manager) { + manager.paymentMethods().listByUser(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileSamples.java index 0f353855b128b..db9d4b49a2569 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileSamples.java @@ -7,14 +7,14 @@ /** Samples for Policies GetByBillingProfile. */ public final class PoliciesGetByBillingProfileSamples { /* - * 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/2023-04-01/examples/policiesGetByBillingProfile.json */ /** - * Sample code: PolicyByBillingProfile. + * Sample code: policiesGetByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void policyByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { + public static void policiesGetByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { manager .policies() .getByBillingProfileWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerSamples.java index fc4161b1502bd..899102b4490c1 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerSamples.java @@ -7,14 +7,14 @@ /** Samples for Policies GetByCustomer. */ public final class PoliciesGetByCustomerSamples { /* - * 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/2023-04-01/examples/policiesGetByCustomer.json */ /** - * Sample code: PolicyByCustomer. + * Sample code: policiesGetByCustomer. * * @param manager Entry point to BillingManager. */ - public static void policyByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { + public static void policiesGetByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { manager .policies() .getByCustomerWithResponse("{billingAccountName}", "{customerName}", com.azure.core.util.Context.NONE); diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerSamples.java index 6b56cc40b3bef..5e4b47b47ebff 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerSamples.java @@ -10,14 +10,14 @@ /** Samples for Policies UpdateCustomer. */ public final class PoliciesUpdateCustomerSamples { /* - * 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/2023-04-01/examples/policiesPutByCustomer.json */ /** - * Sample code: UpdateCustomer. + * Sample code: policiesPutByCustomer. * * @param manager Entry point to BillingManager. */ - public static void updateCustomer(com.azure.resourcemanager.billing.BillingManager manager) { + public static void policiesPutByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { manager .policies() .updateCustomerWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateSamples.java index 5802fe720763b..7c7c764cdb1dc 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateSamples.java @@ -12,14 +12,14 @@ /** Samples for Policies Update. */ public final class PoliciesUpdateSamples { /* - * 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/2023-04-01/examples/policiesPutByBillingProfile.json */ /** - * Sample code: UpdatePolicy. + * Sample code: policiesPutByBillingProfile. * * @param manager Entry point to BillingManager. */ - public static void updatePolicy(com.azure.resourcemanager.billing.BillingManager manager) { + public static void policiesPutByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { manager .policies() .updateWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsGetSamples.java index 359bef2f46a99..8a97e7761be3e 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsGetSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsGetSamples.java @@ -7,14 +7,14 @@ /** Samples for Products Get. */ public final class ProductsGetSamples { /* - * 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/2023-04-01/examples/productsGet.json */ /** - * Sample code: Product. + * Sample code: productsGet. * * @param manager Entry point to BillingManager. */ - public static void product(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsGet(com.azure.resourcemanager.billing.BillingManager manager) { manager.products().getWithResponse("{billingAccountName}", "{productName}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountSamples.java index 3546c1d56d523..ab8f3b32de2a6 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountSamples.java @@ -7,10 +7,10 @@ /** Samples for Products ListByBillingAccount. */ public final class ProductsListByBillingAccountSamples { /* - * 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/2023-04-01/examples/productsListByBillingAccount.json */ /** - * Sample code: ProductsListByBillingAccount. + * Sample code: productsListByBillingAccount. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileSamples.java index 5819148d00874..5098995d612b8 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileSamples.java @@ -7,10 +7,10 @@ /** Samples for Products ListByBillingProfile. */ public final class ProductsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/productsListByBillingProfile.json */ /** - * Sample code: ProductsListByBillingProfile. + * Sample code: productsListByBillingProfile. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerSamples.java index 48ffc25328156..e8d505b5a1774 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerSamples.java @@ -7,14 +7,14 @@ /** Samples for Products ListByCustomer. */ public final class ProductsListByCustomerSamples { /* - * 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/2023-04-01/examples/productsListByCustomer.json */ /** - * Sample code: ProductsListByInvoiceSection. + * Sample code: productsListByCustomer. * * @param manager Entry point to BillingManager. */ - public static void productsListByInvoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsListByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { manager.products().listByCustomer("{billingAccountName}", "{customerName}", com.azure.core.util.Context.NONE); } } diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionSamples.java index 88f7682f8e864..a9ee9c05a4f23 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionSamples.java @@ -7,10 +7,10 @@ /** Samples for Products ListByInvoiceSection. */ public final class ProductsListByInvoiceSectionSamples { /* - * 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/2023-04-01/examples/productsListByInvoiceSection.json */ /** - * Sample code: ProductsListByInvoiceSection. + * Sample code: productsListByInvoiceSection. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsMoveSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsMoveSamples.java index 8507391eee45b..cabeba70a0635 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsMoveSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsMoveSamples.java @@ -9,14 +9,14 @@ /** Samples for Products Move. */ public final class ProductsMoveSamples { /* - * 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/2023-04-01/examples/productsMove.json */ /** - * Sample code: MoveProduct. + * Sample code: productsMove. * * @param manager Entry point to BillingManager. */ - public static void moveProduct(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsMove(com.azure.resourcemanager.billing.BillingManager manager) { manager .products() .moveWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsUpdateSamples.java index 06f0938148c1e..0d20863985eb0 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsUpdateSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsUpdateSamples.java @@ -10,14 +10,14 @@ /** Samples for Products Update. */ public final class ProductsUpdateSamples { /* - * 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/2023-04-01/examples/productsPatch.json */ /** - * Sample code: UpdateBillingProperty. + * Sample code: productsPatch. * * @param manager Entry point to BillingManager. */ - public static void updateBillingProperty(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsPatch(com.azure.resourcemanager.billing.BillingManager manager) { manager .products() .updateWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsValidateMoveSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsValidateMoveSamples.java index 57017d82538ab..a23aea3dde5ca 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsValidateMoveSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsValidateMoveSamples.java @@ -9,14 +9,14 @@ /** Samples for Products ValidateMove. */ public final class ProductsValidateMoveSamples { /* - * 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/2023-04-01/examples/productsValidateMoveFailure.json */ /** - * Sample code: SubscriptionMoveValidateFailure. + * Sample code: productsValidateMoveFailure. * * @param manager Entry point to BillingManager. */ - public static void subscriptionMoveValidateFailure(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsValidateMoveFailure(com.azure.resourcemanager.billing.BillingManager manager) { manager .products() .validateMoveWithResponse( @@ -29,14 +29,14 @@ public static void subscriptionMoveValidateFailure(com.azure.resourcemanager.bil } /* - * 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/2023-04-01/examples/productsValidateMoveSuccess.json */ /** - * Sample code: SubscriptionMoveValidateSuccess. + * Sample code: productsValidateMoveSuccess. * * @param manager Entry point to BillingManager. */ - public static void subscriptionMoveValidateSuccess(com.azure.resourcemanager.billing.BillingManager manager) { + public static void productsValidateMoveSuccess(com.azure.resourcemanager.billing.BillingManager manager) { manager .products() .validateMoveWithResponse( diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountSamples.java index 4027aed30f878..f39a0eaaecd7a 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountSamples.java @@ -7,10 +7,10 @@ /** Samples for Reservations ListByBillingAccount. */ public final class ReservationsListByBillingAccountSamples { /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.json + * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2023-04-01/examples/reservationsListByBillingAccount.json */ /** - * Sample code: ReservationsListByBillingAccount. + * Sample code: reservationsListByBillingAccount. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileSamples.java index 6b2f3800edd24..7a31f9b1f258f 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileSamples.java @@ -7,10 +7,10 @@ /** Samples for Reservations ListByBillingProfile. */ public final class ReservationsListByBillingProfileSamples { /* - * 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/2023-04-01/examples/reservationsListByBillingProfile.json */ /** - * Sample code: ReservationsListByBillingProfile. + * Sample code: reservationsListByBillingProfile. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceSamples.java index 1e1dc8beed0f4..f2797516f537e 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceSamples.java @@ -7,10 +7,10 @@ /** Samples for Transactions ListByInvoice. */ public final class TransactionsListByInvoiceSamples { /* - * 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/2023-04-01/examples/transactionsListByInvoice.json */ /** - * Sample code: TransactionsListByInvoice. + * Sample code: transactionsListByInvoice. * * @param manager Entry point to BillingManager. */ diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java deleted file mode 100644 index 1f7b74ba75ee8..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AgreementInner; -import com.azure.resourcemanager.billing.models.Participants; -import java.util.Arrays; - -public final class AgreementInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgreementInner model = - BinaryData - .fromString( - "{\"properties\":{\"agreementLink\":\"goo\",\"category\":\"Other\",\"acceptanceMode\":\"ClickToAccept\",\"billingProfileInfo\":{\"billingProfileId\":\"bvleorfmluiqtqzf\",\"billingProfileDisplayName\":\"yvnqqybaryeuay\",\"indirectRelationshipOrganizationName\":\"qabqgzslesjcb\"},\"effectiveDate\":\"2021-02-16T20:00:10Z\",\"expirationDate\":\"2021-04-10T08:53:01Z\",\"participants\":[{\"status\":\"w\",\"statusDate\":\"2021-08-27T00:56:15Z\",\"email\":\"bquwrbehw\"}],\"status\":\"o\"},\"id\":\"buffkmrqemvvhm\",\"name\":\"tdrjfutacoebj\",\"type\":\"ewzcjznmwcp\"}") - .toObject(AgreementInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgreementInner model = new AgreementInner().withParticipants(Arrays.asList(new Participants())); - model = BinaryData.fromObject(model).toObject(AgreementInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java deleted file mode 100644 index 8a6c59713bfb1..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.AgreementListResult; - -public final class AgreementListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgreementListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"agreementLink\":\"ibthostgktstvd\",\"category\":\"MicrosoftCustomerAgreement\",\"acceptanceMode\":\"ESignEmbedded\",\"effectiveDate\":\"2021-03-03T03:15:27Z\",\"expirationDate\":\"2021-06-23T00:26:33Z\",\"participants\":[],\"status\":\"zlhp\"},\"id\":\"odqkdlwwqfb\",\"name\":\"mlkxtrqjfs\",\"type\":\"lmbtxhwgfwsrt\"}],\"nextLink\":\"coezbrhubskh\"}") - .toObject(AgreementListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgreementListResult model = new AgreementListResult(); - model = BinaryData.fromObject(model).toObject(AgreementListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java deleted file mode 100644 index 95388707ed2c5..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AgreementProperties; -import com.azure.resourcemanager.billing.models.Participants; -import java.util.Arrays; - -public final class AgreementPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgreementProperties model = - BinaryData - .fromString( - "{\"agreementLink\":\"uaadraufactkahzo\",\"category\":\"MicrosoftCustomerAgreement\",\"acceptanceMode\":\"ESignOffline\",\"billingProfileInfo\":{\"billingProfileId\":\"xxpshneeku\",\"billingProfileDisplayName\":\"gs\",\"indirectRelationshipOrganizationName\":\"ubkwdle\"},\"effectiveDate\":\"2021-04-28T05:58:57Z\",\"expirationDate\":\"2021-04-26T16:34:12Z\",\"participants\":[{\"status\":\"bazpjuohmi\",\"statusDate\":\"2021-09-21T23:44:56Z\",\"email\":\"norwmduvwpklvx\"},{\"status\":\"ygdxpgpqchis\",\"statusDate\":\"2021-05-26T11:43:30Z\",\"email\":\"nb\"},{\"status\":\"rxgibbd\",\"statusDate\":\"2021-01-14T17:21:41Z\",\"email\":\"nfo\"},{\"status\":\"uors\",\"statusDate\":\"2021-10-18T05:02:18Z\",\"email\":\"wbqpl\"}],\"status\":\"vnuuepzl\"}") - .toObject(AgreementProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgreementProperties model = - new AgreementProperties() - .withParticipants( - Arrays.asList(new Participants(), new Participants(), new Participants(), new Participants())); - model = BinaryData.fromObject(model).toObject(AgreementProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java deleted file mode 100644 index 624664dfc5920..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Agreement; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AgreementsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"agreementLink\":\"eaoqaqbzgyhf\",\"category\":\"Other\",\"acceptanceMode\":\"ClickToAccept\",\"billingProfileInfo\":{\"billingProfileId\":\"wbqamteuliy\",\"billingProfileDisplayName\":\"pkcvmwf\",\"indirectRelationshipOrganizationName\":\"xxe\"},\"effectiveDate\":\"2021-08-01T10:31:28Z\",\"expirationDate\":\"2021-11-27T08:01:10Z\",\"participants\":[],\"status\":\"c\"},\"id\":\"miciij\",\"name\":\"pkzfbojxj\",\"type\":\"cs\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Agreement response = - manager.agreements().getWithResponse("zjd", "r", "jb", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java deleted file mode 100644 index 6597fe543582d..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Agreement; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AgreementsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"agreementLink\":\"gttmvmmagoaqyl\",\"category\":\"MicrosoftCustomerAgreement\",\"acceptanceMode\":\"ClickToAccept\",\"billingProfileInfo\":{\"billingProfileId\":\"azjcgmxitpfin\",\"billingProfileDisplayName\":\"pdltkrlg\",\"indirectRelationshipOrganizationName\":\"tbdrvcqgue\"},\"effectiveDate\":\"2021-05-18T02:25:41Z\",\"expirationDate\":\"2021-08-13T12:33:46Z\",\"participants\":[],\"status\":\"qdurelyujlfyoum\"},\"id\":\"ckyeclcdigpta\",\"name\":\"brzmqxucycijoclx\",\"type\":\"utgjcyz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.agreements().listByBillingAccount("aderzmw", "t", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java deleted file mode 100644 index e5b9eef51ad96..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Amount; -import org.junit.jupiter.api.Assertions; - -public final class AmountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Amount model = BinaryData.fromString("{\"currency\":\"rbpizc\",\"value\":87.63677}").toObject(Amount.class); - Assertions.assertEquals(87.63677F, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Amount model = new Amount().withValue(87.63677F); - model = BinaryData.fromObject(model).toObject(Amount.class); - Assertions.assertEquals(87.63677F, model.value()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java deleted file mode 100644 index 7484a233d57c3..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; - -public final class AvailableBalanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableBalanceInner model = - BinaryData - .fromString( - "{\"properties\":{\"amount\":{\"currency\":\"kouknvudwtiu\",\"value\":51.070255}},\"id\":\"dng\",\"name\":\"pocipazyxoegu\",\"type\":\"g\"}") - .toObject(AvailableBalanceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableBalanceInner model = new AvailableBalanceInner(); - model = BinaryData.fromObject(model).toObject(AvailableBalanceInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java deleted file mode 100644 index fdffcb712d864..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceProperties; - -public final class AvailableBalancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableBalanceProperties model = - BinaryData - .fromString("{\"amount\":{\"currency\":\"iucgygevqzn\",\"value\":13.069307}}") - .toObject(AvailableBalanceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableBalanceProperties model = new AvailableBalanceProperties(); - model = BinaryData.fromObject(model).toObject(AvailableBalanceProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java deleted file mode 100644 index cd3761316bd0a..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AvailableBalance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AvailableBalancesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"amount\":{\"currency\":\"x\",\"value\":73.497665}},\"id\":\"lc\",\"name\":\"xwmdboxd\",\"type\":\"gsftufqobrjlnacg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AvailableBalance response = - manager.availableBalances().getWithResponse("es", "kdlpa", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java deleted file mode 100644 index 1a38d2eb37a2f..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.AzurePlan; -import org.junit.jupiter.api.Assertions; - -public final class AzurePlanTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzurePlan model = - BinaryData.fromString("{\"skuId\":\"hocdgeab\",\"skuDescription\":\"phut\"}").toObject(AzurePlan.class); - Assertions.assertEquals("hocdgeab", model.skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzurePlan model = new AzurePlan().withSkuId("hocdgeab"); - model = BinaryData.fromObject(model).toObject(AzurePlan.class); - Assertions.assertEquals("hocdgeab", model.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java deleted file mode 100644 index a0963b249e06e..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingAccountListResult; - -public final class BillingAccountListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingAccountListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"uv\",\"agreementType\":\"MicrosoftPartnerAgreement\",\"accountType\":\"Individual\",\"accountStatus\":\"Extended\",\"departments\":[],\"enrollmentAccounts\":[],\"hasReadAccess\":true,\"notificationEmailAddress\":\"pbsphrupidgs\"},\"id\":\"bb\",\"name\":\"jhphoyc\",\"type\":\"sx\"},{\"properties\":{\"displayName\":\"hdxbmtqio\",\"agreementType\":\"EnterpriseAgreement\",\"accountType\":\"Individual\",\"accountStatus\":\"Expired\",\"departments\":[],\"enrollmentAccounts\":[],\"hasReadAccess\":false,\"notificationEmailAddress\":\"izhwlrxy\"},\"id\":\"qsoqijgkd\",\"name\":\"bpazlobcufpdzn\",\"type\":\"btcqq\"},{\"properties\":{\"displayName\":\"glhqg\",\"agreementType\":\"MicrosoftOnlineServicesProgram\",\"accountType\":\"Individual\",\"accountStatus\":\"Active\",\"departments\":[],\"enrollmentAccounts\":[],\"hasReadAccess\":false,\"notificationEmailAddress\":\"aagdfmg\"},\"id\":\"zlhjxrifkwmrvkt\",\"name\":\"izntocipao\",\"type\":\"ajpsquc\"}],\"nextLink\":\"o\"}") - .toObject(BillingAccountListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingAccountListResult model = new BillingAccountListResult(); - model = BinaryData.fromObject(model).toObject(BillingAccountListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java deleted file mode 100644 index 6ec0e98a459db..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; - -public final class BillingPeriodInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPeriodInner model = - BinaryData - .fromString( - "{\"properties\":{\"invoiceIds\":[\"ctxmwoteyowcluq\",\"vekqvgqo\",\"wifzmp\",\"wyivqikf\"]},\"id\":\"cvhrfsp\",\"name\":\"uagrttikteusqc\",\"type\":\"kvyklxubyjaffmm\"}") - .toObject(BillingPeriodInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPeriodInner model = new BillingPeriodInner(); - model = BinaryData.fromObject(model).toObject(BillingPeriodInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java deleted file mode 100644 index 25cc3a72d9fdf..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodProperties; - -public final class BillingPeriodPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPeriodProperties model = - BinaryData - .fromString("{\"invoiceIds\":[\"cuubgq\",\"brta\",\"metttwgd\"]}") - .toObject(BillingPeriodProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPeriodProperties model = new BillingPeriodProperties(); - model = BinaryData.fromObject(model).toObject(BillingPeriodProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java deleted file mode 100644 index f0f0d4b7a9962..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPeriodsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"invoiceIds\":[\"inic\",\"teajohiyg\"]},\"id\":\"pnbonhpcz\",\"name\":\"kmktpvwxqcseh\",\"type\":\"hkhufm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingPeriod response = - manager.billingPeriods().getWithResponse("wugiqjti", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java deleted file mode 100644 index b17ab4dbac9e0..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPeriodsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"invoiceIds\":[\"qlnfw\",\"y\",\"mvqdbpbhfckdvez\",\"rcssbzhddubbnq\"]},\"id\":\"b\",\"name\":\"h\",\"type\":\"alehpav\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPeriods().list("jreuykbbmn", "aglt", 608268235, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java deleted file mode 100644 index 59c70858829ad..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingPeriodsListResult; - -public final class BillingPeriodsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPeriodsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"invoiceIds\":[]},\"id\":\"lcwkhihihlhz\",\"name\":\"sqtzbsrg\",\"type\":\"o\"}],\"nextLink\":\"jhf\"}") - .toObject(BillingPeriodsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPeriodsListResult model = new BillingPeriodsListResult(); - model = BinaryData.fromObject(model).toObject(BillingPeriodsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java deleted file mode 100644 index 9b943318962a8..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"juj\",\"ickpz\",\"cpopmxel\",\"wcltyjede\"],\"notActions\":[\"lfmk\",\"scazuawxtzxpu\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPermissions().listByBillingAccount("zhraglkafh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java deleted file mode 100644 index 9710e57cb5363..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"upeujlzqnhcvsq\"],\"notActions\":[\"zoibgsxg\",\"xfyqonmpqoxwdo\",\"dbxiqx\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPermissions().listByBillingProfile("zcbmqqvxmvwf", "tayx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java deleted file mode 100644 index 78f4e5c013a1c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByCustomerMockTests { - @Test - public void testListByCustomer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"zkzobgopxlhslnel\",\"ieixynllxe\"],\"notActions\":[\"rojphslhcawjutif\",\"wfmvigorqjbt\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPermissions().listByCustomer("dsxwaab", "mifrygznmma", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java deleted file mode 100644 index 4b58796730993..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByInvoiceSectionsMockTests { - @Test - public void testListByInvoiceSections() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"wywa\",\"oi\"],\"notActions\":[\"smjblmljhlnym\",\"otqyry\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingPermissions() - .listByInvoiceSections("mwabzxrvxc", "s", "sphaivmxyasflvg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java deleted file mode 100644 index fcdd9386574f7..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingPermissionsListResult; - -public final class BillingPermissionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPermissionsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"actions\":[\"kphywpnvjto\",\"nermcl\",\"plpho\",\"uscrpabgyepsb\"],\"notActions\":[\"zq\",\"gxywpmue\",\"fjz\",\"fqkquj\"]}],\"nextLink\":\"suyonobglaocq\"}") - .toObject(BillingPermissionsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPermissionsListResult model = new BillingPermissionsListResult(); - model = BinaryData.fromObject(model).toObject(BillingPermissionsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java deleted file mode 100644 index 21fc66c4098cc..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; - -public final class BillingPermissionsPropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPermissionsPropertiesInner model = - BinaryData - .fromString("{\"actions\":[\"cmgyud\"],\"notActions\":[\"lmoyrx\",\"wfudwpzntxhdzhl\"]}") - .toObject(BillingPermissionsPropertiesInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPermissionsPropertiesInner model = new BillingPermissionsPropertiesInner(); - model = BinaryData.fromObject(model).toObject(BillingPermissionsPropertiesInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java deleted file mode 100644 index 74af700e4d95f..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingProfileInfo; -import org.junit.jupiter.api.Assertions; - -public final class BillingProfileInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingProfileInfo model = - BinaryData - .fromString( - "{\"billingProfileId\":\"hw\",\"billingProfileDisplayName\":\"oldweyuqdu\",\"indirectRelationshipOrganizationName\":\"mnnrwr\"}") - .toObject(BillingProfileInfo.class); - Assertions.assertEquals("hw", model.billingProfileId()); - Assertions.assertEquals("oldweyuqdu", model.billingProfileDisplayName()); - Assertions.assertEquals("mnnrwr", model.indirectRelationshipOrganizationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingProfileInfo model = - new BillingProfileInfo() - .withBillingProfileId("hw") - .withBillingProfileDisplayName("oldweyuqdu") - .withIndirectRelationshipOrganizationName("mnnrwr"); - model = BinaryData.fromObject(model).toObject(BillingProfileInfo.class); - Assertions.assertEquals("hw", model.billingProfileId()); - Assertions.assertEquals("oldweyuqdu", model.billingProfileDisplayName()); - Assertions.assertEquals("mnnrwr", model.indirectRelationshipOrganizationName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java deleted file mode 100644 index fded7fada716f..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; -import org.junit.jupiter.api.Assertions; - -public final class BillingRoleAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleAssignmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"createdOn\":\"ithtywu\",\"createdByPrincipalTenantId\":\"cbihwqk\",\"createdByPrincipalId\":\"dntwjchrdgo\",\"createdByUserEmailAddress\":\"xum\",\"principalId\":\"ton\",\"principalTenantId\":\"jl\",\"roleDefinitionId\":\"dfdlwggyts\",\"scope\":\"tov\",\"userAuthenticationType\":\"gseinq\",\"userEmailAddress\":\"ufxqknpirgnepttw\"},\"id\":\"msniffc\",\"name\":\"mqnrojlpijnkr\",\"type\":\"frddhcrati\"}") - .toObject(BillingRoleAssignmentInner.class); - Assertions.assertEquals("ton", model.principalId()); - Assertions.assertEquals("jl", model.principalTenantId()); - Assertions.assertEquals("dfdlwggyts", model.roleDefinitionId()); - Assertions.assertEquals("gseinq", model.userAuthenticationType()); - Assertions.assertEquals("ufxqknpirgnepttw", model.userEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleAssignmentInner model = - new BillingRoleAssignmentInner() - .withPrincipalId("ton") - .withPrincipalTenantId("jl") - .withRoleDefinitionId("dfdlwggyts") - .withUserAuthenticationType("gseinq") - .withUserEmailAddress("ufxqknpirgnepttw"); - model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentInner.class); - Assertions.assertEquals("ton", model.principalId()); - Assertions.assertEquals("jl", model.principalTenantId()); - Assertions.assertEquals("dfdlwggyts", model.roleDefinitionId()); - Assertions.assertEquals("gseinq", model.userAuthenticationType()); - Assertions.assertEquals("ufxqknpirgnepttw", model.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java deleted file mode 100644 index a511766746b16..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingRoleAssignmentListResult; - -public final class BillingRoleAssignmentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleAssignmentListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"createdOn\":\"gikyzirtx\",\"createdByPrincipalTenantId\":\"uxzejntpsew\",\"createdByPrincipalId\":\"oi\",\"createdByUserEmailAddress\":\"ukry\",\"principalId\":\"tqmieox\",\"principalTenantId\":\"ggufhyaomtb\",\"roleDefinitionId\":\"havgrvk\",\"scope\":\"ovjzhpjbibgjmfx\",\"userAuthenticationType\":\"vfcluyovwxnbkfe\",\"userEmailAddress\":\"xscyhwzdgirujbz\"},\"id\":\"omvzzbtd\",\"name\":\"qvpn\",\"type\":\"yujviylwdshfssn\"},{\"properties\":{\"createdOn\":\"ye\",\"createdByPrincipalTenantId\":\"ymsgaojfmwnc\",\"createdByPrincipalId\":\"mrfhirctymox\",\"createdByUserEmailAddress\":\"tpipiwyczuhx\",\"principalId\":\"pqjlihhyusps\",\"principalTenantId\":\"sdvlmfwdgzxulucv\",\"roleDefinitionId\":\"mrsreuzvxurisjnh\",\"scope\":\"txifqj\",\"userAuthenticationType\":\"xmrhu\",\"userEmailAddress\":\"wp\"},\"id\":\"esutrgjupauutpw\",\"name\":\"qhih\",\"type\":\"jqgwzp\"},{\"properties\":{\"createdOn\":\"n\",\"createdByPrincipalTenantId\":\"ypsxjvfoim\",\"createdByPrincipalId\":\"slirciz\",\"createdByUserEmailAddress\":\"vydfceacvlhvygdy\",\"principalId\":\"umrtwnawjsl\",\"principalTenantId\":\"wkojgcyztsfmzn\",\"roleDefinitionId\":\"eqphchqnrnr\",\"scope\":\"ehuwrykqgaifmvik\",\"userAuthenticationType\":\"ydv\",\"userEmailAddress\":\"bejdznxcv\"},\"id\":\"srhnjivo\",\"name\":\"v\",\"type\":\"novqfzge\"},{\"properties\":{\"createdOn\":\"ftul\",\"createdByPrincipalTenantId\":\"tduceamt\",\"createdByPrincipalId\":\"zuo\",\"createdByUserEmailAddress\":\"jw\",\"principalId\":\"wqiok\",\"principalTenantId\":\"sx\",\"roleDefinitionId\":\"jmsvpkjp\",\"scope\":\"kwcf\",\"userAuthenticationType\":\"ljyxgtczhe\",\"userEmailAddress\":\"bsdshmkxmaehvbbx\"},\"id\":\"ripltf\",\"name\":\"htba\",\"type\":\"kgxywr\"}],\"nextLink\":\"pyklyhpluodpvru\"}") - .toObject(BillingRoleAssignmentListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleAssignmentListResult model = new BillingRoleAssignmentListResult(); - model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java deleted file mode 100644 index 1e32f048ccb43..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentProperties; -import org.junit.jupiter.api.Assertions; - -public final class BillingRoleAssignmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleAssignmentProperties model = - BinaryData - .fromString( - "{\"createdOn\":\"ronasxift\",\"createdByPrincipalTenantId\":\"qyzhf\",\"createdByPrincipalId\":\"esgogc\",\"createdByUserEmailAddress\":\"onnxkrlgnyhm\",\"principalId\":\"sxkkg\",\"principalTenantId\":\"rrghxjbdhqxvcxgf\",\"roleDefinitionId\":\"dsofbshrns\",\"scope\":\"uswdv\",\"userAuthenticationType\":\"ybycnunvj\",\"userEmailAddress\":\"tkfa\"}") - .toObject(BillingRoleAssignmentProperties.class); - Assertions.assertEquals("sxkkg", model.principalId()); - Assertions.assertEquals("rrghxjbdhqxvcxgf", model.principalTenantId()); - Assertions.assertEquals("dsofbshrns", model.roleDefinitionId()); - Assertions.assertEquals("ybycnunvj", model.userAuthenticationType()); - Assertions.assertEquals("tkfa", model.userEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleAssignmentProperties model = - new BillingRoleAssignmentProperties() - .withPrincipalId("sxkkg") - .withPrincipalTenantId("rrghxjbdhqxvcxgf") - .withRoleDefinitionId("dsofbshrns") - .withUserAuthenticationType("ybycnunvj") - .withUserEmailAddress("tkfa"); - model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentProperties.class); - Assertions.assertEquals("sxkkg", model.principalId()); - Assertions.assertEquals("rrghxjbdhqxvcxgf", model.principalTenantId()); - Assertions.assertEquals("dsofbshrns", model.roleDefinitionId()); - Assertions.assertEquals("ybycnunvj", model.userAuthenticationType()); - Assertions.assertEquals("tkfa", model.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java deleted file mode 100644 index 18b71c4483e6b..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests { - @Test - public void testDeleteByBillingAccountWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"jmvqmtd\",\"createdByPrincipalTenantId\":\"kygroejnndljdj\",\"createdByPrincipalId\":\"kb\",\"createdByUserEmailAddress\":\"eqy\",\"principalId\":\"ceysfaqeg\",\"principalTenantId\":\"wryshwd\",\"roleDefinitionId\":\"vbxgkqusyb\",\"scope\":\"tdacarvvlfn\",\"userAuthenticationType\":\"mt\",\"userEmailAddress\":\"iwenazero\"},\"id\":\"zrsq\",\"name\":\"lsxkd\",\"type\":\"wqapfgsdp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .deleteByBillingAccountWithResponse("zcbyfq", "kfaoytehq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ceysfaqeg", response.principalId()); - Assertions.assertEquals("wryshwd", response.principalTenantId()); - Assertions.assertEquals("vbxgkqusyb", response.roleDefinitionId()); - Assertions.assertEquals("mt", response.userAuthenticationType()); - Assertions.assertEquals("iwenazero", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java deleted file mode 100644 index 40f4f3b7af327..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests { - @Test - public void testDeleteByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"mtggmu\",\"createdByPrincipalTenantId\":\"ch\",\"createdByPrincipalId\":\"fnkf\",\"createdByUserEmailAddress\":\"lv\",\"principalId\":\"oakizvoai\",\"principalTenantId\":\"a\",\"roleDefinitionId\":\"nuwiguyxlykwph\",\"scope\":\"zc\",\"userAuthenticationType\":\"hmpejtlkexaonw\",\"userEmailAddress\":\"kcq\"},\"id\":\"rxhxkn\",\"name\":\"ccrmmk\",\"type\":\"upijubyqjfkakfq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .deleteByBillingProfileWithResponse( - "pqigtuujwouhd", "wsigrbjbxsj", "bvitvqkjya", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("oakizvoai", response.principalId()); - Assertions.assertEquals("a", response.principalTenantId()); - Assertions.assertEquals("nuwiguyxlykwph", response.roleDefinitionId()); - Assertions.assertEquals("hmpejtlkexaonw", response.userAuthenticationType()); - Assertions.assertEquals("kcq", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java deleted file mode 100644 index d3e7fb23ab8c7..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests { - @Test - public void testDeleteByInvoiceSectionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"kpeeksnbksdqhj\",\"createdByPrincipalTenantId\":\"klxesl\",\"createdByPrincipalId\":\"hustcpoqmavnwqjw\",\"createdByUserEmailAddress\":\"knlejjjkxybwfd\",\"principalId\":\"jbzten\",\"principalTenantId\":\"kzykjtjk\",\"roleDefinitionId\":\"xfwush\",\"scope\":\"pkupnq\",\"userAuthenticationType\":\"gjfbpkuwxeoi\",\"userEmailAddress\":\"fiz\"},\"id\":\"av\",\"name\":\"jzwfb\",\"type\":\"yay\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .deleteByInvoiceSectionWithResponse( - "jsaqwotmmwllcols", "sxap", "efh", "xcgjokjljnhvlq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("jbzten", response.principalId()); - Assertions.assertEquals("kzykjtjk", response.principalTenantId()); - Assertions.assertEquals("xfwush", response.roleDefinitionId()); - Assertions.assertEquals("gjfbpkuwxeoi", response.userAuthenticationType()); - Assertions.assertEquals("fiz", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java deleted file mode 100644 index a34cf3a681c13..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests { - @Test - public void testGetByBillingAccountWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"tptnuwjtk\",\"createdByPrincipalTenantId\":\"h\",\"createdByPrincipalId\":\"gqy\",\"createdByUserEmailAddress\":\"eseyqr\",\"principalId\":\"y\",\"principalTenantId\":\"dotjvdk\",\"roleDefinitionId\":\"swskuk\",\"scope\":\"asbvw\",\"userAuthenticationType\":\"pkxkdtxfk\",\"userEmailAddress\":\"lq\"},\"id\":\"twknvgm\",\"name\":\"bugtywatmqa\",\"type\":\"kueatgroeshoy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .getByBillingAccountWithResponse("zffovwmbjl", "qsczpgvdwnapfdqw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("y", response.principalId()); - Assertions.assertEquals("dotjvdk", response.principalTenantId()); - Assertions.assertEquals("swskuk", response.roleDefinitionId()); - Assertions.assertEquals("pkxkdtxfk", response.userAuthenticationType()); - Assertions.assertEquals("lq", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java deleted file mode 100644 index cd442c83b2655..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests { - @Test - public void testGetByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"wsrsxkrplbja\",\"createdByPrincipalTenantId\":\"jwwviy\",\"createdByPrincipalId\":\"ps\",\"createdByUserEmailAddress\":\"brnnhjxsqw\",\"principalId\":\"qkbiwet\",\"principalTenantId\":\"zycyqiqyhg\",\"roleDefinitionId\":\"etzlexbsfledynoj\",\"scope\":\"iuwfbzkkdtnhqsy\",\"userAuthenticationType\":\"jselpkpbafvafh\",\"userEmailAddress\":\"ylcc\"},\"id\":\"evxrhyz\",\"name\":\"fwrsofpltdbmair\",\"type\":\"hvhfnracw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .getByBillingProfileWithResponse("mmfz", "bfw", "rzx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qkbiwet", response.principalId()); - Assertions.assertEquals("zycyqiqyhg", response.principalTenantId()); - Assertions.assertEquals("etzlexbsfledynoj", response.roleDefinitionId()); - Assertions.assertEquals("jselpkpbafvafh", response.userAuthenticationType()); - Assertions.assertEquals("ylcc", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java deleted file mode 100644 index e8c9979996e10..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests { - @Test - public void testGetByInvoiceSectionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"htjqvqyvw\",\"createdByPrincipalTenantId\":\"tae\",\"createdByPrincipalId\":\"hzzysevusxiv\",\"createdByUserEmailAddress\":\"rryveimipskdy\",\"principalId\":\"tv\",\"principalTenantId\":\"zkaftjvvrux\",\"roleDefinitionId\":\"gsyeipqdsmjtg\",\"scope\":\"gdgkki\",\"userAuthenticationType\":\"plkcsm\",\"userEmailAddress\":\"hwtbbaedorvvm\"},\"id\":\"floygbdgwumg\",\"name\":\"dgdhpabgdexj\",\"type\":\"d\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .getByInvoiceSectionWithResponse("vessm", "hhkuuip", "dqq", "tekva", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tv", response.principalId()); - Assertions.assertEquals("zkaftjvvrux", response.principalTenantId()); - Assertions.assertEquals("gsyeipqdsmjtg", response.roleDefinitionId()); - Assertions.assertEquals("plkcsm", response.userAuthenticationType()); - Assertions.assertEquals("hwtbbaedorvvm", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java deleted file mode 100644 index acd69f58f245a..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdOn\":\"ldudxjascowv\",\"createdByPrincipalTenantId\":\"jkpdxphlkksnm\",\"createdByPrincipalId\":\"vyfijdkzuqnw\",\"createdByUserEmailAddress\":\"thuqolyahluq\",\"principalId\":\"ulsutrjbhxy\",\"principalTenantId\":\"hyqezvqq\",\"roleDefinitionId\":\"drftbcvexreuquo\",\"scope\":\"ljvfwhreagk\",\"userAuthenticationType\":\"xv\",\"userEmailAddress\":\"tvbczsulm\"},\"id\":\"gglmepjpfsey\",\"name\":\"g\",\"type\":\"angpszngafpgyl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingRoleAssignments().listByBillingAccount("rke", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ulsutrjbhxy", response.iterator().next().principalId()); - Assertions.assertEquals("hyqezvqq", response.iterator().next().principalTenantId()); - Assertions.assertEquals("drftbcvexreuquo", response.iterator().next().roleDefinitionId()); - Assertions.assertEquals("xv", response.iterator().next().userAuthenticationType()); - Assertions.assertEquals("tvbczsulm", response.iterator().next().userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java deleted file mode 100644 index 4972f2e26b11d..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdOn\":\"iilialwc\",\"createdByPrincipalTenantId\":\"ckbbcc\",\"createdByPrincipalId\":\"zpraoxn\",\"createdByUserEmailAddress\":\"ffatsgftipw\",\"principalId\":\"byubhiqdxyurnpn\",\"principalTenantId\":\"zafccnuhiigb\",\"roleDefinitionId\":\"bui\",\"scope\":\"xvatvcr\",\"userAuthenticationType\":\"lbnb\",\"userEmailAddress\":\"vhcs\"},\"id\":\"hzlwxaea\",\"name\":\"vurex\",\"type\":\"ndsbdw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingRoleAssignments().listByBillingProfile("erppt", "bgqnz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("byubhiqdxyurnpn", response.iterator().next().principalId()); - Assertions.assertEquals("zafccnuhiigb", response.iterator().next().principalTenantId()); - Assertions.assertEquals("bui", response.iterator().next().roleDefinitionId()); - Assertions.assertEquals("lbnb", response.iterator().next().userAuthenticationType()); - Assertions.assertEquals("vhcs", response.iterator().next().userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java deleted file mode 100644 index fb6464e73fd08..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdOn\":\"jfoknubnoitpkp\",\"createdByPrincipalTenantId\":\"rgdg\",\"createdByPrincipalId\":\"coqra\",\"createdByUserEmailAddress\":\"ugyxpqit\",\"principalId\":\"ialwv\",\"principalTenantId\":\"buhzacaq\",\"roleDefinitionId\":\"ltcoqc\",\"scope\":\"pdsxzakuejkm\",\"userAuthenticationType\":\"iztjof\",\"userEmailAddress\":\"vovjufycsjmlbe\"},\"id\":\"yeji\",\"name\":\"iuxegth\",\"type\":\"rtudawlpjfel\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingRoleAssignments() - .listByInvoiceSection("vecjujcn", "oady", "dm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ialwv", response.iterator().next().principalId()); - Assertions.assertEquals("buhzacaq", response.iterator().next().principalTenantId()); - Assertions.assertEquals("ltcoqc", response.iterator().next().roleDefinitionId()); - Assertions.assertEquals("iztjof", response.iterator().next().userAuthenticationType()); - Assertions.assertEquals("vovjufycsjmlbe", response.iterator().next().userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java deleted file mode 100644 index 2fce25917723c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; -import java.util.Arrays; - -public final class BillingRoleDefinitionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleDefinitionInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"afxtsgum\",\"permissions\":[{\"actions\":[],\"notActions\":[]},{\"actions\":[],\"notActions\":[]},{\"actions\":[],\"notActions\":[]}],\"roleName\":\"lo\"},\"id\":\"bq\",\"name\":\"vuzlm\",\"type\":\"felfktg\"}") - .toObject(BillingRoleDefinitionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleDefinitionInner model = - new BillingRoleDefinitionInner() - .withPermissions( - Arrays - .asList( - new BillingPermissionsPropertiesInner(), - new BillingPermissionsPropertiesInner(), - new BillingPermissionsPropertiesInner())); - model = BinaryData.fromObject(model).toObject(BillingRoleDefinitionInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java deleted file mode 100644 index 725456c5ea18d..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingRoleDefinitionListResult; - -public final class BillingRoleDefinitionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleDefinitionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"phvwauyqncygu\",\"permissions\":[],\"roleName\":\"ipmdscwx\"},\"id\":\"upev\",\"name\":\"hfstotxhojujbyp\",\"type\":\"lmcuvhixb\"},{\"properties\":{\"description\":\"fw\",\"permissions\":[],\"roleName\":\"r\"},\"id\":\"ool\",\"name\":\"ttpkiwkkbnujrywv\",\"type\":\"y\"}],\"nextLink\":\"fpncurdo\"}") - .toObject(BillingRoleDefinitionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleDefinitionListResult model = new BillingRoleDefinitionListResult(); - model = BinaryData.fromObject(model).toObject(BillingRoleDefinitionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java deleted file mode 100644 index 55a08efccb0d3..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionProperties; -import java.util.Arrays; - -public final class BillingRoleDefinitionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleDefinitionProperties model = - BinaryData - .fromString( - "{\"description\":\"crpw\",\"permissions\":[{\"actions\":[\"oi\",\"brnjwmw\",\"pn\"],\"notActions\":[\"zejjoqk\"]},{\"actions\":[\"hsxttaugzxnf\",\"azpxdtnkdmkqjjl\",\"uenvrkp\"],\"notActions\":[\"aibrebqaaysjkixq\",\"nqttezl\",\"fffiak\",\"jpqqmted\"]}],\"roleName\":\"mmji\"}") - .toObject(BillingRoleDefinitionProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleDefinitionProperties model = - new BillingRoleDefinitionProperties() - .withPermissions( - Arrays.asList(new BillingPermissionsPropertiesInner(), new BillingPermissionsPropertiesInner())); - model = BinaryData.fromObject(model).toObject(BillingRoleDefinitionProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java deleted file mode 100644 index b9c07cb1f7848..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests { - @Test - public void testGetByBillingAccountWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"ohapqinfsz\",\"permissions\":[],\"roleName\":\"qdhmrjzralcxpjby\"},\"id\":\"psjoqcjenk\",\"name\":\"hf\",\"type\":\"zv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleDefinition response = - manager - .billingRoleDefinitions() - .getByBillingAccountWithResponse("zqro", "tjzcfyjzpt", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java deleted file mode 100644 index 4686844917b05..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests { - @Test - public void testGetByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"bklqpxz\",\"permissions\":[],\"roleName\":\"e\"},\"id\":\"dwwnl\",\"name\":\"a\",\"type\":\"wxudgn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleDefinition response = - manager - .billingRoleDefinitions() - .getByBillingProfileWithResponse( - "fwxzutg", "ztwhghmupg", "yjtcdxabbujftab", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java deleted file mode 100644 index 2cd34bcb3acc0..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests { - @Test - public void testGetByInvoiceSectionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"s\",\"permissions\":[],\"roleName\":\"jszlb\"},\"id\":\"cmnlzijiufehg\",\"name\":\"vflnwyvqkxrerln\",\"type\":\"ylyl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleDefinition response = - manager - .billingRoleDefinitions() - .getByInvoiceSectionWithResponse( - "qxfx", "elgcmpzqjhhhqx", "w", "vcacoyv", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java deleted file mode 100644 index d6d0536e7de75..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"bemeluclvd\",\"permissions\":[],\"roleName\":\"yrdnqod\"},\"id\":\"ahhxhqfaqnvzoqg\",\"name\":\"ipemchgavscz\",\"type\":\"ejdtxptl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingRoleDefinitions().listByBillingAccount("gookrtalvnb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java deleted file mode 100644 index 27990a33c91dd..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"us\",\"permissions\":[],\"roleName\":\"u\"},\"id\":\"ioycbl\",\"name\":\"vpmclujyxkyxlz\",\"type\":\"sjgkzzltafh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingRoleDefinitions() - .listByBillingProfile("dbrxmrgc", "bapxkiyfjjkb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java deleted file mode 100644 index d775f656d3e43..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"odrrslblxyd\",\"permissions\":[],\"roleName\":\"vvbxiwkgfbqljnq\"},\"id\":\"hychocokuleh\",\"name\":\"rqlrqffawe\",\"type\":\"urkphyjdxravju\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingRoleDefinitions() - .listByInvoiceSection("h", "zhomewjjstliu", "qawmoaianc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java deleted file mode 100644 index 3acee0e2615ef..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import org.junit.jupiter.api.Assertions; - -public final class BillingSubscriptionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingSubscriptionInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"pvgqzcjrvxdjzlm\",\"subscriptionId\":\"2b1ddf07-345e-4104-89d5-47cf0f0744f9\",\"subscriptionBillingStatus\":\"Warning\",\"lastMonthCharges\":{\"currency\":\"gfhzovawjvzunlut\",\"value\":1.0469615},\"monthToDateCharges\":{\"currency\":\"nxipeil\",\"value\":42.357708},\"billingProfileId\":\"aejxd\",\"billingProfileDisplayName\":\"tskzbbtdzumveek\",\"costCenter\":\"wozuhkf\",\"customerId\":\"sjyofdx\",\"customerDisplayName\":\"us\",\"invoiceSectionId\":\"touwaboekqv\",\"invoiceSectionDisplayName\":\"lns\",\"reseller\":{\"resellerId\":\"xwyjsflhhc\",\"description\":\"lnjixisxya\"},\"skuId\":\"oyaqcslyjpkiid\",\"skuDescription\":\"exznelixhnr\",\"suspensionReasons\":[\"o\",\"hb\",\"xknalaulppg\"]},\"id\":\"dtpnapnyiropuhp\",\"name\":\"gvpgy\",\"type\":\"gqgitxmedjvcsl\"}") - .toObject(BillingSubscriptionInner.class); - Assertions.assertEquals(BillingSubscriptionStatusType.WARNING, model.subscriptionBillingStatus()); - Assertions.assertEquals("wozuhkf", model.costCenter()); - Assertions.assertEquals("oyaqcslyjpkiid", model.skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingSubscriptionInner model = - new BillingSubscriptionInner() - .withSubscriptionBillingStatus(BillingSubscriptionStatusType.WARNING) - .withCostCenter("wozuhkf") - .withSkuId("oyaqcslyjpkiid"); - model = BinaryData.fromObject(model).toObject(BillingSubscriptionInner.class); - Assertions.assertEquals(BillingSubscriptionStatusType.WARNING, model.subscriptionBillingStatus()); - Assertions.assertEquals("wozuhkf", model.costCenter()); - Assertions.assertEquals("oyaqcslyjpkiid", model.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java deleted file mode 100644 index 5d16bdc6bc4b8..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionProperties; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import org.junit.jupiter.api.Assertions; - -public final class BillingSubscriptionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingSubscriptionProperties model = - BinaryData - .fromString( - "{\"displayName\":\"qwwncw\",\"subscriptionId\":\"0b14bc39-5e00-4eb5-b288-987d4dfc4e21\",\"subscriptionBillingStatus\":\"Deleted\",\"lastMonthCharges\":{\"currency\":\"trmgucnapkte\",\"value\":45.423527},\"monthToDateCharges\":{\"currency\":\"pt\",\"value\":32.62289},\"billingProfileId\":\"pfqbuaceopzf\",\"billingProfileDisplayName\":\"hhuao\",\"costCenter\":\"pcqeqx\",\"customerId\":\"z\",\"customerDisplayName\":\"hzxct\",\"invoiceSectionId\":\"gbkdmoizpos\",\"invoiceSectionDisplayName\":\"grcfb\",\"reseller\":{\"resellerId\":\"mfqjhhkxbp\",\"description\":\"ymjhxxjyngudivkr\"},\"skuId\":\"wbxqzvszjfau\",\"skuDescription\":\"fdxxivetvtcqaqtd\",\"suspensionReasons\":[\"cbxvwvxyslqbh\",\"fxoblytkb\",\"mpew\"]}") - .toObject(BillingSubscriptionProperties.class); - Assertions.assertEquals(BillingSubscriptionStatusType.DELETED, model.subscriptionBillingStatus()); - Assertions.assertEquals("pcqeqx", model.costCenter()); - Assertions.assertEquals("wbxqzvszjfau", model.skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingSubscriptionProperties model = - new BillingSubscriptionProperties() - .withSubscriptionBillingStatus(BillingSubscriptionStatusType.DELETED) - .withCostCenter("pcqeqx") - .withSkuId("wbxqzvszjfau"); - model = BinaryData.fromObject(model).toObject(BillingSubscriptionProperties.class); - Assertions.assertEquals(BillingSubscriptionStatusType.DELETED, model.subscriptionBillingStatus()); - Assertions.assertEquals("pcqeqx", model.costCenter()); - Assertions.assertEquals("wbxqzvszjfau", model.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java deleted file mode 100644 index 0a8d784af79ce..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"ctbrxkjzwrgxffm\",\"subscriptionId\":\"2b9128aa-6fd8-48c1-b298-8116567aa8b6\",\"subscriptionBillingStatus\":\"Inactive\",\"lastMonthCharges\":{\"currency\":\"kgozxwop\",\"value\":12.357336},\"monthToDateCharges\":{\"currency\":\"izqaclnapxbiyg\",\"value\":22.492695},\"billingProfileId\":\"knfsmfcttuxuuyil\",\"billingProfileDisplayName\":\"qoiquvrehmrnjhv\",\"costCenter\":\"jztczytqj\",\"customerId\":\"h\",\"customerDisplayName\":\"unfprnjletlxs\",\"invoiceSectionId\":\"pddouifamowaziyn\",\"invoiceSectionDisplayName\":\"lqwzdvpiwhxqsz\",\"reseller\":{\"resellerId\":\"aajquhuxylrj\",\"description\":\"ty\"},\"skuId\":\"bmzyospsps\",\"skuDescription\":\"kfkyjp\",\"suspensionReasons\":[\"bpssdfp\",\"yogtieyujtvczkcn\",\"xrx\"]},\"id\":\"unjdx\",\"name\":\"glnkvxlxpagl\",\"type\":\"ivbgkcv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingSubscription response = - manager.billingSubscriptions().getWithResponse("zvzbglbyv", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(BillingSubscriptionStatusType.INACTIVE, response.subscriptionBillingStatus()); - Assertions.assertEquals("jztczytqj", response.costCenter()); - Assertions.assertEquals("bmzyospsps", response.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java deleted file mode 100644 index f2510d9eec0d0..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"xfe\",\"subscriptionId\":\"f4cbed26-4a2f-4ca0-a4a6-4fbfd837d0b6\",\"subscriptionBillingStatus\":\"Warning\",\"lastMonthCharges\":{\"currency\":\"xfdeqvhpsyl\",\"value\":14.799225},\"monthToDateCharges\":{\"currency\":\"bffmbmxz\",\"value\":50.71973},\"billingProfileId\":\"wwp\",\"billingProfileDisplayName\":\"xs\",\"costCenter\":\"tf\",\"customerId\":\"gicgaaoepttaq\",\"customerDisplayName\":\"dewemxswv\",\"invoiceSectionId\":\"unzzjgehk\",\"invoiceSectionDisplayName\":\"imrt\",\"reseller\":{\"resellerId\":\"kffqyinljqepqwh\",\"description\":\"monstshiyxgve\"},\"skuId\":\"clduc\",\"skuDescription\":\"irdsvuwcob\",\"suspensionReasons\":[\"stmninwjizcilng\",\"gshejjtbxqmulux\",\"xqzv\",\"ers\"]},\"id\":\"ycucrwnamikzeb\",\"name\":\"qbsms\",\"type\":\"ziqgfuh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingSubscriptions().listByBillingAccount("tcmwqkchc", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - BillingSubscriptionStatusType.WARNING, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("tf", response.iterator().next().costCenter()); - Assertions.assertEquals("clduc", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java deleted file mode 100644 index b082a4f0ed760..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"jsxjwwix\",\"subscriptionId\":\"7b7f70e7-479e-4e08-aadc-7a1077abc191\",\"subscriptionBillingStatus\":\"Warning\",\"lastMonthCharges\":{\"currency\":\"xqhndvnoamlds\",\"value\":35.096104},\"monthToDateCharges\":{\"currency\":\"djh\",\"value\":24.296553},\"billingProfileId\":\"okxcoxp\",\"billingProfileDisplayName\":\"nje\",\"costCenter\":\"gltsxoat\",\"customerId\":\"g\",\"customerDisplayName\":\"npbs\",\"invoiceSectionId\":\"e\",\"invoiceSectionDisplayName\":\"occsr\",\"reseller\":{\"resellerId\":\"ihmipgawtxxpk\",\"description\":\"cxcjxgry\"},\"skuId\":\"mpcycilrmcaykgg\",\"skuDescription\":\"xu\",\"suspensionReasons\":[\"ksxwpnd\",\"cpfnznthjtwkja\",\"srxuzvoam\"]},\"id\":\"tcqiosmg\",\"name\":\"zah\",\"type\":\"xqdlyrtltlapr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingSubscriptions().listByBillingProfile("kzruswh", "hczznvf", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - BillingSubscriptionStatusType.WARNING, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("gltsxoat", response.iterator().next().costCenter()); - Assertions.assertEquals("mpcycilrmcaykgg", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java deleted file mode 100644 index 7a8d00b444c89..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByCustomerMockTests { - @Test - public void testListByCustomer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"qpofvwbc\",\"subscriptionId\":\"014c0863-e775-41aa-8863-c42b70db6758\",\"subscriptionBillingStatus\":\"Active\",\"lastMonthCharges\":{\"currency\":\"kbwvqvxkdiv\",\"value\":15.006906},\"monthToDateCharges\":{\"currency\":\"wtswbzuwfmdur\",\"value\":30.223448},\"billingProfileId\":\"izvcjfe\",\"billingProfileDisplayName\":\"sdjubggbqigkxkbs\",\"costCenter\":\"gak\",\"customerId\":\"cyrcmjdmspo\",\"customerDisplayName\":\"pv\",\"invoiceSectionId\":\"rylniofrzg\",\"invoiceSectionDisplayName\":\"jed\",\"reseller\":{\"resellerId\":\"kvnlvxbcuiiznkt\",\"description\":\"ansnvp\"},\"skuId\":\"bmikost\",\"skuDescription\":\"bkiw\",\"suspensionReasons\":[\"n\",\"ophzfylsgcrp\",\"bcunezzceze\"]},\"id\":\"fwyfwlwxjwet\",\"name\":\"psihcla\",\"type\":\"zvaylptrsqqw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingSubscriptions().listByCustomer("iiqbi", "htmwwinh", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals(BillingSubscriptionStatusType.ACTIVE, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("gak", response.iterator().next().costCenter()); - Assertions.assertEquals("bmikost", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java deleted file mode 100644 index a5d107a422e49..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"qalarvlagunbtg\",\"subscriptionId\":\"5c8b1f82-54e3-4784-976b-0399b9cc76f0\",\"subscriptionBillingStatus\":\"Inactive\",\"lastMonthCharges\":{\"currency\":\"bmhyreeudz\",\"value\":93.786156},\"monthToDateCharges\":{\"currency\":\"dqmjxly\",\"value\":29.41463},\"billingProfileId\":\"gouwtlmj\",\"billingProfileDisplayName\":\"uojqt\",\"costCenter\":\"axkjeytunlbfjk\",\"customerId\":\"u\",\"customerDisplayName\":\"kqbh\",\"invoiceSectionId\":\"rqunjq\",\"invoiceSectionDisplayName\":\"enx\",\"reseller\":{\"resellerId\":\"kpak\",\"description\":\"ifmjnn\"},\"skuId\":\"tqabpxuckpgg\",\"skuDescription\":\"wey\",\"suspensionReasons\":[\"hlisngw\",\"lqqmpiz\",\"uwnpqxpxiwfcng\",\"saasiixtmkzj\"]},\"id\":\"kv\",\"name\":\"irhgfgrwsdp\",\"type\":\"ra\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingSubscriptions() - .listByInvoiceSection("tz", "atbhjmznn", "s", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - BillingSubscriptionStatusType.INACTIVE, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("axkjeytunlbfjk", response.iterator().next().costCenter()); - Assertions.assertEquals("tqabpxuckpgg", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java deleted file mode 100644 index 5993ce87d0828..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingSubscriptionsListResult; - -public final class BillingSubscriptionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingSubscriptionsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"ck\",\"subscriptionId\":\"57d84afc-8b50-4f1e-81a9-e9cf06197dda\",\"subscriptionBillingStatus\":\"Warning\",\"billingProfileId\":\"bkyvp\",\"billingProfileDisplayName\":\"anuzbpzkafkuw\",\"costCenter\":\"rnwb\",\"customerId\":\"hhseyv\",\"customerDisplayName\":\"srtslhspkdeem\",\"invoiceSectionId\":\"fm\",\"invoiceSectionDisplayName\":\"gkvtmelmqkrhah\",\"skuId\":\"uahaquhcdhmd\",\"skuDescription\":\"laexqp\",\"suspensionReasons\":[]},\"id\":\"adm\",\"name\":\"sr\",\"type\":\"r\"},{\"properties\":{\"displayName\":\"pv\",\"subscriptionId\":\"bf8b6a2e-e5b5-4b61-aff8-d9ee31509c78\",\"subscriptionBillingStatus\":\"Warning\",\"billingProfileId\":\"isgwbnbbeldawkz\",\"billingProfileDisplayName\":\"liourqhak\",\"costCenter\":\"hashsfwxosow\",\"customerId\":\"cugicjoox\",\"customerDisplayName\":\"ebwpucwwfvo\",\"invoiceSectionId\":\"vmeueci\",\"invoiceSectionDisplayName\":\"hzceuojgjrwjue\",\"skuId\":\"wmcdytdxwi\",\"skuDescription\":\"nrjawgqwg\",\"suspensionReasons\":[]},\"id\":\"ni\",\"name\":\"kxfbkpycgklwndn\",\"type\":\"jdauwhvy\"},{\"properties\":{\"displayName\":\"btdhxujznbm\",\"subscriptionId\":\"ea622ed2-d4f9-469e-9daf-f1e91e5801ed\",\"subscriptionBillingStatus\":\"Abandoned\",\"billingProfileId\":\"zqlveualupjmkhf\",\"billingProfileDisplayName\":\"bbcswsrtjri\",\"costCenter\":\"rbpbewtghfgblcg\",\"customerId\":\"zvlvqhjkbegib\",\"customerDisplayName\":\"mxiebw\",\"invoiceSectionId\":\"loayqcgw\",\"invoiceSectionDisplayName\":\"zjuzgwyz\",\"skuId\":\"xongmtsavjcbpwxq\",\"skuDescription\":\"rknftguvriuhprwm\",\"suspensionReasons\":[]},\"id\":\"vxqtayriwwroyqbe\",\"name\":\"rmcqiby\",\"type\":\"nojvknmefqsg\"}],\"totalCount\":488274582,\"nextLink\":\"apj\"}") - .toObject(BillingSubscriptionsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingSubscriptionsListResult model = new BillingSubscriptionsListResult(); - model = BinaryData.fromObject(model).toObject(BillingSubscriptionsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java deleted file mode 100644 index ee599838fb873..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsMoveMockTests { - @Test - public void testMove() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"ycxhxzgaztta\",\"subscriptionId\":\"d3cdb36f-7903-46a6-b127-4f7fed731bfc\",\"subscriptionBillingStatus\":\"Inactive\",\"lastMonthCharges\":{\"currency\":\"fqhppubowsep\",\"value\":1.4296412},\"monthToDateCharges\":{\"currency\":\"tdherngbtcjuahok\",\"value\":60.235302},\"billingProfileId\":\"kauxof\",\"billingProfileDisplayName\":\"fphwpnu\",\"costCenter\":\"iywzejy\",\"customerId\":\"slwkojpl\",\"customerDisplayName\":\"dnpdwrpqaf\",\"invoiceSectionId\":\"ug\",\"invoiceSectionDisplayName\":\"n\",\"reseller\":{\"resellerId\":\"et\",\"description\":\"ypococtfjgtixr\"},\"skuId\":\"zuyt\",\"skuDescription\":\"mlmuowol\",\"suspensionReasons\":[\"iropionszon\"]},\"id\":\"pngajin\",\"name\":\"ixjawrtm\",\"type\":\"fjmyccxlzhco\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingSubscription response = - manager - .billingSubscriptions() - .move( - "ffifhx", - new TransferBillingSubscriptionRequestProperties() - .withDestinationInvoiceSectionId("rsnewmozqvbubqma"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(BillingSubscriptionStatusType.INACTIVE, response.subscriptionBillingStatus()); - Assertions.assertEquals("iywzejy", response.costCenter()); - Assertions.assertEquals("zuyt", response.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java deleted file mode 100644 index 9aa90fa79e15f..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"nykzcugswvxwlm\",\"subscriptionId\":\"be4a2676-00c5-4065-a604-86209c2a264f\",\"subscriptionBillingStatus\":\"Abandoned\",\"lastMonthCharges\":{\"currency\":\"xnjmxm\",\"value\":51.97202},\"monthToDateCharges\":{\"currency\":\"tcvcl\",\"value\":25.977707},\"billingProfileId\":\"dkvgfabuiyjibuzp\",\"billingProfileDisplayName\":\"ugneikn\",\"costCenter\":\"oxgjiuqhibt\",\"customerId\":\"ipq\",\"customerDisplayName\":\"edmurrxxge\",\"invoiceSectionId\":\"ktvqylkmqpzoy\",\"invoiceSectionDisplayName\":\"fbcgwgcloxoebqin\",\"reseller\":{\"resellerId\":\"nwjfu\",\"description\":\"lafcbahh\"},\"skuId\":\"pofoi\",\"skuDescription\":\"w\",\"suspensionReasons\":[\"lkmkkholvdndvi\",\"uogphuartvtiuky\"]},\"id\":\"fchnmnah\",\"name\":\"nxhkxjqi\",\"type\":\"wrweoo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingSubscription response = - manager - .billingSubscriptions() - .updateWithResponse( - "hpzvuqdflvoniyp", - new BillingSubscriptionInner() - .withSubscriptionBillingStatus(BillingSubscriptionStatusType.INACTIVE) - .withCostCenter("nq") - .withSkuId("lacjfrnxo"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(BillingSubscriptionStatusType.ABANDONED, response.subscriptionBillingStatus()); - Assertions.assertEquals("oxgjiuqhibt", response.costCenter()); - Assertions.assertEquals("pofoi", response.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java deleted file mode 100644 index cdd7a54c9bfed..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerInner; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerInner model = - BinaryData - .fromString( - "{\"properties\":{\"billingProfileId\":\"l\",\"billingProfileDisplayName\":\"kx\",\"displayName\":\"skpbhenbtkcxywn\",\"enabledAzurePlans\":[{\"skuId\":\"synlqidybyxczfc\",\"skuDescription\":\"aaxdbabphlwrq\"}],\"resellers\":[{\"resellerId\":\"sthsu\",\"description\":\"cmnyyazttb\"},{\"resellerId\":\"wrqpue\",\"description\":\"kzywbiex\"},{\"resellerId\":\"eyueaxibxujwb\",\"description\":\"walm\"},{\"resellerId\":\"yoxa\",\"description\":\"dkzjancuxrh\"}]},\"id\":\"wbavxbniwdj\",\"name\":\"wz\",\"type\":\"s\"}") - .toObject(CustomerInner.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.displayName()); - Assertions.assertEquals("synlqidybyxczfc", model.enabledAzurePlans().get(0).skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerInner model = - new CustomerInner() - .withDisplayName("skpbhenbtkcxywn") - .withEnabledAzurePlans(Arrays.asList(new AzurePlan().withSkuId("synlqidybyxczfc"))) - .withResellers(Arrays.asList(new Reseller(), new Reseller(), new Reseller(), new Reseller())); - model = BinaryData.fromObject(model).toObject(CustomerInner.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.displayName()); - Assertions.assertEquals("synlqidybyxczfc", model.enabledAzurePlans().get(0).skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java deleted file mode 100644 index 8ba53626bb2f8..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.CustomerListResult; - -public final class CustomerListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"billingProfileId\":\"kgj\",\"billingProfileDisplayName\":\"yoxgvcltbgsnc\",\"displayName\":\"kjeszz\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"jhtxfvgxbfsmxne\",\"name\":\"mpvecxgodebfqk\",\"type\":\"rbmpukgri\"},{\"properties\":{\"billingProfileId\":\"zlfbxzpuzycispnq\",\"billingProfileDisplayName\":\"hmgkbrpyy\",\"displayName\":\"ibnuqqkpik\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"gvtqagnbuynh\",\"name\":\"jggmebfsiarbu\",\"type\":\"rcvpnazzmhjrunmp\"}],\"totalCount\":18555434,\"nextLink\":\"bh\"}") - .toObject(CustomerListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerListResult model = new CustomerListResult(); - model = BinaryData.fromObject(model).toObject(CustomerListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java deleted file mode 100644 index ee30de207ea84..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.models.ViewCharges; -import org.junit.jupiter.api.Assertions; - -public final class CustomerPolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerPolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"viewCharges\":\"Allowed\"},\"id\":\"blmhvkzuhb\",\"name\":\"vvyhg\",\"type\":\"opbyrqufegxu\"}") - .toObject(CustomerPolicyInner.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerPolicyInner model = new CustomerPolicyInner().withViewCharges(ViewCharges.ALLOWED); - model = BinaryData.fromObject(model).toObject(CustomerPolicyInner.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java deleted file mode 100644 index ad21f446961c0..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyProperties; -import com.azure.resourcemanager.billing.models.ViewCharges; -import org.junit.jupiter.api.Assertions; - -public final class CustomerPolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerPolicyProperties model = - BinaryData.fromString("{\"viewCharges\":\"Allowed\"}").toObject(CustomerPolicyProperties.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerPolicyProperties model = new CustomerPolicyProperties().withViewCharges(ViewCharges.ALLOWED); - model = BinaryData.fromObject(model).toObject(CustomerPolicyProperties.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java deleted file mode 100644 index ae57b85f0fbb0..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerProperties; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerProperties model = - BinaryData - .fromString( - "{\"billingProfileId\":\"pgn\",\"billingProfileDisplayName\":\"txhp\",\"displayName\":\"bzpfzab\",\"enabledAzurePlans\":[{\"skuId\":\"hxw\",\"skuDescription\":\"tyq\"}],\"resellers\":[{\"resellerId\":\"bovpl\",\"description\":\"bhvgy\"},{\"resellerId\":\"uosvmkfssxqukk\",\"description\":\"l\"}]}") - .toObject(CustomerProperties.class); - Assertions.assertEquals("bzpfzab", model.displayName()); - Assertions.assertEquals("hxw", model.enabledAzurePlans().get(0).skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerProperties model = - new CustomerProperties() - .withDisplayName("bzpfzab") - .withEnabledAzurePlans(Arrays.asList(new AzurePlan().withSkuId("hxw"))) - .withResellers(Arrays.asList(new Reseller(), new Reseller())); - model = BinaryData.fromObject(model).toObject(CustomerProperties.class); - Assertions.assertEquals("bzpfzab", model.displayName()); - Assertions.assertEquals("hxw", model.enabledAzurePlans().get(0).skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java deleted file mode 100644 index 1a3aa1ce2c341..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Customer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"billingProfileId\":\"snmfpphojeevy\",\"billingProfileDisplayName\":\"hsgz\",\"displayName\":\"zbgomfgbeg\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"o\",\"name\":\"i\",\"type\":\"etnluankrrfx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Customer response = - manager - .customers() - .getWithResponse("tfnmdx", "tngfdgugeyzihgr", "yui", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zbgomfgbeg", response.displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java deleted file mode 100644 index da483feb0537d..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Customer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomersListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"billingProfileId\":\"aiouaubrjt\",\"billingProfileDisplayName\":\"qxfuojrngif\",\"displayName\":\"z\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"biuimzdlyjdfq\",\"name\":\"mkyoqufdvruzsl\",\"type\":\"ojhp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .customers() - .listByBillingAccount("qbnj", "rcgegydcwboxjum", "qqoli", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("z", response.iterator().next().displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java deleted file mode 100644 index 2c114cfd1861a..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Customer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomersListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"billingProfileId\":\"cxkjibnxmysuxswq\",\"billingProfileDisplayName\":\"tvlwijpsttexoq\",\"displayName\":\"wcyyufmhruncu\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"kcdqzhlct\",\"name\":\"dunqnd\",\"type\":\"fpch\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .customers() - .listByBillingProfile("xzsrzpge", "q", "yb", "wwpgdakchzyvlixq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wcyyufmhruncu", response.iterator().next().displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java deleted file mode 100644 index 4dbe4734eb21c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.DepartmentProperties; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DepartmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DepartmentProperties model = - BinaryData - .fromString( - "{\"departmentName\":\"pg\",\"costCenter\":\"toc\",\"status\":\"xhvpmoue\",\"enrollmentAccounts\":[{\"properties\":{\"accountName\":\"i\",\"costCenter\":\"eojnxqbzvddn\",\"accountOwner\":\"ndei\",\"accountOwnerEmail\":\"twnpzaoqvuhrhcf\",\"status\":\"yd\",\"startDate\":\"2021-01-15T04:12:24Z\",\"endDate\":\"2021-08-14T20:27:10Z\"},\"id\":\"hjq\",\"name\":\"wpyeicxmqciwqvh\",\"type\":\"hix\"},{\"properties\":{\"accountName\":\"dtopbob\",\"costCenter\":\"ghmewuam\",\"accountOwner\":\"hrzayvvtpgvdf\",\"accountOwnerEmail\":\"otkftutqxlngx\",\"status\":\"fgugnxkrxdqmid\",\"startDate\":\"2021-09-08T21:12:41Z\",\"endDate\":\"2021-06-28T04:41:07Z\"},\"id\":\"qdrabhjybigehoqf\",\"name\":\"owskanyktz\",\"type\":\"cuiywgqyw\"},{\"properties\":{\"accountName\":\"rvynhzgpph\",\"costCenter\":\"gyncocpecfvmmc\",\"accountOwner\":\"fsxlzevgbmqjqa\",\"accountOwnerEmail\":\"y\",\"status\":\"ivkwlzuvccfwnfnb\",\"startDate\":\"2021-04-04T07:21:26Z\",\"endDate\":\"2021-04-16T12:59:12Z\"},\"id\":\"l\",\"name\":\"bxetqgtzxdpn\",\"type\":\"bqqwxrj\"},{\"properties\":{\"accountName\":\"llnwsubi\",\"costCenter\":\"jampmngnzscxaqw\",\"accountOwner\":\"chcbonqvpkvlrxnj\",\"accountOwnerEmail\":\"seiphe\",\"status\":\"lokeyy\",\"startDate\":\"2021-09-18T17:01:56Z\",\"endDate\":\"2021-10-04T06:36:31Z\"},\"id\":\"lwtgrhpdj\",\"name\":\"jumasx\",\"type\":\"zj\"}]}") - .toObject(DepartmentProperties.class); - Assertions.assertEquals("pg", model.departmentName()); - Assertions.assertEquals("toc", model.costCenter()); - Assertions.assertEquals("xhvpmoue", model.status()); - Assertions.assertEquals("i", model.enrollmentAccounts().get(0).accountName()); - Assertions.assertEquals("eojnxqbzvddn", model.enrollmentAccounts().get(0).costCenter()); - Assertions.assertEquals("ndei", model.enrollmentAccounts().get(0).accountOwner()); - Assertions.assertEquals("twnpzaoqvuhrhcf", model.enrollmentAccounts().get(0).accountOwnerEmail()); - Assertions.assertEquals("yd", model.enrollmentAccounts().get(0).status()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-15T04:12:24Z"), model.enrollmentAccounts().get(0).startDate()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-08-14T20:27:10Z"), model.enrollmentAccounts().get(0).endDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DepartmentProperties model = - new DepartmentProperties() - .withDepartmentName("pg") - .withCostCenter("toc") - .withStatus("xhvpmoue") - .withEnrollmentAccounts( - Arrays - .asList( - new EnrollmentAccount() - .withAccountName("i") - .withCostCenter("eojnxqbzvddn") - .withAccountOwner("ndei") - .withAccountOwnerEmail("twnpzaoqvuhrhcf") - .withStatus("yd") - .withStartDate(OffsetDateTime.parse("2021-01-15T04:12:24Z")) - .withEndDate(OffsetDateTime.parse("2021-08-14T20:27:10Z")), - new EnrollmentAccount() - .withAccountName("dtopbob") - .withCostCenter("ghmewuam") - .withAccountOwner("hrzayvvtpgvdf") - .withAccountOwnerEmail("otkftutqxlngx") - .withStatus("fgugnxkrxdqmid") - .withStartDate(OffsetDateTime.parse("2021-09-08T21:12:41Z")) - .withEndDate(OffsetDateTime.parse("2021-06-28T04:41:07Z")), - new EnrollmentAccount() - .withAccountName("rvynhzgpph") - .withCostCenter("gyncocpecfvmmc") - .withAccountOwner("fsxlzevgbmqjqa") - .withAccountOwnerEmail("y") - .withStatus("ivkwlzuvccfwnfnb") - .withStartDate(OffsetDateTime.parse("2021-04-04T07:21:26Z")) - .withEndDate(OffsetDateTime.parse("2021-04-16T12:59:12Z")), - new EnrollmentAccount() - .withAccountName("llnwsubi") - .withCostCenter("jampmngnzscxaqw") - .withAccountOwner("chcbonqvpkvlrxnj") - .withAccountOwnerEmail("seiphe") - .withStatus("lokeyy") - .withStartDate(OffsetDateTime.parse("2021-09-18T17:01:56Z")) - .withEndDate(OffsetDateTime.parse("2021-10-04T06:36:31Z")))); - model = BinaryData.fromObject(model).toObject(DepartmentProperties.class); - Assertions.assertEquals("pg", model.departmentName()); - Assertions.assertEquals("toc", model.costCenter()); - Assertions.assertEquals("xhvpmoue", model.status()); - Assertions.assertEquals("i", model.enrollmentAccounts().get(0).accountName()); - Assertions.assertEquals("eojnxqbzvddn", model.enrollmentAccounts().get(0).costCenter()); - Assertions.assertEquals("ndei", model.enrollmentAccounts().get(0).accountOwner()); - Assertions.assertEquals("twnpzaoqvuhrhcf", model.enrollmentAccounts().get(0).accountOwnerEmail()); - Assertions.assertEquals("yd", model.enrollmentAccounts().get(0).status()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-15T04:12:24Z"), model.enrollmentAccounts().get(0).startDate()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-08-14T20:27:10Z"), model.enrollmentAccounts().get(0).endDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java deleted file mode 100644 index 51f7b45d5b2fb..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Department; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DepartmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Department model = - BinaryData - .fromString( - "{\"properties\":{\"departmentName\":\"hhbcsglummajtjao\",\"costCenter\":\"obnbdxkqpxokaj\",\"status\":\"npime\",\"enrollmentAccounts\":[{\"id\":\"xgcp\",\"name\":\"dg\",\"type\":\"aajrm\"},{\"id\":\"jwzrl\",\"name\":\"vmclw\",\"type\":\"ijcoejctb\"}]},\"id\":\"aqsqsycbkbfk\",\"name\":\"ukdkexxppofmxa\",\"type\":\"c\"}") - .toObject(Department.class); - Assertions.assertEquals("hhbcsglummajtjao", model.departmentName()); - Assertions.assertEquals("obnbdxkqpxokaj", model.costCenter()); - Assertions.assertEquals("npime", model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Department model = - new Department() - .withDepartmentName("hhbcsglummajtjao") - .withCostCenter("obnbdxkqpxokaj") - .withStatus("npime") - .withEnrollmentAccounts(Arrays.asList(new EnrollmentAccount(), new EnrollmentAccount())); - model = BinaryData.fromObject(model).toObject(Department.class); - Assertions.assertEquals("hhbcsglummajtjao", model.departmentName()); - Assertions.assertEquals("obnbdxkqpxokaj", model.costCenter()); - Assertions.assertEquals("npime", model.status()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java deleted file mode 100644 index 4beb0e904a489..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Document; - -public final class DocumentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Document model = - BinaryData - .fromString("{\"kind\":\"VoidNote\",\"url\":\"egokdwbwhkszzcmr\",\"source\":\"ENF\"}") - .toObject(Document.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Document model = new Document(); - model = BinaryData.fromObject(model).toObject(Document.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java deleted file mode 100644 index 3f5a837aba0ff..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; - -public final class DownloadUrlInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DownloadUrlInner model = - BinaryData - .fromString("{\"expiryTime\":\"2021-09-27T05:33:50Z\",\"url\":\"grtwae\"}") - .toObject(DownloadUrlInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DownloadUrlInner model = new DownloadUrlInner(); - model = BinaryData.fromObject(model).toObject(DownloadUrlInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java deleted file mode 100644 index a6e7c470c1eab..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.EnrollmentAccountListResult; - -public final class EnrollmentAccountListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"principalName\":\"f\"},\"id\":\"fcjnaeoisrvhmgor\",\"name\":\"fukiscvwmzhw\",\"type\":\"lefaxvxilcbtgn\"},{\"properties\":{\"principalName\":\"eyqxtjjfzql\"},\"id\":\"hycav\",\"name\":\"dggxdbeesmi\",\"type\":\"knlrariaawiuagy\"},{\"properties\":{\"principalName\":\"fbylyrfg\"},\"id\":\"agt\",\"name\":\"ojocqwogf\",\"type\":\"zjvusfzldmo\"}],\"nextLink\":\"xylfsb\"}") - .toObject(EnrollmentAccountListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountListResult model = new EnrollmentAccountListResult(); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java deleted file mode 100644 index 4ab1938bb1157..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountProperties; -import com.azure.resourcemanager.billing.models.Department; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EnrollmentAccountPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountProperties model = - BinaryData - .fromString( - "{\"accountName\":\"dkcglhsl\",\"costCenter\":\"jdyggdtji\",\"accountOwner\":\"b\",\"accountOwnerEmail\":\"ofqweykhmenevfye\",\"status\":\"whybcib\",\"startDate\":\"2021-05-14T16:24:46Z\",\"endDate\":\"2021-01-31T06:13:45Z\",\"department\":{\"properties\":{\"departmentName\":\"ynnaam\",\"costCenter\":\"ctehfiqscjey\",\"status\":\"hezrkgq\",\"enrollmentAccounts\":[]},\"id\":\"refovgmkqsleyyvx\",\"name\":\"qjpkcattpngjcrc\",\"type\":\"zsqpjhvmdajvny\"}}") - .toObject(EnrollmentAccountProperties.class); - Assertions.assertEquals("dkcglhsl", model.accountName()); - Assertions.assertEquals("jdyggdtji", model.costCenter()); - Assertions.assertEquals("b", model.accountOwner()); - Assertions.assertEquals("ofqweykhmenevfye", model.accountOwnerEmail()); - Assertions.assertEquals("whybcib", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T16:24:46Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T06:13:45Z"), model.endDate()); - Assertions.assertEquals("ynnaam", model.department().departmentName()); - Assertions.assertEquals("ctehfiqscjey", model.department().costCenter()); - Assertions.assertEquals("hezrkgq", model.department().status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountProperties model = - new EnrollmentAccountProperties() - .withAccountName("dkcglhsl") - .withCostCenter("jdyggdtji") - .withAccountOwner("b") - .withAccountOwnerEmail("ofqweykhmenevfye") - .withStatus("whybcib") - .withStartDate(OffsetDateTime.parse("2021-05-14T16:24:46Z")) - .withEndDate(OffsetDateTime.parse("2021-01-31T06:13:45Z")) - .withDepartment( - new Department() - .withDepartmentName("ynnaam") - .withCostCenter("ctehfiqscjey") - .withStatus("hezrkgq") - .withEnrollmentAccounts(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountProperties.class); - Assertions.assertEquals("dkcglhsl", model.accountName()); - Assertions.assertEquals("jdyggdtji", model.costCenter()); - Assertions.assertEquals("b", model.accountOwner()); - Assertions.assertEquals("ofqweykhmenevfye", model.accountOwnerEmail()); - Assertions.assertEquals("whybcib", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T16:24:46Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T06:13:45Z"), model.endDate()); - Assertions.assertEquals("ynnaam", model.department().departmentName()); - Assertions.assertEquals("ctehfiqscjey", model.department().costCenter()); - Assertions.assertEquals("hezrkgq", model.department().status()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java deleted file mode 100644 index 67997837bb622..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; - -public final class EnrollmentAccountSummaryInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountSummaryInner model = - BinaryData - .fromString( - "{\"properties\":{\"principalName\":\"dp\"},\"id\":\"s\",\"name\":\"wn\",\"type\":\"tgkbugrjqctojc\"}") - .toObject(EnrollmentAccountSummaryInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountSummaryInner model = new EnrollmentAccountSummaryInner(); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountSummaryInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java deleted file mode 100644 index 2cef8c3b44608..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryProperties; - -public final class EnrollmentAccountSummaryPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountSummaryProperties model = - BinaryData - .fromString("{\"principalName\":\"sofieypefojyqd\"}") - .toObject(EnrollmentAccountSummaryProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountSummaryProperties model = new EnrollmentAccountSummaryProperties(); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountSummaryProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java deleted file mode 100644 index 8025c43c1c06b..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Department; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class EnrollmentAccountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccount model = - BinaryData - .fromString( - "{\"properties\":{\"accountName\":\"e\",\"costCenter\":\"alhbx\",\"accountOwner\":\"e\",\"accountOwnerEmail\":\"zzvdudgwds\",\"status\":\"hotwmcynpwlbjnp\",\"startDate\":\"2021-06-10T20:31:16Z\",\"endDate\":\"2021-04-17T12:51:37Z\",\"department\":{\"id\":\"ehxnltyfsop\",\"name\":\"usue\",\"type\":\"nzwdejba\"}},\"id\":\"orxzdmohctbqvud\",\"name\":\"xdn\",\"type\":\"nvowgujju\"}") - .toObject(EnrollmentAccount.class); - Assertions.assertEquals("e", model.accountName()); - Assertions.assertEquals("alhbx", model.costCenter()); - Assertions.assertEquals("e", model.accountOwner()); - Assertions.assertEquals("zzvdudgwds", model.accountOwnerEmail()); - Assertions.assertEquals("hotwmcynpwlbjnp", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T20:31:16Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T12:51:37Z"), model.endDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccount model = - new EnrollmentAccount() - .withAccountName("e") - .withCostCenter("alhbx") - .withAccountOwner("e") - .withAccountOwnerEmail("zzvdudgwds") - .withStatus("hotwmcynpwlbjnp") - .withStartDate(OffsetDateTime.parse("2021-06-10T20:31:16Z")) - .withEndDate(OffsetDateTime.parse("2021-04-17T12:51:37Z")) - .withDepartment(new Department()); - model = BinaryData.fromObject(model).toObject(EnrollmentAccount.class); - Assertions.assertEquals("e", model.accountName()); - Assertions.assertEquals("alhbx", model.costCenter()); - Assertions.assertEquals("e", model.accountOwner()); - Assertions.assertEquals("zzvdudgwds", model.accountOwnerEmail()); - Assertions.assertEquals("hotwmcynpwlbjnp", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T20:31:16Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T12:51:37Z"), model.endDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java deleted file mode 100644 index 4610563f8701b..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnrollmentAccountsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalName\":\"cvtlubseskvc\"},\"id\":\"artr\",\"name\":\"unlpirykycndz\",\"type\":\"qi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnrollmentAccountSummary response = - manager.enrollmentAccounts().getWithResponse("fgvmx", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java deleted file mode 100644 index 0611c06bd47c6..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnrollmentAccountsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principalName\":\"fytpqsixymmpuji\"},\"id\":\"yqlkju\",\"name\":\"smbmslzoy\",\"type\":\"vwzdbpqvyb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.enrollmentAccounts().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java deleted file mode 100644 index 474c62f78de7f..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.EnrollmentPolicies; - -public final class EnrollmentPoliciesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentPolicies model = - BinaryData - .fromString( - "{\"accountOwnerViewCharges\":false,\"departmentAdminViewCharges\":false,\"marketplaceEnabled\":false,\"reservedInstancesEnabled\":true}") - .toObject(EnrollmentPolicies.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentPolicies model = new EnrollmentPolicies(); - model = BinaryData.fromObject(model).toObject(EnrollmentPolicies.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java deleted file mode 100644 index 6043de8cbb2cc..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo; -import org.junit.jupiter.api.Assertions; - -public final class IndirectRelationshipInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IndirectRelationshipInfo model = - BinaryData - .fromString( - "{\"billingAccountName\":\"bdkvwrwjf\",\"billingProfileName\":\"snhu\",\"displayName\":\"eltmrldhugjzzdat\"}") - .toObject(IndirectRelationshipInfo.class); - Assertions.assertEquals("bdkvwrwjf", model.billingAccountName()); - Assertions.assertEquals("snhu", model.billingProfileName()); - Assertions.assertEquals("eltmrldhugjzzdat", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IndirectRelationshipInfo model = - new IndirectRelationshipInfo() - .withBillingAccountName("bdkvwrwjf") - .withBillingProfileName("snhu") - .withDisplayName("eltmrldhugjzzdat"); - model = BinaryData.fromObject(model).toObject(IndirectRelationshipInfo.class); - Assertions.assertEquals("bdkvwrwjf", model.billingAccountName()); - Assertions.assertEquals("snhu", model.billingProfileName()); - Assertions.assertEquals("eltmrldhugjzzdat", model.displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java deleted file mode 100644 index 29983a65ecb5c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class InstructionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstructionInner model = - BinaryData - .fromString( - "{\"properties\":{\"amount\":10.419273,\"startDate\":\"2021-09-25T01:29:01Z\",\"endDate\":\"2021-09-15T09:48:55Z\",\"creationDate\":\"2021-10-30T19:28:33Z\"},\"id\":\"ypewrmjmwvvjekt\",\"name\":\"xsenhwlr\",\"type\":\"ffrzpwvlqdqgbiqy\"}") - .toObject(InstructionInner.class); - Assertions.assertEquals(10.419273f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T01:29:01Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T09:48:55Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T19:28:33Z"), model.creationDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstructionInner model = - new InstructionInner() - .withAmount(10.419273f) - .withStartDate(OffsetDateTime.parse("2021-09-25T01:29:01Z")) - .withEndDate(OffsetDateTime.parse("2021-09-15T09:48:55Z")) - .withCreationDate(OffsetDateTime.parse("2021-10-30T19:28:33Z")); - model = BinaryData.fromObject(model).toObject(InstructionInner.class); - Assertions.assertEquals(10.419273f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T01:29:01Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T09:48:55Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T19:28:33Z"), model.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java deleted file mode 100644 index ad555a22127ef..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.InstructionListResult; - -public final class InstructionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstructionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"amount\":14.028668,\"startDate\":\"2021-02-05T11:01:53Z\",\"endDate\":\"2021-08-09T18:56:36Z\",\"creationDate\":\"2021-10-09T04:22:59Z\"},\"id\":\"yhxdeoejzicwi\",\"name\":\"sjttgzfbish\",\"type\":\"bkh\"},{\"properties\":{\"amount\":99.54184,\"startDate\":\"2021-05-05T10:08:59Z\",\"endDate\":\"2021-10-22T18:26:04Z\",\"creationDate\":\"2021-07-28T01:41:30Z\"},\"id\":\"md\",\"name\":\"hagalpbuxwgipwh\",\"type\":\"nowkgshw\"},{\"properties\":{\"amount\":13.87347,\"startDate\":\"2021-02-10T18:27Z\",\"endDate\":\"2021-05-09T01:51:01Z\",\"creationDate\":\"2021-05-05T18:01:17Z\"},\"id\":\"njeputtmrywn\",\"name\":\"zoqftiyqzrnkcqvy\",\"type\":\"lwh\"},{\"properties\":{\"amount\":81.865715,\"startDate\":\"2021-07-23T19:47:42Z\",\"endDate\":\"2021-07-17T17:56:48Z\",\"creationDate\":\"2021-12-09T22:32:32Z\"},\"id\":\"oqqnwvlryav\",\"name\":\"hheunmmqhgyx\",\"type\":\"konocu\"}],\"nextLink\":\"klyaxuconu\"}") - .toObject(InstructionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstructionListResult model = new InstructionListResult(); - model = BinaryData.fromObject(model).toObject(InstructionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java deleted file mode 100644 index 53907b59c7f0c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InstructionProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class InstructionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstructionProperties model = - BinaryData - .fromString( - "{\"amount\":70.4461,\"startDate\":\"2021-04-18T21:39:40Z\",\"endDate\":\"2021-05-04T00:16:05Z\",\"creationDate\":\"2021-11-21T07:12:40Z\"}") - .toObject(InstructionProperties.class); - Assertions.assertEquals(70.4461f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T21:39:40Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T00:16:05Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T07:12:40Z"), model.creationDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstructionProperties model = - new InstructionProperties() - .withAmount(70.4461f) - .withStartDate(OffsetDateTime.parse("2021-04-18T21:39:40Z")) - .withEndDate(OffsetDateTime.parse("2021-05-04T00:16:05Z")) - .withCreationDate(OffsetDateTime.parse("2021-11-21T07:12:40Z")); - model = BinaryData.fromObject(model).toObject(InstructionProperties.class); - Assertions.assertEquals(70.4461f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T21:39:40Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T00:16:05Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T07:12:40Z"), model.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java deleted file mode 100644 index 1304f5179f84d..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Instruction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InstructionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"amount\":10.233182,\"startDate\":\"2021-09-29T04:01:44Z\",\"endDate\":\"2021-02-26T01:00:55Z\",\"creationDate\":\"2021-10-29T14:07:51Z\"},\"id\":\"k\",\"name\":\"crjdqnsdfzpbgtg\",\"type\":\"ylkdghrje\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Instruction response = - manager - .instructions() - .getWithResponse("rwhryvycytd", "lxgccknfnwmbtm", "pdvjdhttzaefedx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(10.233182f, response.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T04:01:44Z"), response.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T01:00:55Z"), response.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-29T14:07:51Z"), response.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java deleted file mode 100644 index 0706ffdd8508d..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Instruction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InstructionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"amount\":55.698055,\"startDate\":\"2021-06-09T23:46:46Z\",\"endDate\":\"2021-07-18T03:27:54Z\",\"creationDate\":\"2020-12-23T14:53:02Z\"},\"id\":\"kkjqnvbroylaxxu\",\"name\":\"cdisd\",\"type\":\"sfjbjsvg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .instructions() - .listByBillingProfile("ckknhxkizvy", "nrzvuljraaer", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(55.698055f, response.iterator().next().amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-09T23:46:46Z"), response.iterator().next().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T03:27:54Z"), response.iterator().next().endDate()); - Assertions - .assertEquals(OffsetDateTime.parse("2020-12-23T14:53:02Z"), response.iterator().next().creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java deleted file mode 100644 index 8c03ce6dab657..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import com.azure.resourcemanager.billing.models.Instruction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InstructionsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"amount\":93.32798,\"startDate\":\"2021-05-04T10:42:41Z\",\"endDate\":\"2021-06-18T11:18:37Z\",\"creationDate\":\"2021-01-31T17:13:55Z\"},\"id\":\"egprhptil\",\"name\":\"ucb\",\"type\":\"qtgdqohmcwsl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Instruction response = - manager - .instructions() - .putWithResponse( - "utlwxezwzhok", - "bwnhhtql", - "ehgpp", - new InstructionInner() - .withAmount(30.197609f) - .withStartDate(OffsetDateTime.parse("2021-08-28T07:02:54Z")) - .withEndDate(OffsetDateTime.parse("2021-04-06T03:44:21Z")) - .withCreationDate(OffsetDateTime.parse("2021-01-02T20:54:57Z")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(93.32798f, response.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T10:42:41Z"), response.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T11:18:37Z"), response.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T17:13:55Z"), response.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java deleted file mode 100644 index 97de427db41d2..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; - -public final class InvoiceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceInner model = - BinaryData - .fromString( - "{\"properties\":{\"dueDate\":\"2021-03-11T11:23:32Z\",\"invoiceDate\":\"2021-08-15T11:45:06Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"zkzivgvvcnay\",\"value\":67.249825},\"azurePrepaymentApplied\":{\"currency\":\"xxmueedn\",\"value\":33.27728},\"billedAmount\":{\"currency\":\"tkwqqtchealm\",\"value\":65.58801},\"creditAmount\":{\"currency\":\"aygdvwvgpioh\",\"value\":50.264233},\"freeAzureCreditApplied\":{\"currency\":\"fudxepxgyqagvrv\",\"value\":39.926674},\"subTotal\":{\"currency\":\"kghimdblxgwimfnj\",\"value\":1.0266364},\"taxAmount\":{\"currency\":\"mszkkfo\",\"value\":56.352932},\"totalAmount\":{\"currency\":\"kzikfjawneaivxwc\",\"value\":55.13192},\"invoicePeriodStartDate\":\"2021-05-21T02:26:51Z\",\"invoicePeriodEndDate\":\"2021-02-26T20:53:26Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"aenwabf\",\"billingProfileDisplayName\":\"kl\",\"purchaseOrderNumber\":\"xbjhwuaanozjosph\",\"documents\":[{\"kind\":\"VoidNote\",\"url\":\"rvxaglrvimjwosy\",\"source\":\"DRS\"},{\"kind\":\"CreditNote\",\"url\":\"kfcktqum\",\"source\":\"ENF\"}],\"payments\":[{\"paymentType\":\"zikhl\",\"date\":\"2021-07-20T01:18:29Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"gge\"}],\"rebillDetails\":{\"mjsjqb\":{\"creditNoteDocumentId\":\"ygaeqidbqfatpxl\",\"invoiceDocumentId\":\"xcyjmoadsuvarmy\",\"rebillDetails\":{}},\"ajxq\":{\"creditNoteDocumentId\":\"hyxxrwlycoduhpk\",\"invoiceDocumentId\":\"gymare\",\"rebillDetails\":{}},\"mnjijpxacqqudf\":{\"creditNoteDocumentId\":\"jhkycub\",\"invoiceDocumentId\":\"dgssofwqmzqal\",\"rebillDetails\":{}}},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"baaa\",\"creditForDocumentId\":\"yvayffimrzr\",\"subscriptionId\":\"zqogse\"},\"id\":\"nevfdnw\",\"name\":\"wmewzsyy\",\"type\":\"euzsoi\"}") - .toObject(InvoiceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceInner model = new InvoiceInner(); - model = BinaryData.fromObject(model).toObject(InvoiceInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java deleted file mode 100644 index 4c9b987e40d11..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.InvoiceListResult; - -public final class InvoiceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"dueDate\":\"2021-11-02T07:24:48Z\",\"invoiceDate\":\"2021-08-02T06:07:15Z\",\"status\":\"Void\",\"invoicePeriodStartDate\":\"2021-05-26T19:07:11Z\",\"invoicePeriodEndDate\":\"2021-11-15T11:38:05Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"btkuwhh\",\"billingProfileDisplayName\":\"ykojoxafnndlpic\",\"purchaseOrderNumber\":\"o\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"bpkkpwdre\",\"creditForDocumentId\":\"ovvqfovljxywsu\",\"subscriptionId\":\"yrs\"},\"id\":\"dsytgadgvr\",\"name\":\"ea\",\"type\":\"neqn\"},{\"properties\":{\"dueDate\":\"2021-06-18T06:35:15Z\",\"invoiceDate\":\"2021-01-11T09:26Z\",\"status\":\"Due\",\"invoicePeriodStartDate\":\"2021-12-01T10:12:44Z\",\"invoicePeriodEndDate\":\"2021-03-07T01:40:14Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"ji\",\"billingProfileDisplayName\":\"wifto\",\"purchaseOrderNumber\":\"kvpuvksgplsaknyn\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"huopxodlqiynto\",\"creditForDocumentId\":\"ihleos\",\"subscriptionId\":\"w\"},\"id\":\"rmslyzrpzbchckqq\",\"name\":\"qioxi\",\"type\":\"suiizynkedyat\"},{\"properties\":{\"dueDate\":\"2021-10-29T12:30:56Z\",\"invoiceDate\":\"2021-05-21T15:42:34Z\",\"status\":\"Due\",\"invoicePeriodStartDate\":\"2021-08-31T01:44:30Z\",\"invoicePeriodEndDate\":\"2021-02-06T08:02:04Z\",\"invoiceType\":\"AzureMarketplace\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"umnzgmwznmabik\",\"billingProfileDisplayName\":\"orgjhxbldt\",\"purchaseOrderNumber\":\"wrlkdmtn\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"lxdy\",\"creditForDocumentId\":\"syocogjltdtbnnha\",\"subscriptionId\":\"ocrkvcikh\"},\"id\":\"vpa\",\"name\":\"qgxqquezikyw\",\"type\":\"gxk\"}],\"nextLink\":\"la\",\"totalCount\":1870481937}") - .toObject(InvoiceListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceListResult model = new InvoiceListResult(); - model = BinaryData.fromObject(model).toObject(InvoiceListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java deleted file mode 100644 index 98c428791ddf0..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceProperties; - -public final class InvoicePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceProperties model = - BinaryData - .fromString( - "{\"dueDate\":\"2021-09-06T23:25:45Z\",\"invoiceDate\":\"2021-11-18T11:14:43Z\",\"status\":\"Due\",\"amountDue\":{\"currency\":\"rthzvaytdwkqbrqu\",\"value\":67.445885},\"azurePrepaymentApplied\":{\"currency\":\"exiili\",\"value\":42.678963},\"billedAmount\":{\"currency\":\"irqtdqoa\",\"value\":4.6766224},\"creditAmount\":{\"currency\":\"fgsqu\",\"value\":38.977768},\"freeAzureCreditApplied\":{\"currency\":\"xleptramx\",\"value\":16.920918},\"subTotal\":{\"currency\":\"wnwxuqlcvyd\",\"value\":76.745186},\"taxAmount\":{\"currency\":\"ooaojkniodkooebw\",\"value\":34.47978},\"totalAmount\":{\"currency\":\"mmsbvdkcrodtjin\",\"value\":99.528564},\"invoicePeriodStartDate\":\"2021-11-16T20:55:55Z\",\"invoicePeriodEndDate\":\"2021-06-24T17:33:05Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"efkdlf\",\"billingProfileDisplayName\":\"kggkfpa\",\"purchaseOrderNumber\":\"owpulpq\",\"documents\":[{\"kind\":\"Invoice\",\"url\":\"xkqjnsjervt\",\"source\":\"DRS\"},{\"kind\":\"VoidNote\",\"url\":\"sz\",\"source\":\"ENF\"},{\"kind\":\"VoidNote\",\"url\":\"zkfzbeyv\",\"source\":\"DRS\"}],\"payments\":[{\"paymentType\":\"invkjjxdxrbuu\",\"amount\":{\"currency\":\"lewyhmlwpaz\",\"value\":41.111607},\"date\":\"2021-01-30T03:38:42Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"kwyfzqwhxxbuyqax\"},{\"paymentType\":\"eqz\",\"amount\":{\"currency\":\"riolxorjalt\",\"value\":80.87304},\"date\":\"2021-02-06T08:10:47Z\",\"paymentMethodFamily\":\"CheckWire\",\"paymentMethodType\":\"bqwcsdbnwdcf\"},{\"paymentType\":\"cqdpfuv\",\"amount\":{\"currency\":\"bjj\",\"value\":36.3222},\"date\":\"2021-05-27T00:53:27Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"vudutncor\"},{\"paymentType\":\"lxqtvcofudfl\",\"amount\":{\"currency\":\"jub\",\"value\":57.222305},\"date\":\"2021-10-26T17:09:29Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"aznqntoru\"}],\"rebillDetails\":{\"aeburuvdmo\":{\"creditNoteDocumentId\":\"a\",\"invoiceDocumentId\":\"kycgrauwj\",\"rebillDetails\":{}},\"fkifr\":{\"creditNoteDocumentId\":\"mz\",\"invoiceDocumentId\":\"wabm\",\"rebillDetails\":{}},\"ujitcjedftww\":{\"creditNoteDocumentId\":\"puqujmqlgkfbtn\",\"invoiceDocumentId\":\"aongbj\",\"rebillDetails\":{}},\"oqouicybxarzgszu\":{\"creditNoteDocumentId\":\"zkoj\",\"invoiceDocumentId\":\"c\",\"rebillDetails\":{}}},\"documentType\":\"Invoice\",\"billedDocumentId\":\"iqopidoamciod\",\"creditForDocumentId\":\"haz\",\"subscriptionId\":\"hnzbonl\"}") - .toObject(InvoiceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceProperties model = new InvoiceProperties(); - model = BinaryData.fromObject(model).toObject(InvoiceProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java deleted file mode 100644 index a8b299df0c6f0..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InvoiceSectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"awrlyx\",\"labels\":{\"nwbxgjvtbvpyssz\":\"cpr\",\"guhmuouqfpr\":\"nruj\"},\"state\":\"Restricted\",\"systemId\":\"nguitnwuizgazxu\",\"tags\":{\"hr\":\"uckyf\",\"zwdzuh\":\"idf\"},\"targetCloud\":\"USGov\"},\"id\":\"wisdkft\",\"name\":\"wxmnteiwao\",\"type\":\"vkmijcmmxdcuf\"}") - .toObject(InvoiceSectionInner.class); - Assertions.assertEquals("awrlyx", model.displayName()); - Assertions.assertEquals("cpr", model.labels().get("nwbxgjvtbvpyssz")); - Assertions.assertEquals("uckyf", model.tags().get("hr")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionInner model = - new InvoiceSectionInner() - .withDisplayName("awrlyx") - .withLabels(mapOf("nwbxgjvtbvpyssz", "cpr", "guhmuouqfpr", "nruj")) - .withTags(mapOf("hr", "uckyf", "zwdzuh", "idf")); - model = BinaryData.fromObject(model).toObject(InvoiceSectionInner.class); - Assertions.assertEquals("awrlyx", model.displayName()); - Assertions.assertEquals("cpr", model.labels().get("nwbxgjvtbvpyssz")); - Assertions.assertEquals("uckyf", model.tags().get("hr")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java deleted file mode 100644 index f97b11dd1f8b9..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.InvoiceSectionListResult; - -public final class InvoiceSectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"wzbaiue\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"nyqupedeojnabck\",\"tags\":{},\"targetCloud\":\"USNat\"},\"id\":\"xpsiebtfhvpes\",\"name\":\"pskrdqmh\",\"type\":\"jdhtldwkyzxu\"},{\"properties\":{\"displayName\":\"ncwscwsvlxoto\",\"labels\":{},\"state\":\"Restricted\",\"systemId\":\"pqsxvnmicy\",\"tags\":{},\"targetCloud\":\"USSec\"},\"id\":\"o\",\"name\":\"eil\",\"type\":\"vnotyfjfcnj\"}],\"totalCount\":534363981,\"nextLink\":\"x\"}") - .toObject(InvoiceSectionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionListResult model = new InvoiceSectionListResult(); - model = BinaryData.fromObject(model).toObject(InvoiceSectionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java deleted file mode 100644 index 3269746112668..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InvoiceSectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionProperties model = - BinaryData - .fromString( - "{\"displayName\":\"srp\",\"labels\":{\"sgfyccsnew\":\"idnsezcxtb\",\"oosflnr\":\"dwzjeiach\",\"vypyqrimzinpv\":\"sfqpteehz\",\"rsoodqxhcrmnoh\":\"wjdk\"},\"state\":\"Active\",\"systemId\":\"whdsoifiyip\",\"tags\":{\"rcjxvsnbyxqabn\":\"qwpgrjbzn\",\"hurzafblj\":\"ocpcy\"},\"targetCloud\":\"USGov\"}") - .toObject(InvoiceSectionProperties.class); - Assertions.assertEquals("srp", model.displayName()); - Assertions.assertEquals("idnsezcxtb", model.labels().get("sgfyccsnew")); - Assertions.assertEquals("qwpgrjbzn", model.tags().get("rcjxvsnbyxqabn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionProperties model = - new InvoiceSectionProperties() - .withDisplayName("srp") - .withLabels( - mapOf( - "sgfyccsnew", - "idnsezcxtb", - "oosflnr", - "dwzjeiach", - "vypyqrimzinpv", - "sfqpteehz", - "rsoodqxhcrmnoh", - "wjdk")) - .withTags(mapOf("rcjxvsnbyxqabn", "qwpgrjbzn", "hurzafblj", "ocpcy")); - model = BinaryData.fromObject(model).toObject(InvoiceSectionProperties.class); - Assertions.assertEquals("srp", model.displayName()); - Assertions.assertEquals("idnsezcxtb", model.labels().get("sgfyccsnew")); - Assertions.assertEquals("qwpgrjbzn", model.tags().get("rcjxvsnbyxqabn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java deleted file mode 100644 index e02362158b91e..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoiceSectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"fqwazlnqnmcjn\",\"labels\":{\"sf\":\"dqxtbjwgnyf\"},\"state\":\"Restricted\",\"systemId\":\"uik\",\"tags\":{\"cfhmlrqryxyn\":\"jqg\",\"ptgoeiybbabp\":\"nzrdpsovwxz\"},\"targetCloud\":\"USGov\"},\"id\":\"f\",\"name\":\"lkvn\",\"type\":\"jlrigjkskyrioovz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InvoiceSection response = - manager - .invoiceSections() - .createOrUpdate( - "rtle", - "pqxbkwvzgnzvdf", - "zdix", - new InvoiceSectionInner() - .withDisplayName("pnodawopqhe") - .withLabels( - mapOf( - "bostzel", - "tmcg", - "tmzlbiojlv", - "dlat", - "r", - "hrbbpneqvcwwyy", - "nmokayzejnhlbk", - "ochpprpr")) - .withTags( - mapOf( - "chndbnwie", - "zv", - "ubwefqs", - "olewjwi", - "qtferrqwexjkmf", - "ap", - "btqwpwyawbzas", - "apjwogqqnobpudcd")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fqwazlnqnmcjn", response.displayName()); - Assertions.assertEquals("dqxtbjwgnyf", response.labels().get("sf")); - Assertions.assertEquals("jqg", response.tags().get("cfhmlrqryxyn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java deleted file mode 100644 index 0581a11f29591..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoiceSectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"cysihs\",\"labels\":{\"cohdx\":\"wdhohsdtmcdzsu\"},\"state\":\"Active\",\"systemId\":\"cmuapcvhd\",\"tags\":{\"qzinkfkbg\":\"wqqxeysko\"},\"targetCloud\":\"USSec\"},\"id\":\"owxeqocljmy\",\"name\":\"vkzqk\",\"type\":\"jeokbzefezrxccz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InvoiceSection response = - manager - .invoiceSections() - .getWithResponse("jtotpvopvpbd", "zq", "qqihedsvqwthmk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("cysihs", response.displayName()); - Assertions.assertEquals("wdhohsdtmcdzsu", response.labels().get("cohdx")); - Assertions.assertEquals("wqqxeysko", response.tags().get("qzinkfkbg")); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java deleted file mode 100644 index 0c7e9835ee1f3..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoiceSectionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"ehjku\",\"labels\":{\"aeylinm\":\"afgaoqlt\",\"irpghriypoqeyh\":\"gv\"},\"state\":\"Active\",\"systemId\":\"kprlpyznuc\",\"tags\":{\"xtyasiibmiyb\":\"smexiitdf\",\"mgixhcmavmqfou\":\"nustgnljh\",\"cgyypro\":\"or\"},\"targetCloud\":\"USNat\"},\"id\":\"pundmbxhug\",\"name\":\"mjkavlgorbmft\",\"type\":\"mdtzfjltfvnzc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .invoiceSections() - .listByBillingProfile("eebtijvacvb", "qzbqqxlajrnwxa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ehjku", response.iterator().next().displayName()); - Assertions.assertEquals("afgaoqlt", response.iterator().next().labels().get("aeylinm")); - Assertions.assertEquals("smexiitdf", response.iterator().next().tags().get("xtyasiibmiyb")); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java deleted file mode 100644 index 75be29ddfc0cb..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpand; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InvoiceSectionsOnExpandTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionsOnExpand model = - BinaryData - .fromString( - "{\"hasMoreResults\":false,\"value\":[{\"properties\":{\"displayName\":\"ozwyiftyhxhuro\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"olniwpwcukjf\",\"tags\":{},\"targetCloud\":\"USNat\"},\"id\":\"w\",\"name\":\"klryplwck\",\"type\":\"asy\"},{\"properties\":{\"displayName\":\"ddhsgcbacphe\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"nqgoulzndli\",\"tags\":{},\"targetCloud\":\"USSec\"},\"id\":\"kgfg\",\"name\":\"bmadgak\",\"type\":\"qsrxybzqqed\"},{\"properties\":{\"displayName\":\"bciqfouflm\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"modmglougpb\",\"tags\":{},\"targetCloud\":\"USNat\"},\"id\":\"utduqktapspwgcu\",\"name\":\"rtumkdosvq\",\"type\":\"hbmdgbbjfdd\"},{\"properties\":{\"displayName\":\"mbe\",\"labels\":{},\"state\":\"Restricted\",\"systemId\":\"tq\",\"tags\":{},\"targetCloud\":\"USGov\"},\"id\":\"fpfpsalgbquxigj\",\"name\":\"jgzjaoyfhrtx\",\"type\":\"lnerkujysvleju\"}]}") - .toObject(InvoiceSectionsOnExpand.class); - Assertions.assertEquals("ozwyiftyhxhuro", model.value().get(0).displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionsOnExpand model = - new InvoiceSectionsOnExpand() - .withValue( - Arrays - .asList( - new InvoiceSectionInner() - .withDisplayName("ozwyiftyhxhuro") - .withLabels(mapOf()) - .withTags(mapOf()), - new InvoiceSectionInner() - .withDisplayName("ddhsgcbacphe") - .withLabels(mapOf()) - .withTags(mapOf()), - new InvoiceSectionInner() - .withDisplayName("bciqfouflm") - .withLabels(mapOf()) - .withTags(mapOf()), - new InvoiceSectionInner().withDisplayName("mbe").withLabels(mapOf()).withTags(mapOf()))); - model = BinaryData.fromObject(model).toObject(InvoiceSectionsOnExpand.class); - Assertions.assertEquals("ozwyiftyhxhuro", model.value().get(0).displayName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java deleted file mode 100644 index 89163085ad55c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadBillingSubscriptionInvoiceMockTests { - @Test - public void testDownloadBillingSubscriptionInvoice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-05-25T20:54:06Z\",\"url\":\"knbnxwcdommpvfq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager - .invoices() - .downloadBillingSubscriptionInvoice("patlbijp", "gsksrfhf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java deleted file mode 100644 index 655048e66218a..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadInvoiceMockTests { - @Test - public void testDownloadInvoice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-01-09T20:20:26Z\",\"url\":\"cbbxigdhxi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager.invoices().downloadInvoice("wjqo", "ueayfbpcmsplb", "rrueqthwmg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java deleted file mode 100644 index 7b8f4aaa50b64..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadMultipleBillingProfileInvoicesMockTests { - @Test - public void testDownloadMultipleBillingProfileInvoices() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-02-22T15:43:03Z\",\"url\":\"acigel\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager - .invoices() - .downloadMultipleBillingProfileInvoices( - "d", Arrays.asList("pedbwdpyqy", "bxubmdna", "cbq", "remj"), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java deleted file mode 100644 index b8e788b9f2d2e..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests { - @Test - public void testDownloadMultipleBillingSubscriptionInvoices() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-05-24T19:47:23Z\",\"url\":\"swmtxk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager - .invoices() - .downloadMultipleBillingSubscriptionInvoices( - Arrays.asList("zfgbrttuiaclkie", "hajlfn", "hiqfyuttdiy", "b"), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java deleted file mode 100644 index d285663dbb828..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesGetByIdWithResponseMockTests { - @Test - public void testGetByIdWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dueDate\":\"2021-11-19T08:57:11Z\",\"invoiceDate\":\"2021-09-29T20:15:12Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"cyl\",\"value\":51.22294},\"azurePrepaymentApplied\":{\"currency\":\"sghpx\",\"value\":30.83282},\"billedAmount\":{\"currency\":\"rwjjkhvyomacluzv\",\"value\":40.415318},\"creditAmount\":{\"currency\":\"rpqpd\",\"value\":59.6452},\"freeAzureCreditApplied\":{\"currency\":\"isqcssffxuifmcs\",\"value\":69.43647},\"subTotal\":{\"currency\":\"dqzrdzsyloll\",\"value\":10.311211},\"taxAmount\":{\"currency\":\"zydmxzjijpvuaurk\",\"value\":11.588705},\"totalAmount\":{\"currency\":\"ldefxrdcoxn\",\"value\":32.83848},\"invoicePeriodStartDate\":\"2021-07-04T07:58:23Z\",\"invoicePeriodEndDate\":\"2021-04-25T04:45:39Z\",\"invoiceType\":\"AzureMarketplace\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"nqbpi\",\"billingProfileDisplayName\":\"qltgrd\",\"purchaseOrderNumber\":\"ypxrx\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"tafsrbxrblmliowx\",\"creditForDocumentId\":\"spnxwqagnepzw\",\"subscriptionId\":\"lsbs\"},\"id\":\"qqqagwwrxaomzi\",\"name\":\"glrrczez\",\"type\":\"hhltnjadhqo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Invoice response = - manager.invoices().getByIdWithResponse("xtwbta", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java deleted file mode 100644 index 5da61106e83da..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests { - @Test - public void testGetBySubscriptionAndInvoiceIdWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dueDate\":\"2021-10-03T14:21:22Z\",\"invoiceDate\":\"2021-02-27T09:08:37Z\",\"status\":\"Void\",\"amountDue\":{\"currency\":\"py\",\"value\":83.36014},\"azurePrepaymentApplied\":{\"currency\":\"eblydyv\",\"value\":47.9007},\"billedAmount\":{\"currency\":\"ocxnehvsmtodl\",\"value\":57.823967},\"creditAmount\":{\"currency\":\"ucygvo\",\"value\":34.292477},\"freeAzureCreditApplied\":{\"currency\":\"ssxlghieegjlg\",\"value\":45.138866},\"subTotal\":{\"currency\":\"eksgbuxantuygd\",\"value\":8.260214},\"taxAmount\":{\"currency\":\"pirpiwrqof\",\"value\":3.015864},\"totalAmount\":{\"currency\":\"jnlex\",\"value\":70.006035},\"invoicePeriodStartDate\":\"2021-09-02T12:37:37Z\",\"invoicePeriodEndDate\":\"2021-03-18T11:37:29Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"uuuercta\",\"billingProfileDisplayName\":\"yintqpbrlcy\",\"purchaseOrderNumber\":\"uczkgofxyfsruc\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"st\",\"creditForDocumentId\":\"eaqnrmvvfkoxm\",\"subscriptionId\":\"hktuidvrma\"},\"id\":\"lpdwwexymzvlazi\",\"name\":\"bhpwvqsgnyy\",\"type\":\"uzivensrpmeyyvp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Invoice response = - manager - .invoices() - .getBySubscriptionAndInvoiceIdWithResponse("zfrgqhaohcm", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java deleted file mode 100644 index e3e1213c3c0c1..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dueDate\":\"2021-03-09T19:20:38Z\",\"invoiceDate\":\"2021-03-12T02:37:11Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"efjokn\",\"value\":76.97374},\"azurePrepaymentApplied\":{\"currency\":\"qedikdfrd\",\"value\":26.596153},\"billedAmount\":{\"currency\":\"jgeihfqlggwfi\",\"value\":70.12909},\"creditAmount\":{\"currency\":\"jpbyephmgtv\",\"value\":89.511314},\"freeAzureCreditApplied\":{\"currency\":\"m\",\"value\":27.577436},\"subTotal\":{\"currency\":\"gxhnpomyqwcabv\",\"value\":19.589584},\"taxAmount\":{\"currency\":\"ey\",\"value\":95.847664},\"totalAmount\":{\"currency\":\"augmrmfjlr\",\"value\":87.45515},\"invoicePeriodStartDate\":\"2021-07-12T07:37Z\",\"invoicePeriodEndDate\":\"2021-02-10T01:38:52Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"isizm\",\"billingProfileDisplayName\":\"eds\",\"purchaseOrderNumber\":\"wuived\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"qbpsmg\",\"creditForDocumentId\":\"guamlj\",\"subscriptionId\":\"rgmsplzga\"},\"id\":\"fcshh\",\"name\":\"new\",\"type\":\"nxkympqanxrjk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Invoice response = - manager - .invoices() - .getWithResponse("ubkmifo", "xkubvphavpmhbrbq", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java deleted file mode 100644 index c42f3402475e6..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dueDate\":\"2021-03-06T18:23Z\",\"invoiceDate\":\"2021-04-24T06:39:06Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"bbmpxdlvykfre\",\"value\":84.02913},\"azurePrepaymentApplied\":{\"currency\":\"qwjksghudgz\",\"value\":94.31504},\"billedAmount\":{\"currency\":\"ggsvoujkxibdaf\",\"value\":84.80425},\"creditAmount\":{\"currency\":\"yomkxfbvfbhdy\",\"value\":93.879715},\"freeAzureCreditApplied\":{\"currency\":\"pgddeimawz\",\"value\":66.26469},\"subTotal\":{\"currency\":\"um\",\"value\":96.09336},\"taxAmount\":{\"currency\":\"jcazt\",\"value\":72.1469},\"totalAmount\":{\"currency\":\"qowxwcom\",\"value\":43.389618},\"invoicePeriodStartDate\":\"2020-12-30T18:43:22Z\",\"invoicePeriodEndDate\":\"2021-05-14T17:01:32Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"k\",\"billingProfileDisplayName\":\"ve\",\"purchaseOrderNumber\":\"fdv\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"gddpq\",\"creditForDocumentId\":\"ehnmnaoyankco\",\"subscriptionId\":\"swankltytmh\"},\"id\":\"roznnhdrlktgj\",\"name\":\"sggux\",\"type\":\"eml\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .invoices() - .listByBillingAccount( - "wskondcbrwimuvqe", "osovyrrleaesin", "qtljqobbpihehc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java deleted file mode 100644 index 147b24ce03123..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dueDate\":\"2020-12-27T08:21:28Z\",\"invoiceDate\":\"2021-09-25T19:32:22Z\",\"status\":\"Due\",\"amountDue\":{\"currency\":\"owx\",\"value\":91.388405},\"azurePrepaymentApplied\":{\"currency\":\"deugf\",\"value\":16.688908},\"billedAmount\":{\"currency\":\"paxwkufyk\",\"value\":29.66174},\"creditAmount\":{\"currency\":\"epmrut\",\"value\":97.59715},\"freeAzureCreditApplied\":{\"currency\":\"obns\",\"value\":77.23243},\"subTotal\":{\"currency\":\"ltymkmvguihywart\",\"value\":92.43603},\"taxAmount\":{\"currency\":\"ixkykxd\",\"value\":5.8867693},\"totalAmount\":{\"currency\":\"mmuc\",\"value\":52.700138},\"invoicePeriodStartDate\":\"2021-11-27T23:37:26Z\",\"invoicePeriodEndDate\":\"2021-02-28T12:10:12Z\",\"invoiceType\":\"AzureMarketplace\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"yincql\",\"billingProfileDisplayName\":\"isws\",\"purchaseOrderNumber\":\"iiiovgqcgxuugq\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"teqdptj\",\"creditForDocumentId\":\"dtguk\",\"subscriptionId\":\"nblwphqlkcc\"},\"id\":\"zgygqwahoiulwgni\",\"name\":\"prglvawuwzduf\",\"type\":\"pivlsbbjpm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .invoices() - .listByBillingProfile( - "ywaeeczgf", "ukklelss", "blycsxzujksr", "smdesqplpvmjcd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java deleted file mode 100644 index 349b66ca4044c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesListByBillingSubscriptionMockTests { - @Test - public void testListByBillingSubscription() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dueDate\":\"2021-11-02T12:37:58Z\",\"invoiceDate\":\"2021-06-07T05:32:23Z\",\"status\":\"OverDue\",\"amountDue\":{\"currency\":\"eakxcptsoqfyi\",\"value\":5.842119},\"azurePrepaymentApplied\":{\"currency\":\"hkrttzrazis\",\"value\":36.422657},\"billedAmount\":{\"currency\":\"emv\",\"value\":71.442566},\"creditAmount\":{\"currency\":\"ohmn\",\"value\":47.251976},\"freeAzureCreditApplied\":{\"currency\":\"ojklin\",\"value\":55.43031},\"subTotal\":{\"currency\":\"ysprq\",\"value\":92.47625},\"taxAmount\":{\"currency\":\"ojpslsvjgpliufi\",\"value\":76.19769},\"totalAmount\":{\"currency\":\"qvapcohhoucq\",\"value\":7.474506},\"invoicePeriodStartDate\":\"2021-09-24T10:14:03Z\",\"invoicePeriodEndDate\":\"2021-03-15T00:35:26Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"gdzbenr\",\"billingProfileDisplayName\":\"cawetzqddt\",\"purchaseOrderNumber\":\"fljhznamtua\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"tjzmi\",\"creditForDocumentId\":\"gbgatzuuvbxn\",\"subscriptionId\":\"ebwgga\"},\"id\":\"ttzlswvajqfutlx\",\"name\":\"oqza\",\"type\":\"unwqr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.invoices().listByBillingSubscription("ohdbvqvwzkj", "pwbeonr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java deleted file mode 100644 index 56546760cf4a9..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"bcporxvxcjzhqizx\",\"resource\":\"xtgqscjavftjuh\",\"operation\":\"azkmtgguwp\",\"description\":\"r\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java deleted file mode 100644 index 2f44532627a66..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.OperationInner; -import com.azure.resourcemanager.billing.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"ethwwnpjhlfz\",\"isDataAction\":false,\"display\":{\"provider\":\"wahfbousnfepgfew\",\"resource\":\"wlyxgncxyk\",\"operation\":\"djhlimm\",\"description\":\"x\"}}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java deleted file mode 100644 index fa9010f7ac702..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"ihhrmo\",\"isDataAction\":false,\"display\":{\"provider\":\"eypxiutcxapzhyr\",\"resource\":\"togebjoxsl\",\"operation\":\"nhl\",\"description\":\"rqnkkzjcjbtr\"}},{\"name\":\"ehvvib\",\"isDataAction\":false,\"display\":{\"provider\":\"toqbeitpkxztmoob\",\"resource\":\"ft\",\"operation\":\"gfcwqmpimaqxzhem\",\"description\":\"h\"}},{\"name\":\"uj\",\"isDataAction\":false,\"display\":{\"provider\":\"ozzwculkba\",\"resource\":\"fajnjwltlwtjjguk\",\"operation\":\"lhsnvkcdmx\",\"description\":\"poaimlnwiaaomyl\"}}],\"nextLink\":\"azul\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java deleted file mode 100644 index 02a882f85dc73..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"umqy\",\"isDataAction\":true,\"display\":{\"provider\":\"ulodsaeuzanhsfnh\",\"resource\":\"nwph\",\"operation\":\"fngq\",\"description\":\"lidftujwjj\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java deleted file mode 100644 index 09dd454de703f..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Participants; - -public final class ParticipantsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Participants model = - BinaryData - .fromString("{\"status\":\"ork\",\"statusDate\":\"2021-07-22T12:33Z\",\"email\":\"wjhhgdnhxmsivf\"}") - .toObject(Participants.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Participants model = new Participants(); - model = BinaryData.fromObject(model).toObject(Participants.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java deleted file mode 100644 index 062643f36523a..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.PaymentMethodFamily; -import com.azure.resourcemanager.billing.models.PaymentProperties; -import org.junit.jupiter.api.Assertions; - -public final class PaymentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PaymentProperties model = - BinaryData - .fromString( - "{\"paymentType\":\"tvb\",\"amount\":{\"currency\":\"sfraoyzko\",\"value\":32.20966},\"date\":\"2021-01-01T04:06:13Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"xawqaldsyuuxim\"}") - .toObject(PaymentProperties.class); - Assertions.assertEquals(PaymentMethodFamily.NONE, model.paymentMethodFamily()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PaymentProperties model = new PaymentProperties().withPaymentMethodFamily(PaymentMethodFamily.NONE); - model = BinaryData.fromObject(model).toObject(PaymentProperties.class); - Assertions.assertEquals(PaymentMethodFamily.NONE, model.paymentMethodFamily()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java deleted file mode 100644 index a556286330e97..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.Policy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesGetByBillingProfileWithResponseMockTests { - @Test - public void testGetByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"marketplacePurchases\":\"AllAllowed\",\"reservationPurchases\":\"NotAllowed\",\"viewCharges\":\"Allowed\"},\"id\":\"b\",\"name\":\"qkyojwyvf\",\"type\":\"mbtsuahxsg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Policy response = - manager - .policies() - .getByBillingProfileWithResponse("oqbvjhvefgwbmqj", "hntasfaymx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(MarketplacePurchasesPolicy.ALL_ALLOWED, response.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, response.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java deleted file mode 100644 index 3872fd503387e..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.CustomerPolicy; -import com.azure.resourcemanager.billing.models.ViewCharges; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesGetByCustomerWithResponseMockTests { - @Test - public void testGetByCustomerWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"viewCharges\":\"Allowed\"},\"id\":\"skbruffgllukkut\",\"name\":\"lxhrp\",\"type\":\"hvmblcouqehbhbc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomerPolicy response = - manager - .policies() - .getByCustomerWithResponse("ttxpnrupza", "mrdixtreki", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ViewCharges.ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java deleted file mode 100644 index 6d2e47ba2e625..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.models.CustomerPolicy; -import com.azure.resourcemanager.billing.models.ViewCharges; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesUpdateCustomerWithResponseMockTests { - @Test - public void testUpdateCustomerWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"viewCharges\":\"Allowed\"},\"id\":\"zyqegxyiv\",\"name\":\"inbmh\",\"type\":\"bjijkgqxnh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomerPolicy response = - manager - .policies() - .updateCustomerWithResponse( - "sziryrandoyp", - "blto", - new CustomerPolicyInner().withViewCharges(ViewCharges.ALLOWED), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ViewCharges.ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java deleted file mode 100644 index 5a2335069d8c5..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.Policy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"marketplacePurchases\":\"NotAllowed\",\"reservationPurchases\":\"Allowed\",\"viewCharges\":\"NotAllowed\"},\"id\":\"pol\",\"name\":\"t\",\"type\":\"evboclzhzjknyuxg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Policy response = - manager - .policies() - .updateWithResponse( - "jcmmzrrscub", - "wsdrnpxqwodif", - new PolicyInner() - .withMarketplacePurchases(MarketplacePurchasesPolicy.NOT_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.NOT_ALLOWED), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(MarketplacePurchasesPolicy.NOT_ALLOWED, response.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.ALLOWED, response.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.NOT_ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java deleted file mode 100644 index 19cd4f1e5d2f4..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import org.junit.jupiter.api.Assertions; - -public final class PolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"marketplacePurchases\":\"AllAllowed\",\"reservationPurchases\":\"NotAllowed\",\"viewCharges\":\"Allowed\"},\"id\":\"joqrvqqaatj\",\"name\":\"nrvgoupmfiibfgg\",\"type\":\"ioolvrwxkvtkkgll\"}") - .toObject(PolicyInner.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ALL_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PolicyInner model = - new PolicyInner() - .withMarketplacePurchases(MarketplacePurchasesPolicy.ALL_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.ALLOWED); - model = BinaryData.fromObject(model).toObject(PolicyInner.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ALL_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java deleted file mode 100644 index d0a8201e40a41..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.PolicyProperties; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import org.junit.jupiter.api.Assertions; - -public final class PolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PolicyProperties model = - BinaryData - .fromString( - "{\"marketplacePurchases\":\"OnlyFreeAllowed\",\"reservationPurchases\":\"NotAllowed\",\"viewCharges\":\"NotAllowed\"}") - .toObject(PolicyProperties.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.NOT_ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PolicyProperties model = - new PolicyProperties() - .withMarketplacePurchases(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.NOT_ALLOWED); - model = BinaryData.fromObject(model).toObject(PolicyProperties.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.NOT_ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java deleted file mode 100644 index 1e1a66b9dd561..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import org.junit.jupiter.api.Assertions; - -public final class ProductInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductInner model = - BinaryData - .fromString( - "{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"vithh\",\"purchaseDate\":\"2021-10-25T20:46:01Z\",\"productTypeId\":\"osggbhc\",\"productType\":\"fwdsj\",\"status\":\"Disabled\",\"endDate\":\"2021-06-21T07:46:59Z\",\"billingFrequency\":\"Monthly\",\"lastCharge\":{\"currency\":\"swacffgdkzz\",\"value\":79.305},\"lastChargeDate\":\"2021-09-11T04:06:27Z\",\"quantity\":91.20859,\"skuId\":\"railvpnppfuf\",\"skuDescription\":\"wdmhdlxyjrxs\",\"tenantId\":\"afcnih\",\"availabilityId\":\"qapnedgfbcv\",\"invoiceSectionId\":\"vq\",\"invoiceSectionDisplayName\":\"keqdcvdrhvoods\",\"billingProfileId\":\"bobzdopcjwvnhd\",\"billingProfileDisplayName\":\"wmgxcxrsl\",\"customerId\":\"utwu\",\"customerDisplayName\":\"grpkhjwniyqs\",\"reseller\":{\"resellerId\":\"cpdggkzzlvmbmp\",\"description\":\"modfvuefywsbpfvm\"}},\"id\":\"yhrfouyftaakcpw\",\"name\":\"yzvqt\",\"type\":\"nubexk\"}") - .toObject(ProductInner.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, model.status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, model.billingFrequency()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductInner model = - new ProductInner() - .withAutoRenew(AutoRenew.OFF) - .withStatus(ProductStatusType.DISABLED) - .withBillingFrequency(BillingFrequency.MONTHLY); - model = BinaryData.fromObject(model).toObject(ProductInner.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, model.status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, model.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java deleted file mode 100644 index 7b3f18ebafa08..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ProductProperties; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import org.junit.jupiter.api.Assertions; - -public final class ProductPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductProperties model = - BinaryData - .fromString( - "{\"autoRenew\":\"Off\",\"displayName\":\"mond\",\"purchaseDate\":\"2021-04-01T23:21:50Z\",\"productTypeId\":\"xvy\",\"productType\":\"mg\",\"status\":\"Expired\",\"endDate\":\"2021-02-23T14:11:02Z\",\"billingFrequency\":\"OneTime\",\"lastCharge\":{\"currency\":\"pajqgxysm\",\"value\":44.408627},\"lastChargeDate\":\"2021-03-21T23:12:31Z\",\"quantity\":40.273422,\"skuId\":\"mkcxozapvh\",\"skuDescription\":\"xprglyatddc\",\"tenantId\":\"bcuejrjxgci\",\"availabilityId\":\"brh\",\"invoiceSectionId\":\"xsdqrhzoymibmrqy\",\"invoiceSectionDisplayName\":\"ahwfluszdtmhrk\",\"billingProfileId\":\"fyyvoq\",\"billingProfileDisplayName\":\"piexpbtgiw\",\"customerId\":\"oenwashr\",\"customerDisplayName\":\"tkcnqxwb\",\"reseller\":{\"resellerId\":\"ulpiuj\",\"description\":\"asipqiio\"}}") - .toObject(ProductProperties.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.EXPIRED, model.status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, model.billingFrequency()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductProperties model = - new ProductProperties() - .withAutoRenew(AutoRenew.OFF) - .withStatus(ProductStatusType.EXPIRED) - .withBillingFrequency(BillingFrequency.ONE_TIME); - model = BinaryData.fromObject(model).toObject(ProductProperties.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.EXPIRED, model.status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, model.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java deleted file mode 100644 index aad416840ba28..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"oxoyyukp\",\"purchaseDate\":\"2021-02-08T12:14:50Z\",\"productTypeId\":\"oir\",\"productType\":\"boshbragapyyrmfs\",\"status\":\"PastDue\",\"endDate\":\"2020-12-22T03:30:36Z\",\"billingFrequency\":\"UsageBased\",\"lastCharge\":{\"currency\":\"ppdbwnupgahxkum\",\"value\":87.27331},\"lastChargeDate\":\"2021-05-10T22:23:02Z\",\"quantity\":87.1412,\"skuId\":\"dmmcpugmehqep\",\"skuDescription\":\"fhbzehewhoqhn\",\"tenantId\":\"qnbldxe\",\"availabilityId\":\"lgsc\",\"invoiceSectionId\":\"ri\",\"invoiceSectionDisplayName\":\"rsrrmoucsofldp\",\"billingProfileId\":\"iyfc\",\"billingProfileDisplayName\":\"beolh\",\"customerId\":\"lvbmxuqibsxtkcu\",\"customerDisplayName\":\"b\",\"reseller\":{\"resellerId\":\"rfsiowlkjxn\",\"description\":\"vwgf\"}},\"id\":\"tmhqykiz\",\"name\":\"d\",\"type\":\"saoafcluqvox\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .getWithResponse("ibidmhmwffp", "fmuvapckccr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoRenew.ON, response.autoRenew()); - Assertions.assertEquals(ProductStatusType.PAST_DUE, response.status()); - Assertions.assertEquals(BillingFrequency.USAGE_BASED, response.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java deleted file mode 100644 index c49fbed294b14..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"gdirazf\",\"purchaseDate\":\"2021-02-11T05:39:41Z\",\"productTypeId\":\"w\",\"productType\":\"mdujtmvcopexcm\",\"status\":\"Expiring\",\"endDate\":\"2021-03-26T03:28:17Z\",\"billingFrequency\":\"Monthly\",\"lastCharge\":{\"currency\":\"yqltqsro\",\"value\":83.38941},\"lastChargeDate\":\"2020-12-26T17:33:42Z\",\"quantity\":94.9375,\"skuId\":\"jk\",\"skuDescription\":\"ysidfvclgl\",\"tenantId\":\"fuijtkbus\",\"availabilityId\":\"gsfikayiansha\",\"invoiceSectionId\":\"jtjiqx\",\"invoiceSectionDisplayName\":\"yjqtt\",\"billingProfileId\":\"kpqhjpenuygbq\",\"billingProfileDisplayName\":\"qekewvnqvcd\",\"customerId\":\"uaucmf\",\"customerDisplayName\":\"wnlaxpu\",\"reseller\":{\"resellerId\":\"ikczvvitacgxmf\",\"description\":\"serxht\"}},\"id\":\"soxhlwntsjgqr\",\"name\":\"xypruuuy\",\"type\":\"nchrszizoyu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByBillingAccount("hrtdtpdelq", "cslmotoebnfxo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.OFF, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.EXPIRING, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java deleted file mode 100644 index e62ce259b5477..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"hzjmucftbyrp\",\"purchaseDate\":\"2020-12-22T05:32:19Z\",\"productTypeId\":\"kpigqfusu\",\"productType\":\"zmkw\",\"status\":\"Disabled\",\"endDate\":\"2021-04-09T11:30:43Z\",\"billingFrequency\":\"OneTime\",\"lastCharge\":{\"currency\":\"qe\",\"value\":32.821198},\"lastChargeDate\":\"2021-08-08T18:00:09Z\",\"quantity\":15.188092,\"skuId\":\"gwydyy\",\"skuDescription\":\"svkhgbv\",\"tenantId\":\"anarfdlpukhpyrne\",\"availabilityId\":\"jcpeogkhnmg\",\"invoiceSectionId\":\"ouxddbhfhpfpazj\",\"invoiceSectionDisplayName\":\"ywjxh\",\"billingProfileId\":\"ulontacnpqwteht\",\"billingProfileDisplayName\":\"vrh\",\"customerId\":\"jyoogwxh\",\"customerDisplayName\":\"duugwbsre\",\"reseller\":{\"resellerId\":\"q\",\"description\":\"uarenlv\"}},\"id\":\"htkln\",\"name\":\"nafvvkyfedev\",\"type\":\"bo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByBillingProfile("lyetndnbfqygg", "g", "lnlg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.ON, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java deleted file mode 100644 index c9f5b33651992..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByCustomerMockTests { - @Test - public void testListByCustomer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"ttgepuslvyjtcv\",\"purchaseDate\":\"2021-03-17T17:29:52Z\",\"productTypeId\":\"s\",\"productType\":\"iesfuug\",\"status\":\"PastDue\",\"endDate\":\"2021-02-18T13:25:08Z\",\"billingFrequency\":\"Monthly\",\"lastCharge\":{\"currency\":\"ey\",\"value\":19.2963},\"lastChargeDate\":\"2021-10-11T19:18:51Z\",\"quantity\":8.290726,\"skuId\":\"buew\",\"skuDescription\":\"s\",\"tenantId\":\"jlxuz\",\"availabilityId\":\"wpusxjbaqehg\",\"invoiceSectionId\":\"ohzjqatucoigeb\",\"invoiceSectionDisplayName\":\"cnwfepbnwgfmxjg\",\"billingProfileId\":\"bjb\",\"billingProfileDisplayName\":\"lfgtdysnaquflqbc\",\"customerId\":\"hamzjrwdkqze\",\"customerDisplayName\":\"jleziunjx\",\"reseller\":{\"resellerId\":\"antkwcegyamlbns\",\"description\":\"ac\"}},\"id\":\"jvpilguooqja\",\"name\":\"m\",\"type\":\"itgueiookjbs\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByCustomer("r", "cq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.ON, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.PAST_DUE, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java deleted file mode 100644 index cedf6d070598a..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"vudb\",\"purchaseDate\":\"2021-10-09T01:41:08Z\",\"productTypeId\":\"tvq\",\"productType\":\"rqctmxxdtdd\",\"status\":\"Cancelled\",\"endDate\":\"2021-05-15T03:50:17Z\",\"billingFrequency\":\"OneTime\",\"lastCharge\":{\"currency\":\"vtzn\",\"value\":64.74098},\"lastChargeDate\":\"2021-11-27T23:17:15Z\",\"quantity\":21.243965,\"skuId\":\"vvoxczytprwnw\",\"skuDescription\":\"oevytlyokr\",\"tenantId\":\"o\",\"availabilityId\":\"xv\",\"invoiceSectionId\":\"asbcrymodizrx\",\"invoiceSectionDisplayName\":\"obdxnazpmkmlm\",\"billingProfileId\":\"vfxzopjh\",\"billingProfileDisplayName\":\"xliohrdddt\",\"customerId\":\"xqbawpc\",\"customerDisplayName\":\"nzqcy\",\"reseller\":{\"resellerId\":\"p\",\"description\":\"fyuicdh\"}},\"id\":\"bd\",\"name\":\"bwwg\",\"type\":\"d\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .products() - .listByInvoiceSection("lcqxypokk", "minqcym", "zng", "bdxxe", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.OFF, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.CANCELLED, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java deleted file mode 100644 index 8aef8638de8fb..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ProductsListResult; - -public final class ProductsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"rn\",\"purchaseDate\":\"2021-01-14T16:52:07Z\",\"productTypeId\":\"q\",\"productType\":\"hxcr\",\"status\":\"PastDue\",\"endDate\":\"2021-11-28T02:47:56Z\",\"billingFrequency\":\"OneTime\",\"lastChargeDate\":\"2021-03-25T00:29:47Z\",\"quantity\":52.194805,\"skuId\":\"hsqfsubcgjbirxbp\",\"skuDescription\":\"srfbjfdtwss\",\"tenantId\":\"ftpvjzbexil\",\"availabilityId\":\"nfqqnvwp\",\"invoiceSectionId\":\"taruoujmkcj\",\"invoiceSectionDisplayName\":\"qytjrybnwjewgd\",\"billingProfileId\":\"ervnaenqpehi\",\"billingProfileDisplayName\":\"oygmift\",\"customerId\":\"zdnds\",\"customerDisplayName\":\"nayqi\"},\"id\":\"nduhavhqlkthum\",\"name\":\"qolbgyc\",\"type\":\"uie\"},{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"y\",\"purchaseDate\":\"2021-01-19T22:33:55Z\",\"productTypeId\":\"l\",\"productType\":\"slqlfmmdn\",\"status\":\"Expired\",\"endDate\":\"2021-10-21T18:49:25Z\",\"billingFrequency\":\"Monthly\",\"lastChargeDate\":\"2021-11-30T08:30:44Z\",\"quantity\":76.70319,\"skuId\":\"wyhzdx\",\"skuDescription\":\"adbzmnvdfznud\",\"tenantId\":\"dvxzbncblylpst\",\"availabilityId\":\"hh\",\"invoiceSectionId\":\"rzdzucerscdnt\",\"invoiceSectionDisplayName\":\"vfiwjmygtdss\",\"billingProfileId\":\"wtmwerio\",\"billingProfileDisplayName\":\"pyqs\",\"customerId\":\"wab\",\"customerDisplayName\":\"tshhszhedp\"},\"id\":\"wiwubm\",\"name\":\"mbes\",\"type\":\"dnkwwtppjflcxog\"},{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"z\",\"purchaseDate\":\"2021-05-06T06:04:09Z\",\"productTypeId\":\"kvmkqzeqq\",\"productType\":\"l\",\"status\":\"Expired\",\"endDate\":\"2021-06-11T23:31:33Z\",\"billingFrequency\":\"OneTime\",\"lastChargeDate\":\"2021-01-04T21:57:35Z\",\"quantity\":1.5751779,\"skuId\":\"odkwobd\",\"skuDescription\":\"xtibqdxbxwakbog\",\"tenantId\":\"ndlkzgxhurip\",\"availabilityId\":\"podxunkb\",\"invoiceSectionId\":\"xmubyyntwlrbq\",\"invoiceSectionDisplayName\":\"oievseotgqrlltm\",\"billingProfileId\":\"lauwzizxbmpgcjef\",\"billingProfileDisplayName\":\"muvp\",\"customerId\":\"tdum\",\"customerDisplayName\":\"p\"},\"id\":\"ebmnzbtbhjpglk\",\"name\":\"gohdneuelfphsd\",\"type\":\"htozfikdow\"}],\"totalCount\":1185627072,\"nextLink\":\"v\"}") - .toObject(ProductsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductsListResult model = new ProductsListResult(); - model = BinaryData.fromObject(model).toObject(ProductsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java deleted file mode 100644 index 802a72a859faf..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsMoveWithResponseMockTests { - @Test - public void testMoveWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"xfzzzwyjafitlhgu\",\"purchaseDate\":\"2021-06-17T12:18:01Z\",\"productTypeId\":\"hlgmltxdwhmoz\",\"productType\":\"gzvlnsnn\",\"status\":\"Cancelled\",\"endDate\":\"2021-07-24T17:46:18Z\",\"billingFrequency\":\"UsageBased\",\"lastCharge\":{\"currency\":\"mwamxqzragpgdph\",\"value\":77.4531},\"lastChargeDate\":\"2021-04-17T05:54:10Z\",\"quantity\":30.930174,\"skuId\":\"lejchcsr\",\"skuDescription\":\"knmzlanrupdwvnp\",\"tenantId\":\"nzqtpjhmqrhvt\",\"availabilityId\":\"aiwdcxsmlzzhz\",\"invoiceSectionId\":\"xetlgydlhqv\",\"invoiceSectionDisplayName\":\"npxybafiq\",\"billingProfileId\":\"aarbgjekg\",\"billingProfileDisplayName\":\"lbyulidwcwvmze\",\"customerId\":\"o\",\"customerDisplayName\":\"hj\",\"reseller\":{\"resellerId\":\"gdn\",\"description\":\"brfkspz\"}},\"id\":\"zmtksjci\",\"name\":\"digsxcdgl\",\"type\":\"plkeuachtomflryt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .moveWithResponse( - "vhqjwtrhtgvg", - "pcrrk", - new TransferProductRequestProperties().withDestinationInvoiceSectionId("awjmjsmw"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoRenew.ON, response.autoRenew()); - Assertions.assertEquals(ProductStatusType.CANCELLED, response.status()); - Assertions.assertEquals(BillingFrequency.USAGE_BASED, response.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java deleted file mode 100644 index f374a04deaf29..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"etgbebjfulb\",\"purchaseDate\":\"2021-02-08T00:52:50Z\",\"productTypeId\":\"h\",\"productType\":\"pnfpubntnbat\",\"status\":\"Disabled\",\"endDate\":\"2021-05-10T12:36:54Z\",\"billingFrequency\":\"UsageBased\",\"lastCharge\":{\"currency\":\"aelcat\",\"value\":6.264615},\"lastChargeDate\":\"2021-05-25T09:31:16Z\",\"quantity\":37.74234,\"skuId\":\"vkmjcwmjvlgf\",\"skuDescription\":\"cvkyylizrzbj\",\"tenantId\":\"fxsfuztlvtmv\",\"availabilityId\":\"bwidql\",\"invoiceSectionId\":\"ukoveofi\",\"invoiceSectionDisplayName\":\"vjfn\",\"billingProfileId\":\"mvl\",\"billingProfileDisplayName\":\"z\",\"customerId\":\"blkujrllfojuidjp\",\"customerDisplayName\":\"yjucejikzoeo\",\"reseller\":{\"resellerId\":\"zejet\",\"description\":\"ln\"}},\"id\":\"ikyju\",\"name\":\"k\",\"type\":\"bqzolxr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .updateWithResponse( - "ycjimryvwgcwwpbm", - "gwe", - new ProductInner() - .withAutoRenew(AutoRenew.OFF) - .withStatus(ProductStatusType.CANCELLED) - .withBillingFrequency(BillingFrequency.ONE_TIME), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoRenew.OFF, response.autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, response.status()); - Assertions.assertEquals(BillingFrequency.USAGE_BASED, response.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java deleted file mode 100644 index af86288f701c3..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.RebillDetails; - -public final class RebillDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RebillDetails model = - BinaryData - .fromString( - "{\"creditNoteDocumentId\":\"qfobwyz\",\"invoiceDocumentId\":\"bykutw\",\"rebillDetails\":{\"akgtdlmkkzevdlh\":{\"creditNoteDocumentId\":\"a\",\"invoiceDocumentId\":\"hrskdsnfd\",\"rebillDetails\":{}},\"akufgmjz\":{\"creditNoteDocumentId\":\"pusdstt\",\"invoiceDocumentId\":\"ogvbbejdcngq\",\"rebillDetails\":{}}}}") - .toObject(RebillDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RebillDetails model = new RebillDetails(); - model = BinaryData.fromObject(model).toObject(RebillDetails.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java deleted file mode 100644 index 4a0330b58b17e..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Reseller; - -public final class ResellerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Reseller model = - BinaryData - .fromString("{\"resellerId\":\"gsxnkjzkdeslpv\",\"description\":\"pwiyig\"}") - .toObject(Reseller.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Reseller model = new Reseller(); - model = BinaryData.fromObject(model).toObject(Reseller.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java deleted file mode 100644 index fdc06de7fa02c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ReservationInner; -import com.azure.resourcemanager.billing.models.ReservationSkuProperty; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationInner model = - BinaryData - .fromString( - "{\"id\":\"vdwxfzwi\",\"name\":\"wzjbh\",\"type\":\"sxjrk\",\"location\":\"btrnegvm\",\"sku\":{\"name\":\"q\"},\"properties\":{\"appliedScopes\":[\"dspastjbkkdmfl\"],\"appliedScopeType\":\"stmjlxrri\",\"reservedResourceType\":\"zapeewchpx\",\"quantity\":51.30364,\"provisioningState\":\"kuziycsle\",\"expiryDate\":\"f\",\"provisioningSubState\":\"tcktyhjtqedcgzu\",\"displayName\":\"mmrqz\",\"displayProvisioningState\":\"rjvpglydzgkrvqee\",\"userFriendlyRenewState\":\"oepry\",\"userFriendlyAppliedScopeType\":\"nwy\",\"effectiveDateTime\":\"zdmovzv\",\"skuDescription\":\"aawzqadfl\",\"term\":\"ur\",\"renew\":true,\"renewSource\":\"ecxn\",\"utilization\":{\"trend\":\"cokpv\",\"aggregates\":[]}}}") - .toObject(ReservationInner.class); - Assertions.assertEquals("dspastjbkkdmfl", model.appliedScopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationInner model = - new ReservationInner() - .withSku(new ReservationSkuProperty()) - .withAppliedScopes(Arrays.asList("dspastjbkkdmfl")); - model = BinaryData.fromObject(model).toObject(ReservationInner.class); - Assertions.assertEquals("dspastjbkkdmfl", model.appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java deleted file mode 100644 index c40bb2b085f50..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ReservationProperty; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationProperty model = - BinaryData - .fromString( - "{\"appliedScopes\":[\"gxobfirclnp\",\"ciayzriykhya\",\"fvjlboxqvkjlmx\"],\"appliedScopeType\":\"mdy\",\"reservedResourceType\":\"dwdigumb\",\"quantity\":79.26031,\"provisioningState\":\"uzzptjazysdz\",\"expiryDate\":\"zwwva\",\"provisioningSubState\":\"yuvvfonkp\",\"displayName\":\"qyikvy\",\"displayProvisioningState\":\"uyav\",\"userFriendlyRenewState\":\"wmn\",\"userFriendlyAppliedScopeType\":\"ttijfybvpoekrs\",\"effectiveDateTime\":\"gbdhuzqgnjdg\",\"skuDescription\":\"nscliqhzvhxnk\",\"term\":\"tkubotppn\",\"renew\":false,\"renewSource\":\"xhihfrbbcevqagtl\",\"utilization\":{\"trend\":\"lfkqojpy\",\"aggregates\":[{\"grain\":71.06859,\"grainUnit\":\"cnifm\",\"value\":42.886497,\"valueUnit\":\"ymbrnysuxmpraf\"}]}}") - .toObject(ReservationProperty.class); - Assertions.assertEquals("gxobfirclnp", model.appliedScopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationProperty model = - new ReservationProperty().withAppliedScopes(Arrays.asList("gxobfirclnp", "ciayzriykhya", "fvjlboxqvkjlmx")); - model = BinaryData.fromObject(model).toObject(ReservationProperty.class); - Assertions.assertEquals("gxobfirclnp", model.appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java deleted file mode 100644 index cfdbbf0185767..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationPropertyUtilization; -import com.azure.resourcemanager.billing.models.ReservationUtilizationAggregates; -import java.util.Arrays; - -public final class ReservationPropertyUtilizationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationPropertyUtilization model = - BinaryData - .fromString( - "{\"trend\":\"ckh\",\"aggregates\":[{\"grain\":5.347806,\"grainUnit\":\"ffwafq\",\"value\":61.13735,\"valueUnit\":\"aspavehhr\"}]}") - .toObject(ReservationPropertyUtilization.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationPropertyUtilization model = - new ReservationPropertyUtilization().withAggregates(Arrays.asList(new ReservationUtilizationAggregates())); - model = BinaryData.fromObject(model).toObject(ReservationPropertyUtilization.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java deleted file mode 100644 index 8eb47537dc76c..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationSkuProperty; - -public final class ReservationSkuPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationSkuProperty model = BinaryData.fromString("{\"name\":\"t\"}").toObject(ReservationSkuProperty.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSkuProperty model = new ReservationSkuProperty(); - model = BinaryData.fromObject(model).toObject(ReservationSkuProperty.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java deleted file mode 100644 index fed07fadee2c1..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationSummary; - -public final class ReservationSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationSummary model = - BinaryData - .fromString( - "{\"succeededCount\":29.918415,\"failedCount\":93.61522,\"expiringCount\":44.341938,\"expiredCount\":23.334568,\"pendingCount\":75.85746,\"cancelledCount\":61.311485}") - .toObject(ReservationSummary.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSummary model = new ReservationSummary(); - model = BinaryData.fromObject(model).toObject(ReservationSummary.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java deleted file mode 100644 index ed0430403c363..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationUtilizationAggregates; - -public final class ReservationUtilizationAggregatesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationUtilizationAggregates model = - BinaryData - .fromString("{\"grain\":55.157936,\"grainUnit\":\"n\",\"value\":42.470722,\"valueUnit\":\"dhcxgkmoy\"}") - .toObject(ReservationUtilizationAggregates.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationUtilizationAggregates model = new ReservationUtilizationAggregates(); - model = BinaryData.fromObject(model).toObject(ReservationUtilizationAggregates.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java deleted file mode 100644 index dc7a22dea93fd..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Reservation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReservationsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"wpwerye\",\"name\":\"kdhmeottawjyosx\",\"type\":\"hnhjtfvpndpmi\",\"location\":\"pnwy\",\"sku\":{\"name\":\"qllzsauzpjlxeehu\"},\"properties\":{\"appliedScopes\":[\"zlrayme\",\"xls\",\"ihmxrfdsajredn\",\"yyshtuwgmevua\"],\"appliedScopeType\":\"wzyif\",\"reservedResourceType\":\"gwltxeqip\",\"quantity\":21.367962,\"provisioningState\":\"yimsfayorpr\",\"expiryDate\":\"kj\",\"provisioningSubState\":\"eslabnsmjkwynq\",\"displayName\":\"ekqsykvwjtqpkev\",\"displayProvisioningState\":\"ltjcrspxk\",\"userFriendlyRenewState\":\"r\",\"userFriendlyAppliedScopeType\":\"lfg\",\"effectiveDateTime\":\"nnnoytz\",\"skuDescription\":\"sewxigpxvkqm\",\"term\":\"pxvpifdfaif\",\"renew\":true,\"renewSource\":\"eyuubei\",\"utilization\":{\"trend\":\"l\",\"aggregates\":[]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .reservations() - .listByBillingAccount( - "yqwixvcpwnkwywzw", - "falickduoiqtamty", - "sknxrwzawnvsbcf", - "zagxnvhycvdi", - "wrzregzgyufu", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zlrayme", response.iterator().next().appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java deleted file mode 100644 index c4c6e8631ae32..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Reservation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReservationsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"dnaienhqhskndnel\",\"name\":\"aadl\",\"type\":\"wf\",\"location\":\"nniyopetxi\",\"sku\":{\"name\":\"rl\"},\"properties\":{\"appliedScopes\":[\"caephbl\"],\"appliedScopeType\":\"qp\",\"reservedResourceType\":\"vbqsdt\",\"quantity\":63.41683,\"provisioningState\":\"tvivuzqym\",\"expiryDate\":\"owog\",\"provisioningSubState\":\"it\",\"displayName\":\"hzvb\",\"displayProvisioningState\":\"cdb\",\"userFriendlyRenewState\":\"fzndscxmxeatkd\",\"userFriendlyAppliedScopeType\":\"wnrdjyibqbnaom\",\"effectiveDateTime\":\"rmkuh\",\"skuDescription\":\"xljalfihc\",\"term\":\"obcancdexxqcw\",\"renew\":false,\"renewSource\":\"gvaknokzwjjzrl\",\"utilization\":{\"trend\":\"l\",\"aggregates\":[]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .reservations() - .listByBillingProfile( - "toi", - "hgygvfltgvd", - "hoynk", - "xwetwkdrcyrucpc", - "nn", - "zdqumoe", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("caephbl", response.iterator().next().appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java deleted file mode 100644 index 04fa82034225d..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationSummary; -import com.azure.resourcemanager.billing.models.ReservationsListResult; - -public final class ReservationsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"ox\",\"name\":\"dufiq\",\"type\":\"ieuzaofjchvcyyy\",\"location\":\"gdotcubiipuipwo\",\"sku\":{\"name\":\"macjekn\"},\"properties\":{\"appliedScopes\":[],\"appliedScopeType\":\"qvci\",\"reservedResourceType\":\"ev\",\"quantity\":66.675064,\"provisioningState\":\"lrri\",\"expiryDate\":\"ywdxsmic\",\"provisioningSubState\":\"rwfscjfnynszquj\",\"displayName\":\"dvoqyt\",\"displayProvisioningState\":\"yo\",\"userFriendlyRenewState\":\"blgyavutpthj\",\"userFriendlyAppliedScopeType\":\"oismsksbpimlqol\",\"effectiveDateTime\":\"kcgxxlxsffgcvi\",\"skuDescription\":\"zdwlvwlyoupfgfb\",\"term\":\"ubdyhgk\",\"renew\":false,\"renewSource\":\"sgow\"}},{\"id\":\"tsttktlahbq\",\"name\":\"tx\",\"type\":\"zukxitmmqtgqq\",\"location\":\"hrnxrxc\",\"sku\":{\"name\":\"isavok\"},\"properties\":{\"appliedScopes\":[],\"appliedScopeType\":\"vazivjlfr\",\"reservedResourceType\":\"tbajlkatn\",\"quantity\":27.220089,\"provisioningState\":\"opidkqqfkuv\",\"expiryDate\":\"xkdmligo\",\"provisioningSubState\":\"brxk\",\"displayName\":\"loazuruocbgoo\",\"displayProvisioningState\":\"te\",\"userFriendlyRenewState\":\"bfhjxakvvjgsl\",\"userFriendlyAppliedScopeType\":\"dilmyww\",\"effectiveDateTime\":\"gkxnyedabg\",\"skuDescription\":\"udtjuewbc\",\"term\":\"xuuwhcj\",\"renew\":false,\"renewSource\":\"ybvpay\"}},{\"id\":\"udzpxgwjplmagstc\",\"name\":\"hpfkyrkdbdgi\",\"type\":\"sjkmnwqj\",\"location\":\"baiyhddviaceg\",\"sku\":{\"name\":\"ntfpmvmemfnc\"},\"properties\":{\"appliedScopes\":[],\"appliedScopeType\":\"vbalxlllc\",\"reservedResourceType\":\"odbzevwrdnhf\",\"quantity\":22.404224,\"provisioningState\":\"sjcswsmystuluqyp\",\"expiryDate\":\"vlerchpqbmfpjba\",\"provisioningSubState\":\"idfcxsspuunnoxyh\",\"displayName\":\"g\",\"displayProvisioningState\":\"drihpfhoqcaaewda\",\"userFriendlyRenewState\":\"djvlpj\",\"userFriendlyAppliedScopeType\":\"kzbrmsgeivsiy\",\"effectiveDateTime\":\"kdncj\",\"skuDescription\":\"onbzoggculapzwy\",\"term\":\"gogtqxepnylbf\",\"renew\":true,\"renewSource\":\"yjt\"}}],\"nextLink\":\"fqzhv\",\"summary\":{\"succeededCount\":53.406746,\"failedCount\":13.140678,\"expiringCount\":70.9251,\"expiredCount\":36.47178,\"pendingCount\":75.72936,\"cancelledCount\":24.269749}}") - .toObject(ReservationsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationsListResult model = new ReservationsListResult().withSummary(new ReservationSummary()); - model = BinaryData.fromObject(model).toObject(ReservationsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java deleted file mode 100644 index 7afc61e4e0fda..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import org.junit.jupiter.api.Assertions; - -public final class TransactionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransactionInner model = - BinaryData - .fromString( - "{\"properties\":{\"kind\":\"reservation\",\"date\":\"2021-02-11T03:05:15Z\",\"invoice\":\"vfgbvfvpdboda\",\"invoiceId\":\"zsjqlh\",\"orderId\":\"r\",\"orderName\":\"deibqip\",\"productFamily\":\"ghvxndzwmkrefa\",\"productTypeId\":\"jorwkqnyhgbij\",\"productType\":\"ivfxzsjabibsyst\",\"productDescription\":\"fsdjpvkvp\",\"transactionType\":\"Usage" - + " Charge\",\"transactionAmount\":{\"currency\":\"zbzkdvncjabudurg\",\"value\":26.81675},\"quantity\":133724472,\"invoiceSectionId\":\"zhjjklffhmouwq\",\"invoiceSectionDisplayName\":\"zrfze\",\"billingProfileId\":\"ebizikayuh\",\"billingProfileDisplayName\":\"bjbsybb\",\"customerId\":\"r\",\"customerDisplayName\":\"ldgmfpgvmpip\",\"subscriptionId\":\"ltha\",\"subscriptionName\":\"x\",\"azurePlan\":\"mwutwbdsre\",\"azureCreditApplied\":{\"currency\":\"rhneuyowq\",\"value\":14.874917},\"billingCurrency\":\"t\",\"discount\":8.667755,\"effectivePrice\":{\"currency\":\"rcgp\",\"value\":82.618744},\"exchangeRate\":48.570366,\"marketPrice\":{\"currency\":\"j\",\"value\":71.50711},\"pricingCurrency\":\"fzxiavrmb\",\"servicePeriodStartDate\":\"2021-09-13T10:29:44Z\",\"servicePeriodEndDate\":\"2021-09-04T02:46:50Z\",\"subTotal\":{\"currency\":\"rjqc\",\"value\":39.849525},\"tax\":{\"currency\":\"frl\",\"value\":33.48236},\"unitOfMeasure\":\"rnwoiindfp\",\"units\":71.931244,\"unitType\":\"lwbtlhf\"},\"id\":\"sj\",\"name\":\"dhszfjv\",\"type\":\"bgofeljag\"}") - .toObject(TransactionInner.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransactionInner model = - new TransactionInner() - .withKind(TransactionTypeKind.RESERVATION) - .withTransactionType(ReservationType.USAGE_CHARGE); - model = BinaryData.fromObject(model).toObject(TransactionInner.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java deleted file mode 100644 index 08865890d0eed..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.TransactionListResult; - -public final class TransactionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransactionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"kind\":\"all\",\"date\":\"2021-11-17T05:10:44Z\",\"invoice\":\"l\",\"invoiceId\":\"qhoftrmaequiah\",\"orderId\":\"cslfaoqzpiyylha\",\"orderName\":\"swhccsphk\",\"productFamily\":\"vwitqscyw\",\"productTypeId\":\"gwol\",\"productType\":\"czbwemhairsbr\",\"productDescription\":\"dwmsweypqwd\",\"transactionType\":\"Usage" - + " Charge\",\"quantity\":98596504,\"invoiceSectionId\":\"n\",\"invoiceSectionDisplayName\":\"huexmk\",\"billingProfileId\":\"lstvlzywe\",\"billingProfileDisplayName\":\"zrncsdt\",\"customerId\":\"u\",\"customerDisplayName\":\"ypbsfgytguslfead\",\"subscriptionId\":\"gq\",\"subscriptionName\":\"yhejhzisxgfp\",\"azurePlan\":\"olppvksrpqvujz\",\"billingCurrency\":\"htwdwrftswibyrcd\",\"discount\":4.1148844,\"exchangeRate\":62.17856,\"pricingCurrency\":\"racstwity\",\"servicePeriodStartDate\":\"2021-10-09T17:15:47Z\",\"servicePeriodEndDate\":\"2021-11-26T04:46:53Z\",\"unitOfMeasure\":\"dcpnmdyodnw\",\"units\":98.19005,\"unitType\":\"jc\"},\"id\":\"nhltiugcxn\",\"name\":\"vvwxqi\",\"type\":\"y\"}],\"totalCount\":1643458041,\"nextLink\":\"owx\"}") - .toObject(TransactionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransactionListResult model = new TransactionListResult(); - model = BinaryData.fromObject(model).toObject(TransactionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java deleted file mode 100644 index c18ba9efdaced..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.TransactionProperties; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import org.junit.jupiter.api.Assertions; - -public final class TransactionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransactionProperties model = - BinaryData - .fromString( - "{\"kind\":\"reservation\",\"date\":\"2021-11-19T13:43:04Z\",\"invoice\":\"dvriiiojnal\",\"invoiceId\":\"fk\",\"orderId\":\"vsexsowuelu\",\"orderName\":\"hahhxvrhmzkwpj\",\"productFamily\":\"wspughftqsxhqx\",\"productTypeId\":\"xukndxdigr\",\"productType\":\"uufzdmsyqtfihw\",\"productDescription\":\"otzi\",\"transactionType\":\"Usage" - + " Charge\",\"transactionAmount\":{\"currency\":\"pph\",\"value\":41.082405},\"quantity\":1174017685,\"invoiceSectionId\":\"dphqamv\",\"invoiceSectionDisplayName\":\"fwynwcvtbvkay\",\"billingProfileId\":\"tnvyqiatkzwp\",\"billingProfileDisplayName\":\"p\",\"customerId\":\"cjaesgvvs\",\"customerDisplayName\":\"yajguqfhwygzlv\",\"subscriptionId\":\"kfxu\",\"subscriptionName\":\"mdwzrmuhapfcqdps\",\"azurePlan\":\"qvpsvuoymg\",\"azureCreditApplied\":{\"currency\":\"lvez\",\"value\":37.44613},\"billingCurrency\":\"lmfeokerq\",\"discount\":19.447208,\"effectivePrice\":{\"currency\":\"ob\",\"value\":38.23564},\"exchangeRate\":82.422646,\"marketPrice\":{\"currency\":\"owepbqpcrfkb\",\"value\":99.00544},\"pricingCurrency\":\"njv\",\"servicePeriodStartDate\":\"2020-12-20T11:43:27Z\",\"servicePeriodEndDate\":\"2021-06-07T08:17:55Z\",\"subTotal\":{\"currency\":\"ekftnkhtj\",\"value\":1.9628167},\"tax\":{\"currency\":\"wfqatmtd\",\"value\":20.163143},\"unitOfMeasure\":\"vypgikdg\",\"units\":99.876915,\"unitType\":\"kbir\"}") - .toObject(TransactionProperties.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransactionProperties model = - new TransactionProperties() - .withKind(TransactionTypeKind.RESERVATION) - .withTransactionType(ReservationType.USAGE_CHARGE); - model = BinaryData.fromObject(model).toObject(TransactionProperties.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java deleted file mode 100644 index f0d7396d584be..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.Transaction; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TransactionsListByInvoiceMockTests { - @Test - public void testListByInvoice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"kind\":\"reservation\",\"date\":\"2021-10-25T06:31:18Z\",\"invoice\":\"vne\",\"invoiceId\":\"aifghtmoqqt\",\"orderId\":\"fhzbkr\",\"orderName\":\"jjavfq\",\"productFamily\":\"hnqoewdo\",\"productTypeId\":\"yetesy\",\"productType\":\"idbz\",\"productDescription\":\"hqtfbovn\",\"transactionType\":\"Purchase\",\"transactionAmount\":{\"currency\":\"etnjuhpsprkz\",\"value\":20.758957},\"quantity\":333927859,\"invoiceSectionId\":\"ccxnafbwqroohtuo\",\"invoiceSectionDisplayName\":\"aonurjtumg\",\"billingProfileId\":\"hpv\",\"billingProfileDisplayName\":\"mslclblyjxlt\",\"customerId\":\"juscvsfx\",\"customerDisplayName\":\"ctmgxuupbezqccy\",\"subscriptionId\":\"tce\",\"subscriptionName\":\"d\",\"azurePlan\":\"ky\",\"azureCreditApplied\":{\"currency\":\"tg\",\"value\":65.07157},\"billingCurrency\":\"qzgwldoychil\",\"discount\":47.130497,\"effectivePrice\":{\"currency\":\"ehuwaoa\",\"value\":0.38245916},\"exchangeRate\":37.166195,\"marketPrice\":{\"currency\":\"lizst\",\"value\":20.003922},\"pricingCurrency\":\"vhrweftkwqejpmv\",\"servicePeriodStartDate\":\"2021-09-05T09:38:44Z\",\"servicePeriodEndDate\":\"2021-06-10T02:31:17Z\",\"subTotal\":{\"currency\":\"wamcxtczhup\",\"value\":59.264435},\"tax\":{\"currency\":\"jduyyespydjfb\",\"value\":9.652024},\"unitOfMeasure\":\"hhulrtywikdm\",\"units\":94.05045,\"unitType\":\"uflgbhgauacdixm\"},\"id\":\"ufr\",\"name\":\"ryjqgdkf\",\"type\":\"ozo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.transactions().listByInvoice("ctwwgzw", "jlmec", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(TransactionTypeKind.RESERVATION, response.iterator().next().kind()); - Assertions.assertEquals(ReservationType.PURCHASE, response.iterator().next().transactionType()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java deleted file mode 100644 index d25251d3efc7f..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class TransferBillingSubscriptionRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransferBillingSubscriptionRequestProperties model = - BinaryData - .fromString("{\"destinationInvoiceSectionId\":\"u\"}") - .toObject(TransferBillingSubscriptionRequestProperties.class); - Assertions.assertEquals("u", model.destinationInvoiceSectionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransferBillingSubscriptionRequestProperties model = - new TransferBillingSubscriptionRequestProperties().withDestinationInvoiceSectionId("u"); - model = BinaryData.fromObject(model).toObject(TransferBillingSubscriptionRequestProperties.class); - Assertions.assertEquals("u", model.destinationInvoiceSectionId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java deleted file mode 100644 index b1fac5e65b2c1..0000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class TransferProductRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransferProductRequestProperties model = - BinaryData - .fromString("{\"destinationInvoiceSectionId\":\"rfdwoyu\"}") - .toObject(TransferProductRequestProperties.class); - Assertions.assertEquals("rfdwoyu", model.destinationInvoiceSectionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransferProductRequestProperties model = - new TransferProductRequestProperties().withDestinationInvoiceSectionId("rfdwoyu"); - model = BinaryData.fromObject(model).toObject(TransferProductRequestProperties.class); - Assertions.assertEquals("rfdwoyu", model.destinationInvoiceSectionId()); - } -}